Documentation ¶
Index ¶
- func NewPureMap[K comparable, V any]() *pureMap[K, V]
- type Map
- func NewIntSortedSliceMap[K constraints.Integer, V any](opts ...Option) Map[K, V]
- func NewSortedSliceMap[K constraints.Ordered, V any](opts ...Option) Map[K, V]
- func NewSyncMap[K comparable, V any](opts ...Option) Map[K, V]
- func NewThreadSafeIntSortedSliceMap[K constraints.Integer, V any](opts ...Option) Map[K, V]
- func NewThreadSafePureMap[K comparable, V any]() Map[K, V]
- func NewThreadSafeSortedSliceMap[K constraints.Ordered, V any](opts ...Option) Map[K, V]
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPureMap ¶
func NewPureMap[K comparable, V any]() *pureMap[K, V]
NewPureMap creates a new pureMap instance
Types ¶
type Map ¶
type Map[K comparable, V any] interface { Store(key K, val V) Load(key K) (V, bool) LoadAndDelete(key K) (V, bool) Delete(key K) Contain(key K) bool Clear() }
func NewIntSortedSliceMap ¶
func NewIntSortedSliceMap[K constraints.Integer, V any](opts ...Option) Map[K, V]
NewIntSortedSliceMap create sorted slice map, using binary search to find the item using bloom filter to predict if the item doesn't exist non-thread-safe
func NewSortedSliceMap ¶
func NewSortedSliceMap[K constraints.Ordered, V any](opts ...Option) Map[K, V]
NewSortedSliceMap create sorted slice map, using binary search to find the item non-thread-safe
func NewSyncMap ¶
func NewSyncMap[K comparable, V any](opts ...Option) Map[K, V]
func NewThreadSafeIntSortedSliceMap ¶
func NewThreadSafeIntSortedSliceMap[K constraints.Integer, V any](opts ...Option) Map[K, V]
NewThreadSafeIntSortedSliceMap creates a new threadSafeIntSortedSliceMap instance
func NewThreadSafePureMap ¶
func NewThreadSafePureMap[K comparable, V any]() Map[K, V]
NewThreadSafePureMap creates a new threadSafePureMap instance
func NewThreadSafeSortedSliceMap ¶
func NewThreadSafeSortedSliceMap[K constraints.Ordered, V any](opts ...Option) Map[K, V]
NewThreadSafeSortedSliceMap creates a new threadSafeSortedSliceMap instance If your key is Integer, please consider to use IntSortedSliceMap to have bloom filter feature
Click to show internal directories.
Click to hide internal directories.