Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultExpiry = time.Second
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Locker ¶
type Locker interface { Lock(ctx context.Context, key string) (UnlockFunc, error) LockWithExpiry(ctx context.Context, key string, expiry time.Duration) (UnlockFunc, error) }
func NewMutexLocker ¶
func NewMutexLocker() Locker
func NewNopLocker ¶
func NewNopLocker() Locker
type UnlockFunc ¶
type UnlockFunc func()
Click to show internal directories.
Click to hide internal directories.