Documentation ¶
Index ¶
- Variables
- func CheckPosition(position string) error
- func CheckSkill(skill string) bool
- func GetToken(ctx http_service.IHttpContext, tokenName string, position string) (string, bool)
- func HideToken(ctx http_service.IHttpContext, tokenName string, position string)
- type Auth
- type BaseConfig
- type IApp
- type IAppExecutor
- type IAuth
- type IAuthUser
- type ITransformConfig
- type IUser
- type IUserManager
- type User
- type UserInfo
- type UserManager
- func (u *UserManager) Check(appID string, driver string, users []IUser) error
- func (u *UserManager) Count() int
- func (u *UserManager) Del(name string)
- func (u *UserManager) DelByAppID(appID string)
- func (u *UserManager) Get(name string) (*UserInfo, bool)
- func (u *UserManager) List() []*UserInfo
- func (u *UserManager) Set(appID string, users []*UserInfo)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTokenNotFound = errors.New("token not found") ErrInvalidToken = errors.New("invalid token") ErrTokenExpired = errors.New("token is expired") )
View Source
var ( PositionHeader = "header" PositionQuery = "query" PositionBody = "body" )
Functions ¶
func CheckPosition ¶
func CheckSkill ¶
func GetToken ¶
func GetToken(ctx http_service.IHttpContext, tokenName string, position string) (string, bool)
func HideToken ¶
func HideToken(ctx http_service.IHttpContext, tokenName string, position string)
Types ¶
type BaseConfig ¶
type BaseConfig struct {
// contains filtered or unexported fields
}
func (*BaseConfig) Config ¶
func (a *BaseConfig) Config() interface{}
func (*BaseConfig) MarshalJSON ¶
func (a *BaseConfig) MarshalJSON() ([]byte, error)
func (*BaseConfig) UnmarshalJSON ¶
func (a *BaseConfig) UnmarshalJSON(bytes []byte) error
type IAppExecutor ¶
type IAppExecutor interface {
Execute(ctx http_service.IHttpContext) error
}
type IAuth ¶
type IAuth interface { ID() string Check(appID string, users []ITransformConfig) error Set(app IApp, users []ITransformConfig) Del(appID string) UserCount() int IAuthUser }
type IAuthUser ¶
type IAuthUser interface { Driver() string GetUser(ctx http_service.IHttpContext) (*UserInfo, bool) }
type ITransformConfig ¶
type IUserManager ¶
type UserManager ¶
type UserManager struct {
// contains filtered or unexported fields
}
func NewUserManager ¶
func NewUserManager() *UserManager
func (*UserManager) Check ¶
func (u *UserManager) Check(appID string, driver string, users []IUser) error
func (*UserManager) Count ¶
func (u *UserManager) Count() int
func (*UserManager) Del ¶
func (u *UserManager) Del(name string)
func (*UserManager) DelByAppID ¶
func (u *UserManager) DelByAppID(appID string)
func (*UserManager) List ¶
func (u *UserManager) List() []*UserInfo
func (*UserManager) Set ¶
func (u *UserManager) Set(appID string, users []*UserInfo)
Click to show internal directories.
Click to hide internal directories.