redis

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*RedisStorage)

func WithLockTTL

func WithLockTTL(ttl time.Duration) Option

func WithPrefix

func WithPrefix(prefix string) Option

func WithTTL

func WithTTL(ttl time.Duration) Option

type RedisStorage

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

func NewRedisStorage

func NewRedisStorage(client *redis.Client, opts ...Option) *RedisStorage

func (*RedisStorage) GetState

func (r *RedisStorage) GetState(ctx context.Context, entityID string) (string, error)

func (*RedisStorage) Lock

func (r *RedisStorage) Lock(ctx context.Context, entityID string) (func(), error)

func (*RedisStorage) SetState

func (r *RedisStorage) SetState(ctx context.Context, entityID, state string) error

Jump to

Keyboard shortcuts

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