store

package
v0.0.0-...-865f097 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JWTRedis 当前服务前缀
	JWTRedis = "jwt:"
	// JWTRedisUsers 当前服务用户相关
	JWTRedisUsers = "jwt:users:"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisTokenStore

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

RedisTokenStore redis token store

func NewRedisClusterStore

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

NewRedisClusterStore create an instance of a redis cluster store

func NewRedisClusterStoreWithCli

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

NewRedisClusterStoreWithCli create an instance of a redis cluster store

func NewRedisStore

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

NewRedisStore create an instance of a redis store

func NewRedisStoreWithCli

func NewRedisStoreWithCli(cli *redis.Client, keyNamespace ...string) *RedisTokenStore

NewRedisStoreWithCli create an instance of a redis store

func (*RedisTokenStore) Close

func (s *RedisTokenStore) Close() error

Close close the store

func (*RedisTokenStore) Create

func (s *RedisTokenStore) Create(ctx context.Context, info jwts.TokenInfo) error

Create Create and store the new token information

func (*RedisTokenStore) GetByAccess

func (s *RedisTokenStore) GetByAccess(ctx context.Context, access string) (jwts.TokenInfo, error)

GetByAccess Use the access token for token information data

func (*RedisTokenStore) GetByCode

func (s *RedisTokenStore) GetByCode(ctx context.Context, code string) (jwts.TokenInfo, error)

GetByCode Use the authorization code for token information data

func (*RedisTokenStore) GetByRefresh

func (s *RedisTokenStore) GetByRefresh(ctx context.Context, refresh string) (jwts.TokenInfo, error)

GetByRefresh Use the refresh token for token information data

func (*RedisTokenStore) RemoveByAccess

func (s *RedisTokenStore) RemoveByAccess(ctx context.Context, access string) error

RemoveByAccess Use the access token to delete the token information

func (*RedisTokenStore) RemoveByCode

func (s *RedisTokenStore) RemoveByCode(ctx context.Context, code string) error

RemoveByCode Use the authorization code to delete the token information

func (*RedisTokenStore) RemoveByRefresh

func (s *RedisTokenStore) RemoveByRefresh(ctx context.Context, refresh string) error

RemoveByRefresh Use the refresh token to delete the token information

func (*RedisTokenStore) RemoveToken

func (s *RedisTokenStore) RemoveToken(ctx context.Context, jti string) error

RemoveToken Use the jti to delete the token information data

Jump to

Keyboard shortcuts

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