Documentation ¶
Overview ¶
Package omap implements in-memory ordered maps. Map[K, V] is suitable for ordered types K, while MapFunc[K, V] supports arbitrary keys and comparison functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
A Map is a map[K]V ordered according to K's standard Go ordering. The zero value of a Map is an empty Map ready to use.
func (*Map[K, V]) All ¶
All returns an iterator over the map m. If m is modified during the iteration, some keys may not be visited. No keys will be visited multiple times.
func (*Map[K, V]) DeleteRange ¶ added in v1.1.0
func (m *Map[K, V]) DeleteRange(lo, hi K)
DeleteRange deletes m[k] for all keys k satisfying lo ≤ k ≤ hi.
type MapFunc ¶
type MapFunc[K, V any] struct { // contains filtered or unexported fields }
A MapFunc is a map[K]V ordered according to an arbitrary comparison function. The zero value of a MapFunc is not meaningful since it has no comparison function. Use NewMapFunc to create a MapFunc. A nil *MapFunc, like a nil Go map, can be read but not written and contains no entries.
func NewMapFunc ¶
NewMapFunc returns a new MapFunc[K, V] ordered according to cmp.
func (*MapFunc[K, V]) All ¶
All returns an iterator over the map m. If m is modified during the iteration, some keys may not be visited. No keys will be visited multiple times.
func (*MapFunc[K, V]) DeleteRange ¶ added in v1.1.0
func (m *MapFunc[K, V]) DeleteRange(lo, hi K)
DeleteRange deletes m[k] for all keys k satisfying lo ≤ k ≤ hi.