Documentation ¶
Overview ¶
Package permits is used to provide permitGiver which maintains a sync map whose values can be deleted if not accessed for a configured time
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PermitGiver ¶
type PermitGiver interface { RegisterPermits(key string, numPermits int) TryPermit(key string, timeout time.Duration) bool ReleasePermit(key string) DeletePermits(key string) Close() }
PermitGiver provides different operations regarding permit for a given key
func NewPermitGiver ¶
func NewPermitGiver(stalePermitKeyTimeout time.Duration, janitorFrequency time.Duration) PermitGiver
NewPermitGiver returns a new PermitGiver
Click to show internal directories.
Click to hide internal directories.