valkeyadmin

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package valkeyadmin is the valkey-go implementation of the segmentadmin.Store port: the write side of a dynamic segment on a Valkey node, a sentinel set or a cluster. It is an adapter: the port, the import and the edit logic are in segmentadmin, the Lua scripts too, so that this package and redisadmin run the same ones and never import each other.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is a segmentadmin.Store over valkey-go: a single node, a sentinel set or a cluster.

func New

func New(client valkey.Client) *Store

New returns a segmentadmin.Store over a valkey-go client. Close closes the client.

func (*Store) Claim

func (s *Store) Claim(ctx context.Context, lock, last, stale, tmp, token string) (bool, error)

Claim implements segmentadmin.Store.

func (*Store) Close

func (s *Store) Close()

Close implements segmentadmin.Store.

func (*Store) Commit

func (s *Store) Commit(
	ctx context.Context,
	commit *segmentadmin.Commit,
) (segmentadmin.CommitResult, bool, error)

Commit implements segmentadmin.Store.

func (*Store) CountKeys

func (s *Store) CountKeys(ctx context.Context, prefix string, limit int) (int, bool, error)

CountKeys implements segmentadmin.Store.

func (*Store) EditSet

func (s *Store) EditSet(
	ctx context.Context, lock, key string, members []string, remove bool,
) (int64, bool, error)

EditSet implements segmentadmin.Store.

func (*Store) KeyTTL

func (s *Store) KeyTTL(ctx context.Context, key string) (bool, time.Duration, error)

KeyTTL implements segmentadmin.Store.

func (*Store) Lock

func (s *Store) Lock(ctx context.Context, key, token string, ttl time.Duration) (bool, error)

Lock implements segmentadmin.Store.

func (*Store) Ping

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

Ping implements segmentadmin.Store.

func (*Store) SAdd

func (s *Store) SAdd(ctx context.Context, key string, members []string, ttl time.Duration) (int64, error)

SAdd implements segmentadmin.Store.

func (*Store) SCard

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

SCard implements segmentadmin.Store.

func (*Store) SRem

func (s *Store) SRem(ctx context.Context, key string, members []string) (int64, error)

SRem implements segmentadmin.Store.

func (*Store) SetKeys

func (s *Store) SetKeys(ctx context.Context, keys []string) (int64, error)

SetKeys implements segmentadmin.Store.

func (*Store) SetValue

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

SetValue implements segmentadmin.Store.

func (*Store) StageAdd

func (s *Store) StageAdd(
	ctx context.Context, lock, tmp, token string, members []string, ttl time.Duration, first bool,
) (int64, segmentadmin.StageResult, error)

StageAdd implements segmentadmin.Store.

func (s *Store) Unlink(ctx context.Context, keys ...string) (int64, bool, error)

Unlink implements segmentadmin.Store.

func (*Store) Unlock

func (s *Store) Unlock(ctx context.Context, lock, last, committed, token string) error

Unlock implements segmentadmin.Store.

func (*Store) Value

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

Value implements segmentadmin.Store.

Jump to

Keyboard shortcuts

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