Documentation
¶
Index ¶
- type HashMap
- type HashMapOption
- type Janitor
- type ShardMap
- type TtlMap
- func (m *TtlMap[K, V]) Delete(k K)
- func (m *TtlMap[K, V]) DeleteExpired()
- func (m *TtlMap[K, V]) Get(k K) (V, bool)
- func (m *TtlMap[K, V]) Janitor() *janitor
- func (m *TtlMap[K, V]) Len() int
- func (m *TtlMap[K, V]) Set(k K, v V)
- func (m *TtlMap[K, V]) SetJanitor(j *janitor)
- func (m *TtlMap[K, V]) SetWithTTL(k K, v V, ttl time.Duration)
- type TtlMapOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashMap ¶
type HashMap[K comparable, V any] struct { // contains filtered or unexported fields }
func NewHashMap ¶
func NewHashMap[K comparable, V any](options ...HashMapOption[K, V]) *HashMap[K, V]
type HashMapOption ¶
type HashMapOption[K comparable, V any] func(*HashMap[K, V])
func WithShardCount ¶
func WithShardCount[K comparable, V any](shardCount int) HashMapOption[K, V]
type ShardMap ¶
type ShardMap[K comparable, V any] struct { // contains filtered or unexported fields }
func NewShardMap ¶
func NewShardMap[K comparable, V any]() ShardMap[K, V]
type TtlMap ¶
type TtlMap[K comparable, V any] struct { // contains filtered or unexported fields }
func NewTtlMap ¶
func NewTtlMap[K comparable, V any](options ...TtlMapOption[K, V]) *TtlMap[K, V]
func (*TtlMap[K, V]) DeleteExpired ¶
func (m *TtlMap[K, V]) DeleteExpired()
func (*TtlMap[K, V]) SetJanitor ¶
func (m *TtlMap[K, V]) SetJanitor(j *janitor)
func (*TtlMap[K, V]) SetWithTTL ¶
type TtlMapOption ¶
type TtlMapOption[K comparable, V any] func(*TtlMap[K, V])
func WithCleanupInterval ¶
func WithCleanupInterval[K comparable, V any](interval time.Duration) TtlMapOption[K, V]
func WithNowFn ¶
func WithNowFn[K comparable, V any](nowFn func() time.Time) TtlMapOption[K, V]
func WithTTL ¶
func WithTTL[K comparable, V any](ttl time.Duration) TtlMapOption[K, V]
Click to show internal directories.
Click to hide internal directories.