api

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map[K constraints.Ordered, V any] interface {
	// 获取
	Get(k K) (elem V)
	// 获取
	GetWithErr(k K) (elem V, err error)
	// 删除
	Delete(k K)
	// 设置
	Set(k K, v V)
	// 设置值
	SetWithPrev(k K, v V) (prev V, replaced bool)
	// int
	Len() int
	// 遍历
	Range(callback func(k K, v V) bool)
}

type Set

type Set[K constraints.Ordered] interface {
	Set(k K)
}

TODO

type SortedMap

type SortedMap[K constraints.Ordered, V any] interface {
	Map[K, V]
	TopMin(limit int, callback func(k K, v V) bool)
	TopMax(limit int, callback func(k K, v V) bool)
}

type Trie

type Trie[V any] interface {
	Get(k string) (v V)
	SetWithPrev(k string, v V) (prev V, replaced bool)
	HasPrefix(k string) bool
	GetWithBool(k string) (v V, found bool)
	Delete(k string)
	Len() int
}

Jump to

Keyboard shortcuts

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