Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryToken ¶
type MemoryToken struct {
// contains filtered or unexported fields
}
func (*MemoryToken) Add ¶
func (s *MemoryToken) Add(key string, uid interface{}, expiredAfter time.Duration) (err error)
func (*MemoryToken) Get ¶
func (s *MemoryToken) Get(key string) (uid interface{}, err error)
type TokenAuthOnMongod ¶
type TokenAuthOnMongod struct { TokenName string MongodURL string TableName string ExpiredAfter time.Duration // contains filtered or unexported fields }
func (*TokenAuthOnMongod) Add ¶
func (s *TokenAuthOnMongod) Add(key string, uid interface{}, expiredAfter time.Duration) (err error)
func (*TokenAuthOnMongod) Get ¶
func (s *TokenAuthOnMongod) Get(key string) (uid interface{}, err error)
type TokenAuthOnRedis ¶
type TokenAuthOnRedis struct {
// contains filtered or unexported fields
}
func NewTokenAuthOnRedis ¶
func NewTokenAuthOnRedis(tokenName, loginURL, redisURL string, expired time.Duration) *TokenAuthOnRedis
type TokenStore ¶
type TokenStore interface { Add(key string, uid interface{}, expired time.Duration) (err error) Get(key string) (uid interface{}, err error) }
func NewMemoryToken ¶
func NewMemoryToken() TokenStore
func NewTokenAuthOnMongod ¶
func NewTokenAuthOnMongod(mongodURL, tableName, tokenName string) TokenStore
Click to show internal directories.
Click to hide internal directories.