Documentation ¶
Index ¶
- func SetupSession()
- type TokenStore
- func NewRedisClusterStore(opts *redis.ClusterOptions, keyNamespace ...string) *TokenStore
- func NewRedisClusterStoreWithCli(cli *redis.ClusterClient, keyNamespace ...string) *TokenStore
- func NewRedisStore(opts *redis.Options, keyNamespace ...string) *TokenStore
- func NewRedisStoreWithCli(cli *redis.Client, keyNamespace ...string) *TokenStore
- func (s *TokenStore) Close() error
- func (s *TokenStore) Create(ctx context.Context, info oauth2.TokenInfo) error
- func (s *TokenStore) GetByAccess(ctx context.Context, access string) (oauth2.TokenInfo, error)
- func (s *TokenStore) GetByCode(ctx context.Context, code string) (oauth2.TokenInfo, error)
- func (s *TokenStore) GetByRefresh(ctx context.Context, refresh string) (oauth2.TokenInfo, error)
- func (s *TokenStore) RemoveByAccess(ctx context.Context, access string) error
- func (s *TokenStore) RemoveByCode(ctx context.Context, code string) error
- func (s *TokenStore) RemoveByRefresh(ctx context.Context, refresh string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupSession ¶
func SetupSession()
Types ¶
type TokenStore ¶
type TokenStore struct {
// contains filtered or unexported fields
}
TokenStore redis token store
func NewRedisClusterStore ¶
func NewRedisClusterStore(opts *redis.ClusterOptions, keyNamespace ...string) *TokenStore
NewRedisClusterStore create an instance of a redis cluster store
func NewRedisClusterStoreWithCli ¶
func NewRedisClusterStoreWithCli(cli *redis.ClusterClient, keyNamespace ...string) *TokenStore
NewRedisClusterStoreWithCli create an instance of a redis cluster store
func NewRedisStore ¶
func NewRedisStore(opts *redis.Options, keyNamespace ...string) *TokenStore
NewRedisStore create an instance of a redis store
func NewRedisStoreWithCli ¶
func NewRedisStoreWithCli(cli *redis.Client, keyNamespace ...string) *TokenStore
NewRedisStoreWithCli create an instance of a redis store
func (*TokenStore) Create ¶
func (s *TokenStore) Create(ctx context.Context, info oauth2.TokenInfo) error
Create Create and store the new token information
func (*TokenStore) GetByAccess ¶
func (s *TokenStore) GetByAccess(ctx context.Context, access string) (oauth2.TokenInfo, error)
GetByAccess Use the access token for token information data
func (*TokenStore) GetByCode ¶
func (s *TokenStore) GetByCode(ctx context.Context, code string) (oauth2.TokenInfo, error)
GetByCode Use the authorization code for token information data
func (*TokenStore) GetByRefresh ¶
func (s *TokenStore) GetByRefresh(ctx context.Context, refresh string) (oauth2.TokenInfo, error)
GetByRefresh Use the refresh token for token information data
func (*TokenStore) RemoveByAccess ¶
func (s *TokenStore) RemoveByAccess(ctx context.Context, access string) error
RemoveByAccess Use the access token to delete the token information
func (*TokenStore) RemoveByCode ¶
func (s *TokenStore) RemoveByCode(ctx context.Context, code string) error
RemoveByCode Use the authorization code to delete the token information
func (*TokenStore) RemoveByRefresh ¶
func (s *TokenStore) RemoveByRefresh(ctx context.Context, refresh string) error
RemoveByRefresh Use the refresh token to delete the token information