htable

package
v0.0.0-...-08c2ddf Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntKey

type IntKey int

func (IntKey) Equal

func (i IntKey) Equal(other PreHashable) bool

func (IntKey) HashBytes

func (i IntKey) HashBytes() []byte

type PreHashable

type PreHashable interface {
	HashBytes() []byte
	Equal(PreHashable) bool
}

type StringKey

type StringKey string

func (StringKey) Equal

func (str StringKey) Equal(other PreHashable) bool

func (StringKey) HashBytes

func (str StringKey) HashBytes() []byte

type Table

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

func New

func New() Table

Create a new Hash Table

func NewSized

func NewSized(initial int) Table

Create a new Hash Table hinting the desired number of buckets

func (*Table) Delete

func (ht *Table) Delete(key PreHashable) error

func (*Table) Dump

func (ht *Table) Dump(w io.Writer)

func (*Table) Get

func (ht *Table) Get(key PreHashable) (interface{}, bool)

func (*Table) Len

func (ht *Table) Len() int

func (*Table) Set

func (ht *Table) Set(key PreHashable, value interface{})

Jump to

Keyboard shortcuts

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