Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
type Store struct { sync.Mutex // map of IDs currently connected, with expiry time AllowList map[string]int64 // bookingIDs currently denied, with expiry time DenyList map[string]int64 // Now is a function for getting the time - useful for mocking in test // note time is in int64 format Now func() int64 `json:"-" yaml:"-"` // contains filtered or unexported fields }
Store tracks current connections, and those that have been denied (cancelled)
func (*Store) GetAllowList ¶
GetAllowList returns the entire allow list
func (*Store) GetDenyList ¶
GetDenyList returns the entire deny list
func (*Store) Prune ¶
func (s *Store) Prune()
Prune removes stale entries from the Allow, Deny lists
func (*Store) SetNowFunc ¶
SetNowFunc allows providing an alternative source of the current time, for testing purposes
Click to show internal directories.
Click to hide internal directories.