hashtable

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SamplingHash added in v0.0.2

func SamplingHash(key interface{}) uint64

Types

type HasHash added in v0.0.2

type HasHash interface {
	Hash() uint64
}

type Hash added in v0.0.2

type Hash func(interface{}) uint64

type Hashtable

type Hashtable interface {
	Set(key, value interface{})
	Remove(key interface{}) bool
	Get(key interface{}) (interface{}, bool)
	Iterate(cb func(key, value interface{}) bool)
	Len() int
}

func NewOAHashtable added in v0.0.2

func NewOAHashtable(options ...OAHashtableOption) Hashtable

type OAHashtable added in v0.0.2

type OAHashtable struct {
	// contains filtered or unexported fields
}

Open addressing hash table

func (*OAHashtable) Get added in v0.0.2

func (h *OAHashtable) Get(key interface{}) (interface{}, bool)

func (*OAHashtable) Iterate added in v0.0.2

func (h *OAHashtable) Iterate(cb func(key, value interface{}) bool)

func (*OAHashtable) Len added in v0.0.2

func (h *OAHashtable) Len() int

func (*OAHashtable) Remove added in v0.0.2

func (h *OAHashtable) Remove(key interface{}) bool

func (*OAHashtable) Set added in v0.0.2

func (h *OAHashtable) Set(key interface{}, value interface{})

type OAHashtableOption added in v0.0.2

type OAHashtableOption func(*OAHashtable)

func OptionOAHashtableHash added in v0.0.2

func OptionOAHashtableHash(hash func(key interface{}) uint64) OAHashtableOption

func OptionOAHashtableLength added in v0.0.2

func OptionOAHashtableLength(length uint32) OAHashtableOption

Jump to

Keyboard shortcuts

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