index

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: MIT Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code uint64

Code is type for result of Hash method to unify logic around

func Hash

func Hash(key string) Code

Hash returns FNV1 hash of string key

func (Code) String

func (c Code) String() string

String return string version (16-base) of hash code

type Index

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

Index is helper type for internal indexes

func (*Index) Add

func (i *Index) Add(o Indexer, idx int) error

Add object's hash to index

func (*Index) Count added in v1.0.4

func (i *Index) Count() int

Count returns total number of hashed objects in index

func (*Index) Get

func (i *Index) Get(o Indexer) (idx int, ok bool)

Get object's hash and state - same as regular map result

func (*Index) Has added in v1.0.3

func (i *Index) Has(o Indexer) bool

Has returns true if object's hash was found

func (*Index) Remove

func (i *Index) Remove(o Indexer)

Remove object's hash from index

type Indexer

type Indexer interface {
	Hash() Code
}

Indexer is interface for objects that will be used to build indexes

Jump to

Keyboard shortcuts

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