Documentation
¶
Overview ¶
Package redisadmin is the go-redis implementation of the segmentadmin.Store port: the write side of a dynamic segment on a single Redis node 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 valkeyadmin run the same ones and never import each other.
Index ¶
- Variables
- type Store
- func (s *Store) Claim(ctx context.Context, lock, last, stale, tmp, token string) (bool, error)
- func (s *Store) Close()
- func (s *Store) Commit(ctx context.Context, commit *segmentadmin.Commit) (segmentadmin.CommitResult, bool, error)
- func (s *Store) CountKeys(ctx context.Context, prefix string, limit int) (int, bool, error)
- func (s *Store) EditSet(ctx context.Context, lock, key string, members []string, remove bool) (int64, bool, error)
- func (s *Store) KeyTTL(ctx context.Context, key string) (bool, time.Duration, error)
- func (s *Store) Lock(ctx context.Context, key, token string, ttl time.Duration) (bool, error)
- func (s *Store) Ping(ctx context.Context) error
- func (s *Store) SAdd(ctx context.Context, key string, members []string, ttl time.Duration) (int64, error)
- func (s *Store) SCard(ctx context.Context, key string) (int64, error)
- func (s *Store) SRem(ctx context.Context, key string, members []string) (int64, error)
- func (s *Store) SetKeys(ctx context.Context, keys []string) (int64, error)
- func (s *Store) SetValue(ctx context.Context, key, value string) error
- func (s *Store) StageAdd(ctx context.Context, lock, tmp, token string, members []string, ...) (int64, segmentadmin.StageResult, error)
- func (s *Store) Unlink(ctx context.Context, keys ...string) (int64, bool, error)
- func (s *Store) Unlock(ctx context.Context, lock, last, committed, token string) error
- func (s *Store) Value(ctx context.Context, key string) (string, bool, error)
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedClient = errors.New("the client cannot be scanned")
ErrUnsupportedClient is returned for a go-redis client that is neither a node nor a cluster: it cannot be scanned.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a segmentadmin.Store over go-redis: a single node or a cluster.
func New ¶
func New(client redis.UniversalClient) *Store
New returns a segmentadmin.Store over a go-redis client. Close closes the client.
func (*Store) Claim ¶
Claim 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 ¶
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 ¶
KeyTTL implements segmentadmin.Store.
func (*Store) Lock ¶
Lock implements segmentadmin.Store.
func (*Store) Ping ¶
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 ¶
SCard implements segmentadmin.Store.
func (*Store) SRem ¶
SRem implements segmentadmin.Store.
func (*Store) SetKeys ¶
SetKeys implements segmentadmin.Store.
func (*Store) SetValue ¶
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 (*Store) Unlink ¶
Unlink implements segmentadmin.Store.
func (*Store) Unlock ¶
Unlock implements segmentadmin.Store.