Documentation ¶
Index ¶
- Variables
- func Auth(ctx *context.Context) models.UserModel
- func Check(password string, username string) (user models.UserModel, ok bool)
- func CheckPermissions(user models.UserModel, path string, method string) bool
- func DelCookie(ctx *context.Context) bool
- func EncodePassword(pwd []byte) string
- func Filter(ctx *context.Context) (models.UserModel, bool, bool)
- func GetCurUserById(id int64) (user models.UserModel, ok bool)
- func InMethodArr(arr []string, str string) bool
- func SetCookie(ctx *context.Context, user models.UserModel) bool
- type CSRFToken
- type Config
- type Invoker
- type MiddlewareCallback
- type MysqlDriver
- type PersistenceDriver
- type Session
- type SessionInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var Middleware = DefaultInvoker().Middleware()
View Source
var TokenHelper = new(CSRFToken)
Functions ¶
func CheckPermissions ¶
func EncodePassword ¶
func InMethodArr ¶
Types ¶
type Invoker ¶
type Invoker struct {
// contains filtered or unexported fields
}
func DefaultInvoker ¶ added in v0.0.5
func DefaultInvoker() *Invoker
func (*Invoker) Middleware ¶
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 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 ¶
Click to show internal directories.
Click to hide internal directories.