Documentation ¶
Index ¶
- func NewStandaloneRedisLock(logger logger.Logger) lock.Store
- type StandaloneRedisLock
- func (r *StandaloneRedisLock) Close() error
- func (r *StandaloneRedisLock) GetComponentMetadata() map[string]string
- func (r *StandaloneRedisLock) InitLockStore(ctx context.Context, metadata lock.Metadata) 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 ¶
func (r *StandaloneRedisLock) GetComponentMetadata() map[string]string
GetComponentMetadata returns the metadata of the component.
func (*StandaloneRedisLock) InitLockStore ¶
Init StandaloneRedisLock.
func (*StandaloneRedisLock) TryLock ¶
func (r *StandaloneRedisLock) TryLock(ctx context.Context, req *lock.TryLockRequest) (*lock.TryLockResponse, error)
Try to acquire a redis lock.
func (*StandaloneRedisLock) Unlock ¶
func (r *StandaloneRedisLock) Unlock(ctx context.Context, req *lock.UnlockRequest) (*lock.UnlockResponse, error)
Try to release a redis lock.
Click to show internal directories.
Click to hide internal directories.