redis

package
v0.1.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAlreadyExists indicates a create found one of its keys already set.
	ErrAlreadyExists = errors.New("key already 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) BindStatus

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

func (*Rediaron) Create added in v0.1.1

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

func (*Rediaron) CreateAndDecr added in v0.1.1

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

func (*Rediaron) CreateLock

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

func (*Rediaron) Delete added in v0.1.1

func (r *Rediaron) Delete(ctx context.Context, keys []string) 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) GetPrefix added in v0.1.1

func (r *Rediaron) GetPrefix(ctx context.Context, prefix string, limit int64) (map[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) ListPrefix added in v0.1.1

func (r *Rediaron) ListPrefix(ctx context.Context, prefix string) ([]string, error)

func (*Rediaron) NotFound added in v0.1.1

func (r *Rediaron) NotFound(err error) bool

func (*Rediaron) Put added in v0.1.1

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

func (*Rediaron) StartEphemeral

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

func (*Rediaron) Update added in v0.1.1

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

func (*Rediaron) Watch added in v0.1.1

func (r *Rediaron) Watch(ctx context.Context, prefix string) iter.Seq[common.Event]

Jump to

Keyboard shortcuts

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