helpers

package
v1.17.6-rc.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: BSD-3-Clause Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ObjectsBucket       = []byte("objects")
	ObjectsBucketLSM    = "objects"
	DimensionsBucketLSM = "dimensions"
	DocIDBucket         = []byte("doc_ids")
)

Functions

func BucketFromPropName

func BucketFromPropName(propName string) []byte

BucketFromPropName creates the byte-representation used as the bucket name for a partiular prop in the inverted index

func BucketFromPropNameLSM

func BucketFromPropNameLSM(propName string) string

BucketFromPropName creates the byte-representation used as the bucket name for a partiular prop in the inverted index

func HashBucketFromPropNameLSM

func HashBucketFromPropNameLSM(propName string) string

HashBucketFromPropName creates the byte-representation used as the bucket name for the status information of a partiular prop in the inverted index

func MetaCountProp

func MetaCountProp(propName string) string

MetaCountProp helps create an internally used propName for meta props that don't explicitly exist in the user schema, but are required for proper indexing, such as the count of arrays.

func TokenizeString

func TokenizeString(in string) []string

TokenizeString only splits on white spaces, it does not alter casing

func TokenizeText

func TokenizeText(in string) []string

Tokenize Text splits on any non-alphanumerical and lowercases the words

func TokenizeTextKeepWildcards

func TokenizeTextKeepWildcards(in string) []string

Tokenize Text splits on any non-alphanumerical except wildcard-symbols and lowercases the words

func TrimString

func TrimString(in string) string

TrimString trims on white spaces

Types

type AllowList

type AllowList map[uint64]struct{}

AllowList groups a list of possible indexIDs to be passed to a secondary index. The secondary index must make sure that it only returns result present on the AllowList

func (AllowList) Contains

func (al AllowList) Contains(id uint64) bool

Contains is not thread-safe if the list is still being filled. However, if you can guarantee that the list is no longer being inserted into and it effectively becomes read-only, you can safely read concurrently

func (AllowList) DeepCopy

func (al AllowList) DeepCopy() AllowList

func (AllowList) Insert

func (al AllowList) Insert(id uint64)

Inserting and reading is not thread-safe. However, if inserting has completed, and the list can be considered read-only, it is safe to read from it concurrently

func (AllowList) Slice

func (al AllowList) Slice() []uint64

Jump to

Keyboard shortcuts

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