Documentation ¶
Overview ¶
Package temp provides the ability to have temporary structs and simple cleaning of slices and maps containing temporary data
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clean ¶
func Clean(m interface{}, mutex *sync.RWMutex, scanInterval time.Duration, checkInterval time.Duration)
Clean blocks forever and removes expires keys from a map with values that adhere to Temporary. Clean panics if m is not a map or slice. Clean makes heavy use of reflection. scanInterval is slept between whole scans of a map, if zero it will block the thread. checkInterval is slept between checks of individual elements.
func ExpireAfter ¶
ExpireAfter sets a T to expire after a duration from now
Types ¶
Click to show internal directories.
Click to hide internal directories.