Versions in this module Expand all Collapse all v0 v0.0.2 Sep 19, 2018 Changes in this version + var TokenHelper = new(CSRFToken) + func CheckPermissions(user User, path string, method string) bool + func ComparePassword(comPwd, pwdHash string) bool + func DelCookie(ctx *context.Context) bool + func EncodePassword(pwd []byte) string + func GetPermissions(role_id interface{}) []map[string]interface + func InMethodArr(arr []string, str string) bool + func SetCookie(ctx *context.Context, user User) bool + type CSRFToken []string + func (token *CSRFToken) AddToken() string + func (token *CSRFToken) CheckToken(tocheck string) bool + type Config struct + Cookie string + Expires time.Duration + type Invoker struct + func SetPrefix(prefix string) *Invoker + func (invoker *Invoker) Middleware(h context.Handler) context.Handler + func (invoker *Invoker) SetAuthFailCallback(callback MiddlewareCallback) *Invoker + func (invoker *Invoker) SetPermissionDenyCallback(callback MiddlewareCallback) *Invoker + type MiddlewareCallback func(ctx *context.Context) + type MysqlDriver struct + var Driver MysqlDriver + func (driver *MysqlDriver) Load(sid string) map[string]interface{} + func (driver *MysqlDriver) Update(sid string, values map[string]interface{}) + type Permission struct + Method []string + Path []string + type PersistenceDriver interface + Load func(string) map[string]interface{} + Update func(sid string, values map[string]interface{}) + type Session struct + Context *context.Context + Cookie string + Driver PersistenceDriver + Expires time.Duration + Sid string + Values map[string]interface{} + func InitSession(ctx *context.Context) *Session + func (ses *Session) Clear() + func (ses *Session) Get(key string) interface{} + func (ses *Session) Set(key string, value interface{}) + func (ses *Session) StartCtx(ctx *context.Context) *Session + func (ses *Session) UpdateConfig(config Config) + func (ses *Session) UseDatabase(driver PersistenceDriver) + type SessionInterface interface + Get func(string) interface{} + Set func(string, interface{}) + StartCtx func(*context.Context) Session + UseDatabase func(PersistenceDriver) + type User struct + Avatar string + CreateAt string + ID string + Level string + LevelName string + Menus []int64 + Name string + Permissions []Permission + func Check(password string, username string) (user User, ok bool) + func Filter(ctx *context.Context) (User, bool, bool) + func GetCurUserById(id string) (user User, ok bool) + func (user User) IsSuperAdmin() bool