Documentation
¶
Overview ¶
This file contains the lock timer manager struct and methods. A lock timer manager is used for handling a map of lock timers which perform a callback when they expire. They can be removed or refreshed before they expire.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLockDoesNotExistOrInvalidKey = errors.New("lock does not exist or an invalid key was used")
Can be returned from Refresh() when the lock + key combo is not found in the lockTimers map
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager for a map of lock times
func NewManager ¶
func NewManager(otf onTimeoutFunc) (m *Manager, shutdown func())
NewManager initializes a new Manager with the provided onTimeoutFunc.
Parameter: onTimeoutFunc function to run when lock times out Returns a pointer to Manager and a shutdown function.
Click to show internal directories.
Click to hide internal directories.