Documentation ¶
Index ¶
- Variables
- 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
- type Config
- type Invoker
- type MiddlewareCallback
- type MysqlDriver
- type Permission
- type PersistenceDriver
- type Session
- type SessionInterface
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var TokenHelper = new(CSRFToken)
Functions ¶
func ComparePassword ¶
func EncodePassword ¶
func GetPermissions ¶
func GetPermissions(role_id interface{}) []map[string]interface{}
func InMethodArr ¶
Types ¶
type Invoker ¶
type Invoker struct {
// contains filtered or unexported fields
}
func (*Invoker) SetAuthFailCallback ¶
func (invoker *Invoker) SetAuthFailCallback(callback MiddlewareCallback) *Invoker
func (*Invoker) SetPermissionDenyCallback ¶
func (invoker *Invoker) SetPermissionDenyCallback(callback MiddlewareCallback) *Invoker
type MiddlewareCallback ¶
type MysqlDriver ¶
type MysqlDriver struct{}
var (
Driver MysqlDriver
)
func (*MysqlDriver) Load ¶
func (driver *MysqlDriver) Load(sid string) map[string]interface{}
func (*MysqlDriver) Update ¶
func (driver *MysqlDriver) Update(sid string, values map[string]interface{})
type Permission ¶
type PersistenceDriver ¶
type Session ¶
type Session struct { Expires time.Duration Cookie string Values map[string]interface{} Driver PersistenceDriver Sid string Context *context.Context }
func InitSession ¶
func (*Session) UpdateConfig ¶
func (*Session) UseDatabase ¶
func (ses *Session) UseDatabase(driver PersistenceDriver)
type SessionInterface ¶
type User ¶
type User struct { ID string Level string Name string LevelName string CreateAt string Avatar string Permissions []Permission Menus []int64 }
func GetCurUserById ¶
func (User) IsSuperAdmin ¶
Click to show internal directories.
Click to hide internal directories.