distrlock

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisDistributeStateService

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

func NewRedisDistributeStateService

func NewRedisDistributeStateService(url string, pass string, db int, logger log.Logger, lockerID string) (*RedisDistributeStateService, error)

func (*RedisDistributeStateService) FetchDistLock

func (s *RedisDistributeStateService) FetchDistLock(lockKey string, locker string, expiredInMS int) (bool, error)

func (*RedisDistributeStateService) GetDistState

func (s *RedisDistributeStateService) GetDistState(stateKey string) string

func (*RedisDistributeStateService) GetLockerID

func (s *RedisDistributeStateService) GetLockerID() string

func (*RedisDistributeStateService) ReleaseDistLock

func (s *RedisDistributeStateService) ReleaseDistLock(lockKey string, locker string) (bool, error)

func (*RedisDistributeStateService) SetDistState

func (s *RedisDistributeStateService) SetDistState(stateKey string, stateValue string) error

func (*RedisDistributeStateService) UnlockDistLockWithState

func (s *RedisDistributeStateService) UnlockDistLockWithState(lockKey string, locker string, stateKey string, stateValue string) (bool, error)

Jump to

Keyboard shortcuts

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