redis

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPoolSize  = 8
	DefaultTimeout   = 3 * time.Second
	DefaultScanCount = 500
)

Variables

View Source
var (
	ErrProtocol = errors.New("coyote/cache/redis: unexpected reply from the server")
	ErrServer   = errors.New("coyote/cache/redis: the server refused the command")
)

Functions

This section is empty.

Types

type Options

type Options struct {
	Address      string
	Username     string
	Password     string
	Database     int
	TLS          *tls.Config
	PoolSize     int
	DialTimeout  time.Duration
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
}

type Store

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

func New

func New(opts Options) *Store

func (*Store) Clear

func (s *Store) Clear(ctx context.Context) error

func (*Store) ClearPrefix

func (s *Store) ClearPrefix(ctx context.Context, prefix string) error

func (*Store) Close

func (s *Store) Close() error

func (*Store) Delete

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

func (*Store) Get

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

func (*Store) GetMulti

func (s *Store) GetMulti(ctx context.Context, keys []string) (map[string][]byte, error)

func (*Store) Has

func (s *Store) Has(ctx context.Context, key string) (bool, error)

func (*Store) Incr

func (s *Store) Incr(ctx context.Context, key string, delta int64, ttl time.Duration) (int64, error)

func (*Store) Len

func (s *Store) Len() int

func (*Store) Ping

func (s *Store) Ping(ctx context.Context) error

func (*Store) Set

func (s *Store) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error

Jump to

Keyboard shortcuts

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