Documentation
¶
Index ¶
- type BasicRedis
- type RedisStore
- func (r *RedisStore[T]) Close() error
- func (r *RedisStore[T]) Delete(ctx context.Context, key string) error
- func (r *RedisStore[T]) Exists(ctx context.Context, key string) (bool, error)
- func (r *RedisStore[T]) Get(ctx context.Context, key string) (string, error)
- func (r *RedisStore[T]) GetRefreshTokenFromStore(ctx context.Context, token string) (string, error)
- func (r *RedisStore[T]) Set(ctx context.Context, key, value string, expiration time.Duration) error
- func (r *RedisStore[T]) Test(ctx context.Context) error
- type RedisStoreBuilder
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicRedis ¶
type BasicRedis interface { Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd Exists(ctx context.Context, key ...string) *redis.IntCmd Get(ctx context.Context, key string) *redis.StringCmd Del(ctx context.Context, key ...string) *redis.IntCmd Ping(ctx context.Context) *redis.StatusCmd Close() error }
type RedisStore ¶
type RedisStore[T BasicRedis] struct { Client BasicRedis }
func (*RedisStore[T]) Close ¶
func (r *RedisStore[T]) Close() error
Close closes of any open resources.
func (*RedisStore[T]) Delete ¶
func (r *RedisStore[T]) Delete(ctx context.Context, key string) error
Delete remove the key.
func (*RedisStore[T]) GetRefreshTokenFromStore ¶
func (r *RedisStore[T]) GetRefreshTokenFromStore( ctx context.Context, token string, ) (string, error)
Get retrieves a token from the store, the key we are using here is the access token.
type RedisStoreBuilder ¶
type RedisStoreBuilder struct {
// contains filtered or unexported fields
}
func (*RedisStoreBuilder) Build ¶
func (b *RedisStoreBuilder) Build() Storage
func (*RedisStoreBuilder) WithCACert ¶
func (b *RedisStoreBuilder) WithCACert(caPool *x509.CertPool) *RedisStoreBuilder
func (*RedisStoreBuilder) WithClientCert ¶
func (b *RedisStoreBuilder) WithClientCert(tlsCert *tls.Certificate) *RedisStoreBuilder
type Storage ¶
type Storage interface { // Set the token to the store Set(ctx context.Context, key string, value string, expiration time.Duration) error // Get retrieves a token from the store Get(ctx context.Context, key string) (string, error) // Exists checks if key exists in store Exists(ctx context.Context, key string) (bool, error) // Delete removes a key from the store Delete(ctx context.Context, key string) error // Close is used to close off any resources Close() error GetRefreshTokenFromStore(ctx context.Context, token string) (string, error) Test(ctx context.Context) error }
storage is used to hold the offline refresh token, assuming you don't want to use the default practice of a encrypted cookie.
func CreateStorage ¶
func CreateStorage(location string, highAvail bool, caPool *x509.CertPool, keyPair *tls.Certificate) (Storage, error)
createStorage creates the store client for use.
Click to show internal directories.
Click to hide internal directories.