Documentation ¶
Index ¶
- Constants
- func ExtractFromSession(ginCtx *gin.Context, key string) (interface{}, bool)
- func GetApaleoAuthProvider(cfg *config.Config) (*openidConnect.Provider, error)
- func InitAuthProviders(cfg *config.Config) error
- func InitSessions(router *gin.Engine, cfg *config.Config)
- func StoreInSession(ginCtx *gin.Context, key string, value interface{})
- type Context
- type CurrentUser
- type HandlerFunc
- type HandlerResult
- type HtmlResult
- type JsonResult
Constants ¶
View Source
const ( SessionName = "myapp" CurrentUserSessionKey = "currentuser" RedirectURLSessionKey = "redirecturl" )
Variables ¶
This section is empty.
Functions ¶
func ExtractFromSession ¶
func GetApaleoAuthProvider ¶
func GetApaleoAuthProvider(cfg *config.Config) (*openidConnect.Provider, error)
func InitAuthProviders ¶
func StoreInSession ¶
Types ¶
type Context ¶
type Context struct { Db *gorm.DB Config *config.Config Ctx context.Context GinCtx *gin.Context Validator *validator.Validate Logger *zap.Logger User *CurrentUser }
func (*Context) SetCurrentUser ¶
func (*Context) SetCurrentUserIfExists ¶
func (ctx *Context) SetCurrentUserIfExists()
type CurrentUser ¶
func GetCurrentUser ¶
func GetCurrentUser(ginCtx *gin.Context) (CurrentUser, error)
type HandlerFunc ¶
type HandlerFunc func(*Context) HandlerResult
type HandlerResult ¶
type HtmlResult ¶
func (HtmlResult) Render ¶
func (r HtmlResult) Render(c *gin.Context)
type JsonResult ¶
type JsonResult struct { Status int Json interface{} }
func (JsonResult) Render ¶
func (r JsonResult) Render(c *gin.Context)
Click to show internal directories.
Click to hide internal directories.