Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExpiringStore ¶
type ExpiringStore[T any] interface { // SetWithDuration adds the provided value with given key and duration to the store. // The stored value will be removed after the provided duration. SetWithDuration(key string, value *T, duration time.Duration) Store[T] }
func NewDefaultTimedStore ¶
func NewDefaultTimedStore[T any]() ExpiringStore[T]
func NewTimedStore ¶
func NewTimedStore[T any](duration time.Duration) ExpiringStore[T]
type Set ¶ added in v0.7.8
type Store ¶
type Store[T any] interface { // Delete removes the stored struct related to given key. Delete(key string) // Set adds the provided value with given key to the store. Set(key string, value *T) // Get retrieves the value from the store by the given key. Get(key string) (*T, bool) // GetValues retrieves all values from the store. GetValues() []*T }
Click to show internal directories.
Click to hide internal directories.