Documentation ¶
Index ¶
- type Callback
- type Option
- type TTLMap
- func (m *TTLMap) Get(key string) (interface{}, bool)
- func (m *TTLMap) GetInt(key string) (int, bool, error)
- func (m *TTLMap) Increment(key string, value int, ttl time.Duration) (int, error)
- func (m *TTLMap) Len() int
- func (m *TTLMap) Pop() (string, interface{}, bool)
- func (m *TTLMap) Remove(key string) (interface{}, bool)
- func (m *TTLMap) RemoveExpired(iterations int) int
- func (m *TTLMap) Set(key string, value interface{}, ttl time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback func(key string, el interface{})
Callback can be executed on the element once TTLMap performs some action on the dictionary
type Option ¶
Option is a functional option argument to TTLMap
func CallOnExpire ¶
CallOnExpire will call this callback on expiration of elements
type TTLMap ¶
TTLMap is a map with expiring elements
func (*TTLMap) Pop ¶
Pop removes and returns the key and the value of the oldest element from the TTL Map if there are no elements in the map, returns empty string and false
func (*TTLMap) Remove ¶
Remove removes and returns element if it's found, returns element, true if it's found returns nil, false if element is not found
func (*TTLMap) RemoveExpired ¶
RemoveExpired makes a pass through map and removes expired elements
Click to show internal directories.
Click to hide internal directories.