Documentation
¶
Index ¶
- Constants
- func GetTokenIdKey(userType guard.UserType, id int64) string
- func GetTokenKey(session string) string
- type Option
- type Options
- type RedisStore
- type Store
- type Token
- func (guard *Token) Cancellation(license string) error
- func (guard *Token) ExpiresAt(license string) int64
- 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)
Constants ¶
View Source
const ( Key = "auth.token.%s" IDKey = "auth.%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{}
func (*RedisStore) Save ¶ added in v1.0.0
func (rs *RedisStore) Save(token string, session *tokenInfo) error
type Store ¶ added in v1.0.0
type Token ¶
type Token struct { Store Store `inject:""` // contains filtered or unexported fields }
func (*Token) Cancellation ¶
Click to show internal directories.
Click to hide internal directories.