cyclemap

package module
v0.0.0-...-c48ac19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 2 Imported by: 1

README

cyclemap

a limit size of cycle map struct, first in first out.

cyclemap like

cyclemap

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CycleMap

type CycleMap[K cmp.Ordered, V any] struct {
	ListenRemoveFunc func(k K, v V)
	// contains filtered or unexported fields
}

func New

func New[K cmp.Ordered, V any](size int, isSafe bool) *CycleMap[K, V]

func (*CycleMap[K, V]) Get

func (c *CycleMap[K, V]) Get(k K) (V, bool)

func (*CycleMap[K, V]) GetOrAdd

func (c *CycleMap[K, V]) GetOrAdd(k K, f func() V) V

func (*CycleMap[K, V]) Iter

func (c *CycleMap[K, V]) Iter() *cyclemapIterator[K, V]

func (*CycleMap[K, V]) Remove

func (c *CycleMap[K, V]) Remove(k K)

func (*CycleMap[K, V]) Set

func (c *CycleMap[K, V]) Set(k K, v V)

func (*CycleMap[K, V]) SetListenRemoveFunc

func (c *CycleMap[K, V]) SetListenRemoveFunc(f func(k K, v V))

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL