redis

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: GPL-3.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 // Address (IP: Port)
	DB        int    // Database
	Password  string // Password
	KeyPrefix string // Store the prefix of the key
}

Config - Redis configuration parameter

type Store

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

Store - Redis storage

func NewStore

func NewStore(cfg *Config) *Store

NewStore - Create a redis-based storage instance

func NewStoreWithClient

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

NewStoreWithClient - Create a storage instance using the redis client

func NewStoreWithClusterClient

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

NewStoreWithClusterClient - Create a storage instance using the redis cluster client

func (*Store) Check

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

Check ...

func (*Store) Close

func (s *Store) Close() error

Close ...

func (*Store) Delete

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

Delete ...

func (*Store) Set

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

Set ...

Jump to

Keyboard shortcuts

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