token

package
v0.0.0-...-c1a347c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL