Documentation ¶
Index ¶
- func NewStandaloneRedisLock(logger logger.Logger) lock.Store
- type StandaloneRedisLock
- func (r *StandaloneRedisLock) Close() error
- func (r *StandaloneRedisLock) GetComponentMetadata() (metadataInfo contribMetadata.MetadataMap)
- func (r *StandaloneRedisLock) InitLockStore(ctx context.Context, metadata lock.Metadata) (err error)
- func (r *StandaloneRedisLock) TryLock(ctx context.Context, req *lock.TryLockRequest) (*lock.TryLockResponse, error)
- func (r *StandaloneRedisLock) Unlock(ctx context.Context, req *lock.UnlockRequest) (*lock.UnlockResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
func (r *StandaloneRedisLock) TryLock(ctx context.Context, req *lock.TryLockRequest) (*lock.TryLockResponse, error)
TryLock tries to acquire a lock. If the lock cannot be acquired, it returns immediately.
func (*StandaloneRedisLock) Unlock ¶
func (r *StandaloneRedisLock) Unlock(ctx context.Context, req *lock.UnlockRequest) (*lock.UnlockResponse, error)
Unlock tries to release a lock if the lock is still valid.
Click to show internal directories.
Click to hide internal directories.