redis

package
v0.0.0-...-eb626f9 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr      string
	DB        int
	Password  string
	KeyPrefix string
}

type Store

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

func NewStore

func NewStore(cfg *Config) *Store

func NewStoreWithClient

func NewStoreWithClient(cli *redis.Client, keyPrefix string) *Store

func NewStoreWithClusterClient

func NewStoreWithClusterClient(cli *redis.ClusterClient, keyPrefix string) *Store

func (*Store) Check

func (s *Store) Check(ctx context.Context, tokenString string) (bool, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, tokenString string) (bool, error)

func (*Store) Set

func (s *Store) Set(ctx context.Context, tokenString string, expiration time.Duration) error

Jump to

Keyboard shortcuts

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