Documentation
¶
Index ¶
Constants ¶
View Source
const ( Success = 1 Fail = 0 )
Variables ¶
View Source
var ( ErrLockFailed = errors.New("lock failed") ErrUnlockFailed = errors.New("unlock failed") )
Functions ¶
This section is empty.
Types ¶
type HSync ¶
type HSync interface { // Lock tries to get a locker for a resource // the parameter of ctx should have a trigger that Done() can be happended Lock(ctx context.Context, id string) error // Unlock will release a locker Unlock(id string) error // RLock will try to add a read lock to a resource RLock(ctx context.Context, id string) error // RUnlock will try to release the read lock RUnlock(id string) error }
type Option ¶
type Option func(*Options)
func WithDisableRetry ¶
func WithDisableRetry() Option
func WithTimeout ¶
func WithWaitingPeriod ¶
Click to show internal directories.
Click to hide internal directories.