Documentation
¶
Index ¶
- Constants
- func GetTokenIdKey(userType guard.UserType, id int64) string
- func GetTokenKey(session string) string
- type Option
- type Options
- type RedisStore
- func (rs *RedisStore) Exist(token string) bool
- func (rs *RedisStore) Expired(license string) error
- func (rs *RedisStore) Get(token string) (*TokenInfo, error)
- func (rs *RedisStore) GetByUid(uType guard.UserType, uid int64) (*TokenInfo, error)
- func (rs *RedisStore) Provide(ctx context.Context) interface{}
- func (rs *RedisStore) Save(token string, session *TokenInfo) error
- type Store
- type Token
- func (guard *Token) Cancellation(license string) error
- func (guard *Token) ExpiresAt(license string) int64
- func (guard *Token) GetLicense(userType guard.UserType, uid int64) (string, error)
- func (guard *Token) IssuerAt(license string) int64
- func (guard *Token) License(user *guard.User) (string, error)
- func (guard *Token) Provide(ctx context.Context) interface{}
- func (guard *Token) Verify(license string) (*guard.User, error)
- type TokenInfo
Constants ¶
View Source
const ( Key = "auth:token:%s" IDKey = "auth:uid:%d.%d" // auth.type.id )
Variables ¶
This section is empty.
Functions ¶
func GetTokenKey ¶ added in v1.0.0
Types ¶
type RedisStore ¶ added in v1.0.0
type RedisStore struct {
// contains filtered or unexported fields
}
func (*RedisStore) Exist ¶ added in v1.0.28
func (rs *RedisStore) Exist(token string) bool
func (*RedisStore) Expired ¶ added in v1.0.0
func (rs *RedisStore) Expired(license string) error
func (*RedisStore) Get ¶ added in v1.0.0
func (rs *RedisStore) Get(token string) (*TokenInfo, error)
func (*RedisStore) Provide ¶ added in v1.0.0
func (rs *RedisStore) Provide(ctx context.Context) interface{}
type Store ¶ added in v1.0.0
type Token ¶
type Token struct { Store Store `inject:""` // contains filtered or unexported fields }
func (*Token) Cancellation ¶
func (*Token) GetLicense ¶
Click to show internal directories.
Click to hide internal directories.