"use strict";(self.webpackChunkgoffee_site=self.webpackChunkgoffee_site||[]).push([[8289],{9976:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>s,default:()=>u,frontMatter:()=>c,metadata:()=>i,toc:()=>d});var r=n(4848),o=n(8453);const c={title:"Redirect"},s=void 0,i={id:"redirect",title:"Redirect",description:"To redirect to any URL internal or external simply call the context's method Redirect, here is how you can do it:",source:"@site/docs/redirect.md",sourceDirName:".",slug:"/redirect",permalink:"/goffee/docs/redirect",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{title:"Redirect"}},a={},d=[];function l(e){const t={a:"a",code:"code",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["To redirect to any URL internal or external simply call the context's method ",(0,r.jsx)(t.code,{children:"Redirect"}),", here is how you can do it:"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",children:'func SomeHandler(c *core.Context){\n    c.Redirect(http.StatusMovedPermanently, "https://google.com")\n}\n'})}),"\n",(0,r.jsxs)(t.p,{children:["Here is a list of ",(0,r.jsx)(t.a,{href:"https://golang.org/src/net/http/status.go",children:"all HTTP codes"})]})]})}function u(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>i});var r=n(6540);const o={},c=r.createContext(o);function s(e){const t=r.useContext(c);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),r.createElement(c.Provider,{value:t},e.children)}}}]);