Documentation ¶
Index ¶
- type Map
- func (m *Map) Delete(key interface{})
- func (m *Map) Load(key interface{}) (value interface{}, ok bool)
- func (m *Map) LoadOrStore(key, value interface{}, opts ...Option) (actual interface{}, loaded bool)
- func (m *Map) Range(f func(key, value interface{}) bool)
- func (m *Map) SetDefaultExpire(expire time.Duration)
- func (m *Map) Store(key, value interface{}, opts ...Option)
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map is synchronization map with expiration date (extended sync.Map).
func (*Map) Load ¶
Load returns the value in expiration stored in the map for a key, or nil if no value is present.
func (*Map) LoadOrStore ¶
LoadOrStore returns the existing value in expiration for the key if present. Otherwise, it stores with expiration and returns the given value.
func (*Map) Range ¶
Range calls f sequentially for each key and value in expiration present in the map.
func (*Map) SetDefaultExpire ¶
SetDefaultExpire sets default expiration for value in Map.
Click to show internal directories.
Click to hide internal directories.