store

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileTokenStore

func NewFileTokenStore(filename string) (oauth2.TokenStore, error)

NewFileTokenStore create a token store instance based on file

func NewMemoryTokenStore

func NewMemoryTokenStore() (oauth2.TokenStore, error)

NewMemoryTokenStore create a token store instance based on memory

func NewRedisStore

func NewRedisStore(opts *redis.Options, keyNamespace ...string) oauth2.TokenStore

NewRedisStore create an instance of a redis store

Types

type ClientStore

type ClientStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ClientStore client information store

func NewClientStore

func NewClientStore() *ClientStore

NewClientStore create client store

func (*ClientStore) GetByID

func (cs *ClientStore) GetByID(id string) (oauth2.ClientInfo, error)

GetByID according to the ID for the client information

func (*ClientStore) Set

func (cs *ClientStore) Set(id string, cli oauth2.ClientInfo) (err error)

Set set client information

type MemStore

type MemStore struct {
	// contains filtered or unexported fields
}

MemStore token storage based on buntdb(https://github.com/tidwall/buntdb)

func (*MemStore) Create

func (ts *MemStore) Create(info oauth2.TokenInfo) error

Create create and store the new token information

func (*MemStore) GetByAccess

func (ts *MemStore) GetByAccess(access string) (oauth2.TokenInfo, error)

GetByAccess use the access token for token information data

func (*MemStore) GetByCode

func (ts *MemStore) GetByCode(code string) (oauth2.TokenInfo, error)

GetByCode use the authorization code for token information data

func (*MemStore) GetByRefresh

func (ts *MemStore) GetByRefresh(refresh string) (oauth2.TokenInfo, error)

GetByRefresh use the refresh token for token information data

func (*MemStore) RemoveByAccess

func (ts *MemStore) RemoveByAccess(access string) error

RemoveByAccess use the access token to delete the token information

func (*MemStore) RemoveByCode

func (ts *MemStore) RemoveByCode(code string) error

RemoveByCode use the authorization code to delete the token information

func (*MemStore) RemoveByRefresh

func (ts *MemStore) RemoveByRefresh(refresh string) error

RemoveByRefresh use the refresh token to delete the token information

type RedisStore

type RedisStore struct {
	// contains filtered or unexported fields
}

RedisStore redis token store

func NewRedisClusterStore

func NewRedisClusterStore(opts *redis.ClusterOptions, keyNamespace ...string) *RedisStore

NewRedisClusterStore create an instance of a redis cluster store

func NewRedisClusterStoreWithCli

func NewRedisClusterStoreWithCli(cli *redis.ClusterClient, keyNamespace ...string) *RedisStore

NewRedisClusterStoreWithCli create an instance of a redis cluster store

func NewRedisStoreWithCli

func NewRedisStoreWithCli(cli redis.Cmdable, keyNamespace ...string) *RedisStore

NewRedisStoreWithCli create an instance of a redis store

func (*RedisStore) Close

func (s *RedisStore) Close() error

Close close the store

func (*RedisStore) Create

func (s *RedisStore) Create(info oauth2.TokenInfo) error

Create Create and store the new token information

func (*RedisStore) GetByAccess

func (s *RedisStore) GetByAccess(access string) (oauth2.TokenInfo, error)

GetByAccess Use the access token for token information data

func (*RedisStore) GetByCode

func (s *RedisStore) GetByCode(code string) (oauth2.TokenInfo, error)

GetByCode Use the authorization code for token information data

func (*RedisStore) GetByRefresh

func (s *RedisStore) GetByRefresh(refresh string) (oauth2.TokenInfo, error)

GetByRefresh Use the refresh token for token information data

func (*RedisStore) RemoveByAccess

func (s *RedisStore) RemoveByAccess(access string) error

RemoveByAccess Use the access token to delete the token information

func (*RedisStore) RemoveByCode

func (s *RedisStore) RemoveByCode(code string) error

RemoveByCode Use the authorization code to delete the token information

func (*RedisStore) RemoveByRefresh

func (s *RedisStore) RemoveByRefresh(refresh string) error

RemoveByRefresh Use the refresh token to delete the token information

Jump to

Keyboard shortcuts

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