Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallbackFn ¶
CallbackFn will be executed for every client that gets expired in the probation list.
type Probation ¶
type Probation interface { // Add adds a client to the probation list. Add(clientID string, clientData interface{}, updateIfExists bool) error // Remove removes a client from the probation list. Remove(clientID string) error // Exists checks if a client is already in the probation list Exists(clientID string) bool // Start starts monitoring the probationList with the configured // probationTimeout Start() error }
Probation is an interface that defines a set of APIs to manage a probation list. The probation list is guarded by a configurable timeout. Any clients that stay in the probation list after the probation timeout will be passed on to the registered ProbationCallback fn
func NewProbationManager ¶
func NewProbationManager( name string, probationTimeout time.Duration, pcf CallbackFn, ) Probation
NewProbationManager returns the default implementation of Probation interface It takes in a name to be associated with this probation manager and a ProbationCallbackFn
Click to show internal directories.
Click to hide internal directories.