Documentation
¶
Index ¶
- Variables
- func Error404(c *gin.Context)
- func GetCookieSession(ctx *gin.Context) *sessions.Session
- func Index(c *gin.Context)
- func Redirect(c *gin.Context, redirectPath, errMsg string)
- func Request(ctx *gin.Context) *http.Request
- func Response(c *gin.Context, err error, data interface{})
- func ResponseWriter(ctx *gin.Context) http.ResponseWriter
- func SetLoginCookie(ctx *gin.Context, userID uint64)
- type Resp
Constants ¶
This section is empty.
Variables ¶
View Source
var Store = sessions.NewCookieStore([]byte(viper.GetString("cookie.secret")))
Store It is recommended to use an authentication key with 32 or 64 bytes. The encryption key, if set, must be either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256 modes.
Functions ¶
func GetCookieSession ¶
GetCookieSession get cookie
func ResponseWriter ¶
func ResponseWriter(ctx *gin.Context) http.ResponseWriter
ResponseWriter return a response writer
func SetLoginCookie ¶
SetLoginCookie set login cookie to session
Types ¶
Click to show internal directories.
Click to hide internal directories.