Documentation ¶
Index ¶
- func NewFileTokenStore(filename string) (oauth2.TokenStore, error)
- func NewMemoryTokenStore() (oauth2.TokenStore, error)
- func NewRedisStore(opts *redis.Options, keyNamespace ...string) oauth2.TokenStore
- type ClientStore
- type MemStore
- func (ts *MemStore) Create(info oauth2.TokenInfo) error
- func (ts *MemStore) GetByAccess(access string) (oauth2.TokenInfo, error)
- func (ts *MemStore) GetByCode(code string) (oauth2.TokenInfo, error)
- func (ts *MemStore) GetByRefresh(refresh string) (oauth2.TokenInfo, error)
- func (ts *MemStore) RemoveByAccess(access string) error
- func (ts *MemStore) RemoveByCode(code string) error
- func (ts *MemStore) RemoveByRefresh(refresh string) error
- type RedisStore
- func (s *RedisStore) Close() error
- func (s *RedisStore) Create(info oauth2.TokenInfo) error
- func (s *RedisStore) GetByAccess(access string) (oauth2.TokenInfo, error)
- func (s *RedisStore) GetByCode(code string) (oauth2.TokenInfo, error)
- func (s *RedisStore) GetByRefresh(refresh string) (oauth2.TokenInfo, error)
- func (s *RedisStore) RemoveByAccess(access string) error
- func (s *RedisStore) RemoveByCode(code string) error
- func (s *RedisStore) RemoveByRefresh(refresh string) error
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 ¶
ClientStore client information 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) GetByAccess ¶
GetByAccess use the access token for token information data
func (*MemStore) GetByRefresh ¶
GetByRefresh use the refresh token for token information data
func (*MemStore) RemoveByAccess ¶
RemoveByAccess use the access token to delete the token information
func (*MemStore) RemoveByCode ¶
RemoveByCode use the authorization code to delete the token information
func (*MemStore) RemoveByRefresh ¶
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.Client, keyNamespace ...string) *RedisStore
NewRedisStoreWithCli create an instance of a redis 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