redis

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

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 added in v1.11.0

func (r *StandaloneRedisLock) GetComponentMetadata() (metadataInfo contribMetadata.MetadataMap)

GetComponentMetadata returns the metadata of the component.

func (*StandaloneRedisLock) InitLockStore

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

Init StandaloneRedisLock.

func (*StandaloneRedisLock) TryLock

TryLock tries to acquire a lock. If the lock cannot be acquired, it returns immediately.

func (*StandaloneRedisLock) Unlock

Unlock tries to release a lock if the lock is still valid.

Jump to

Keyboard shortcuts

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