Documentation ¶
Overview ¶
*
@author: junwang @since: 2023/8/28 @desc: //TODO
*
Index ¶
- Constants
- type ClientStore
- func NewClientClusterStore(opts *redis.ClusterOptions, keyNamespace ...string) *ClientStore
- func NewClientClusterStoreWithCli(cli *redis.ClusterClient, keyNamespace ...string) *ClientStore
- func NewClientStore(opts *redis.Options, keyNamespace ...string) *ClientStore
- func NewClientStoreWithCli(cli *redis.Client, keyNamespace ...string) *ClientStore
- func (s *ClientStore) Close() error
- func (s *ClientStore) CreateClient(ctx context.Context, info oauth2.ClientInfo) error
- func (s *ClientStore) CreateClientPermission(ctx context.Context, clientId string, info []oauth2.ClientPermissionInfo) error
- func (s *ClientStore) GetByID(ctx context.Context, key string) (oauth2.ClientInfo, error)
- func (s *ClientStore) GetPermissionByID(ctx context.Context, key string) ([]oauth2.ClientPermissionInfo, error)
- func (s *ClientStore) RemoveClientInfoById(ctx context.Context, clientId string) error
- 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 ¶
const CLIENT_INFO = "CLIENT_INFO:"
const CLIENT_PERMISSIONS = "CLIENT_PERMISSIONS:"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientStore ¶ added in v1.0.3
type ClientStore struct {
// contains filtered or unexported fields
}
TokenStore redis token store
func NewClientClusterStore ¶ added in v1.0.3
func NewClientClusterStore(opts *redis.ClusterOptions, keyNamespace ...string) *ClientStore
NewRedisClusterStore create an instance of a redis cluster store
func NewClientClusterStoreWithCli ¶ added in v1.0.3
func NewClientClusterStoreWithCli(cli *redis.ClusterClient, keyNamespace ...string) *ClientStore
NewRedisClusterStoreWithCli create an instance of a redis cluster store
func NewClientStore ¶ added in v1.0.3
func NewClientStore(opts *redis.Options, keyNamespace ...string) *ClientStore
NewRedisStore create an instance of a redis store
func NewClientStoreWithCli ¶ added in v1.0.3
func NewClientStoreWithCli(cli *redis.Client, keyNamespace ...string) *ClientStore
NewRedisStoreWithCli create an instance of a redis store
func (*ClientStore) Close ¶ added in v1.0.3
func (s *ClientStore) Close() error
Close close the store
func (*ClientStore) CreateClient ¶ added in v1.0.3
func (s *ClientStore) CreateClient(ctx context.Context, info oauth2.ClientInfo) error
Create Create and store the new client information
func (*ClientStore) CreateClientPermission ¶ added in v1.0.3
func (s *ClientStore) CreateClientPermission(ctx context.Context, clientId string, info []oauth2.ClientPermissionInfo) error
func (*ClientStore) GetByID ¶ added in v1.0.3
func (s *ClientStore) GetByID(ctx context.Context, key string) (oauth2.ClientInfo, error)
func (*ClientStore) GetPermissionByID ¶ added in v1.0.3
func (s *ClientStore) GetPermissionByID(ctx context.Context, key string) ([]oauth2.ClientPermissionInfo, error)
func (*ClientStore) RemoveClientInfoById ¶ added in v1.0.4
func (s *ClientStore) RemoveClientInfoById(ctx context.Context, clientId string) error
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) 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 (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