redis

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAlreadyExists indicates SETNX found the key already set.
	ErrAlreadyExists = errors.New("key already exists")
	// ErrKeyNotExists indicates an update targeted a missing key, as the etcd store reports it.
	ErrKeyNotExists = errors.New("key not exists")
)

Functions

This section is empty.

Types

type KNotifyMessage

type KNotifyMessage struct {
	Key    string
	Action string
}

KNotifyMessage is received when using KNotify

type Rediaron

type Rediaron struct {
	*common.Store
	// contains filtered or unexported fields
}

Rediaron is a store implemented by redis

func New

func New(config types.Config) (*Rediaron, error)

New creates a Rediaron, using only the redis address and db from config.

func (*Rediaron) BatchCreate

func (r *Rediaron) BatchCreate(ctx context.Context, data map[string]string) error

func (*Rediaron) BatchCreateAndDecr

func (r *Rediaron) BatchCreateAndDecr(ctx context.Context, data map[string]string, decrKey string) (err error)

func (*Rediaron) BatchDelete

func (r *Rediaron) BatchDelete(ctx context.Context, keys []string) error

func (*Rediaron) BatchPut

func (r *Rediaron) BatchPut(ctx context.Context, data map[string]string) error

func (*Rediaron) BatchUpdate

func (r *Rediaron) BatchUpdate(ctx context.Context, data map[string]string) error

func (*Rediaron) BindStatus

func (r *Rediaron) BindStatus(ctx context.Context, entityKey, statusKey, statusValue string, ttl int64) error

func (*Rediaron) CreateLock

func (r *Rediaron) CreateLock(key string, ttl time.Duration) (lock.DistributedLock, error)

func (*Rediaron) GetMulti

func (r *Rediaron) GetMulti(ctx context.Context, keys []string) (map[string]string, error)

func (*Rediaron) GetOne

func (r *Rediaron) GetOne(ctx context.Context, key string) (string, error)

func (*Rediaron) KNotify

func (r *Rediaron) KNotify(ctx context.Context, pattern string) chan *KNotifyMessage

KNotify streams key change notifications, the redis counterpart of an etcd watch.

func (*Rediaron) SetNodeStatus

func (r *Rediaron) SetNodeStatus(ctx context.Context, node *types.Node, ttl int64) error

func (*Rediaron) StartEphemeral

func (r *Rediaron) StartEphemeral(ctx context.Context, path string, heartbeat time.Duration) (<-chan struct{}, func(), error)

Jump to

Keyboard shortcuts

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