bytype

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index struct {
	Field   string
	Compute IndexComputer
	Storage Storage
}

func NewBoolIndex

func NewBoolIndex(getter *record.BoolGetter) *Index

func NewEnum16Index

func NewEnum16Index(getter *record.Enum16Getter) *Index

func NewEnum8Index

func NewEnum8Index(getter *record.Enum8Getter) *Index

func NewInt32Index

func NewInt32Index(getter *record.Int32Getter) *Index

func NewInt64Index

func NewInt64Index(getter *record.Int64Getter) *Index

func NewStringIndex

func NewStringIndex(getter *record.StringGetter) *Index

type IndexComputer

type IndexComputer interface {
	ForItem(item interface{}) interface{}
	ForComparatorAllValues(comparator where.FieldComparator, cb func(index interface{}))
	ForComparatorFirstValue(comparator where.FieldComparator) interface{}
	Compare(value interface{}, comparator where.FieldComparator) (bool, error)
}

type Storage

type Storage interface {
	Get(key interface{}) *storage.IDStorage
	Set(key interface{}, records *storage.IDStorage)
	Count(key interface{}) int
	Keys() []interface{}
}

func WrapToThreadSafeStorage

func WrapToThreadSafeStorage(original Storage) Storage

Jump to

Keyboard shortcuts

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