redis

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EndpointFlagName = withFlagPrefix("endpoint")
	PasswordFlagName = withFlagPrefix("password")
	DBFlagName       = withFlagPrefix("db")
	EvictionFlagName = withFlagPrefix("eviction")
)

Functions

func CLIFlags

func CLIFlags(envPrefix, category string) []cli.Flag

CLIFlags ... used for Redis backend configuration category is used to group the flags in the help output (see https://cli.urfave.org/v2/examples/flags/#grouping)

Types

type Config

type Config struct {
	Endpoint string
	Password string
	DB       int
	Eviction time.Duration
	Profile  bool
}

Config ... user configurable

func ReadConfig

func ReadConfig(ctx *cli.Context) Config

type Store

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

Store ... Redis storage backend implementation (This not safe for concurrent usage)

func NewStore

func NewStore(cfg *Config) (*Store, error)

NewStore ... constructor

func (*Store) BackendType

func (r *Store) BackendType() store.BackendType

func (*Store) Get

func (r *Store) Get(ctx context.Context, key []byte) ([]byte, error)

Get ... retrieves a value from the Redis store. Returns nil if the key is not found vs. an error if the key is found but the value is not retrievable.

func (*Store) Put

func (r *Store) Put(ctx context.Context, key []byte, value []byte) error

Put ... inserts a value into the Redis store

func (*Store) Stats

func (r *Store) Stats() *store.Stats

func (*Store) Verify

func (r *Store) Verify(_ []byte, _ []byte) error

Jump to

Keyboard shortcuts

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