storage

package
v0.0.0-...-69f76da Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FNV32 = iota
	FNV32A
)

HASH functions

Variables

This section is empty.

Functions

func AssocDelete

func AssocDelete(hvalue uint32, key string)

func AssocInsert

func AssocInsert(it *Item) int

func Delete

func Delete(key string)

func DestroyAssoc

func DestroyAssoc()

func DestroyStore

func DestroyStore()

func Get

func Get(key string) (string, int)

func Hash

func Hash(str string) uint32

func InitializeAssoc

func InitializeAssoc(hashtableSize uint32, hashFunction int)

func InitializeStore

func InitializeStore()

func Store

func Store(key string, value string) int

TODO :: add Value length argument for optimize

func Update

func Update(key string, value string) int

Types

type Item

type Item struct {
	Key    string
	KeyLen uint32
	Value  string
	ValLen uint32
	Hvalue uint32
	Time   time.Time
	Next   *Item
}

func AssocGet

func AssocGet(hvalue uint32, key string) *Item

Jump to

Keyboard shortcuts

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