cache

package
v0.0.0-...-d50b6f3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotReady = errors.New("Client not in Ready state")
	// ErrNoMethod = errors.New("Method not allowed")
	ErrNoKey = errors.New("key not found")
)

Functions

func Drivers

func Drivers() map[string]func() Driver

func RegisterDriver

func RegisterDriver(name string, fnc func() Driver)

Types

type Client

type Client interface {
	Driver() Driver
	Ping() error
	Close()

	Has(string) bool
	Get(string) Result
	Incr(string, ...any) (int64, error)
	Decr(string, ...any) (int64, error)
	Put(string, any, ...any) error
	Delete(string, ...any) error
}

func New

func New(addr string, in ...any) (Client, error)

type Driver

type Driver interface {
	Name() string
	Configure(string, ...any) (Client, error)
	Close()
}

type Node

type Node interface {
	Key() string
	Value(any) error
}

type Option

type Option int
const (
	Prefix Option = (1 << iota)
	Sort
)

type Result

type Result interface {
	One(any) error
	ForEach(func(Node) error) error
	Int64() (int64, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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