cache

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	MustConnect(ctx context.Context) Manager
	Connect(ctx context.Context) error

	Set(ctx context.Context, key string, value interface{}) error
	SetWhenNotExist(ctx context.Context, key string, value interface{}) error
	SetWithExpire(ctx context.Context, key string, value interface{}, expire time.Duration) error
	SetWithExpireWhenNotExist(ctx context.Context, key string, value interface{}, expire time.Duration) error
	SetString(ctx context.Context, key, value string, expire time.Duration) error
	Get(ctx context.Context, key string, bindTo interface{}) error
	GetString(ctx context.Context, key string) string
	Del(ctx context.Context, keys ...string) error

	HSet(ctx context.Context, key string, value ...interface{}) error
	HSetWhenNotExist(ctx context.Context, key, field string, value interface{}) error
	HGet(ctx context.Context, key, field string, bindTo interface{}) error
	HDel(ctx context.Context, key string, fields ...string) error
	HGetAll(ctx context.Context, key string, bindTo interface{}) error

	HMSet(ctx context.Context, key string, values ...interface{}) error
	HMGet(ctx context.Context, key, field string, bindTo interface{}) error

	Ping() error
}

func NewNoop

func NewNoop() Manager

func NewRedis added in v0.2.1

func NewRedis(addr, pwd string, db int, opts ...Option) Manager

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithPrefix

func WithPrefix(v string) Option

func WithScope

func WithScope(v string) Option

func WithTLSB64

func WithTLSB64(v bool, certB64, keyB64, serverName string) Option

func WithTLSFile

func WithTLSFile(v bool, certFile, keyFile, serverName string) Option

func WithTelemetry

func WithTelemetry(tm telemetry.Manager) Option

Jump to

Keyboard shortcuts

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