redis

package
v0.0.0-...-ebb33e4 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStandaloneRedisLock

func NewStandaloneRedisLock(logger logger.Logger) lock.Store

NewStandaloneRedisLock returns a new standalone redis lock. Do not use this lock with a redis cluster, which might lead to unexpected lock loss.

Types

type StandaloneRedisLock

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

Standalone Redis lock store.Any fail-over related features are not supported,such as Sentinel and Redis Cluster.

func (*StandaloneRedisLock) Close

func (r *StandaloneRedisLock) Close() error

Close shuts down the client's redis connections.

func (*StandaloneRedisLock) GetComponentMetadata

func (r *StandaloneRedisLock) GetComponentMetadata() map[string]string

GetComponentMetadata returns the metadata of the component.

func (*StandaloneRedisLock) InitLockStore

func (r *StandaloneRedisLock) InitLockStore(ctx context.Context, metadata lock.Metadata) error

Init StandaloneRedisLock.

func (*StandaloneRedisLock) TryLock

Try to acquire a redis lock.

func (*StandaloneRedisLock) Unlock

Try to release a redis lock.

Jump to

Keyboard shortcuts

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