Documentation ¶
Index ¶
- func NewFileTokenStore(filename string) (oauth2.TokenStore, error)
- func NewMemoryTokenStore() (oauth2.TokenStore, error)
- type ClientStore
- type RedisTokenStore
- func NewRedisClusterStore(opts *redis.ClusterOptions, keyNamespace ...string) *RedisTokenStore
- func NewRedisClusterStoreWithCli(cli *redis.ClusterClient, keyNamespace ...string) *RedisTokenStore
- func NewRedisStore(opts *redis.Options, keyNamespace ...string) *RedisTokenStore
- func NewRedisStoreWithCli(cli *redis.Client, keyNamespace ...string) *RedisTokenStore
- func (s *RedisTokenStore) Close() error
- func (s *RedisTokenStore) Create(ctx context.Context, info oauth2.TokenInfo) error
- func (s *RedisTokenStore) GetByAccess(ctx context.Context, access string) (oauth2.TokenInfo, error)
- func (s *RedisTokenStore) GetByCode(ctx context.Context, code string) (oauth2.TokenInfo, error)
- func (s *RedisTokenStore) GetByRefresh(ctx context.Context, refresh string) (oauth2.TokenInfo, error)
- func (s *RedisTokenStore) RemoveByAccess(ctx context.Context, access string) error
- func (s *RedisTokenStore) RemoveByCode(ctx context.Context, code string) error
- func (s *RedisTokenStore) RemoveByRefresh(ctx context.Context, refresh string) error
- type TokenStore
- func (ts *TokenStore) Create(ctx context.Context, info oauth2.TokenInfo) error
- func (ts *TokenStore) GetByAccess(ctx context.Context, access string) (oauth2.TokenInfo, error)
- func (ts *TokenStore) GetByCode(ctx context.Context, code string) (oauth2.TokenInfo, error)
- func (ts *TokenStore) GetByRefresh(ctx context.Context, refresh string) (oauth2.TokenInfo, error)
- func (ts *TokenStore) RemoveByAccess(ctx context.Context, access string) error
- func (ts *TokenStore) RemoveByCode(ctx context.Context, code string) error
- func (ts *TokenStore) RemoveByRefresh(ctx context.Context, 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
Types ¶
type ClientStore ¶
ClientStore client information store
func (*ClientStore) GetByID ¶
func (cs *ClientStore) GetByID(ctx context.Context, 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 RedisTokenStore ¶ added in v1.0.1
type RedisTokenStore struct {
// contains filtered or unexported fields
}
TokenStore redis token store
func NewRedisClusterStore ¶ added in v1.0.1
func NewRedisClusterStore(opts *redis.ClusterOptions, keyNamespace ...string) *RedisTokenStore
NewRedisClusterStore create an instance of a redis cluster store
func NewRedisClusterStoreWithCli ¶ added in v1.0.1
func NewRedisClusterStoreWithCli(cli *redis.ClusterClient, keyNamespace ...string) *RedisTokenStore
NewRedisClusterStoreWithCli create an instance of a redis cluster store
func NewRedisStore ¶ added in v1.0.1
func NewRedisStore(opts *redis.Options, keyNamespace ...string) *RedisTokenStore
NewRedisStore create an instance of a redis store
func NewRedisStoreWithCli ¶ added in v1.0.1
func NewRedisStoreWithCli(cli *redis.Client, keyNamespace ...string) *RedisTokenStore
NewRedisStoreWithCli create an instance of a redis store
func (*RedisTokenStore) Close ¶ added in v1.0.1
func (s *RedisTokenStore) Close() error
Close close the store
func (*RedisTokenStore) GetByAccess ¶ added in v1.0.1
GetByAccess Use the access token for token information data
func (*RedisTokenStore) GetByCode ¶ added in v1.0.1
GetByCode Use the authorization code for token information data
func (*RedisTokenStore) GetByRefresh ¶ added in v1.0.1
func (s *RedisTokenStore) GetByRefresh(ctx context.Context, refresh string) (oauth2.TokenInfo, error)
GetByRefresh Use the refresh token for token information data
func (*RedisTokenStore) RemoveByAccess ¶ added in v1.0.1
func (s *RedisTokenStore) RemoveByAccess(ctx context.Context, access string) error
RemoveByAccess Use the access token to delete the token information
func (*RedisTokenStore) RemoveByCode ¶ added in v1.0.1
func (s *RedisTokenStore) RemoveByCode(ctx context.Context, code string) error
RemoveByCode Use the authorization code to delete the token information
func (*RedisTokenStore) RemoveByRefresh ¶ added in v1.0.1
func (s *RedisTokenStore) RemoveByRefresh(ctx context.Context, refresh string) error
RemoveByRefresh Use the refresh token to delete the token information
type TokenStore ¶
type TokenStore struct {
// contains filtered or unexported fields
}
TokenStore token storage based on buntdb(https://github.com/tidwall/buntdb)
func (*TokenStore) GetByAccess ¶
GetByAccess use the access token for token information data
func (*TokenStore) GetByRefresh ¶
GetByRefresh use the refresh token for token information data
func (*TokenStore) RemoveByAccess ¶
func (ts *TokenStore) RemoveByAccess(ctx context.Context, access string) error
RemoveByAccess use the access token to delete the token information
func (*TokenStore) RemoveByCode ¶
func (ts *TokenStore) RemoveByCode(ctx context.Context, code string) error
RemoveByCode use the authorization code to delete the token information
func (*TokenStore) RemoveByRefresh ¶
func (ts *TokenStore) RemoveByRefresh(ctx context.Context, refresh string) error
RemoveByRefresh use the refresh token to delete the token information