indexers

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 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 Field

type Field struct {
	// Struct is the name of the field of the struct
	// being indexed.
	Struct string
	// Sub is the name of the field inside the struct Struct,
	// which is being indexed.
	Sub string
}

Field represents a field that needs to be used for subfield indexing.

type MD5FieldsIndexer

type MD5FieldsIndexer struct {
	// Fields to use for md5sum calculation
	Fields []string
}

MD5FieldsIndexer is used to create an index based on md5sum of string or *string fields.

func (*MD5FieldsIndexer) FromArgs

func (s *MD5FieldsIndexer) FromArgs(args ...interface{}) ([]byte, error)

FromArgs takes in a string and returns its byte form.

func (*MD5FieldsIndexer) FromObject

func (s *MD5FieldsIndexer) FromObject(obj interface{}) (bool, []byte, error)

FromObject take Obj and returns index key formed using the fields.

type SubFieldIndexer

type SubFieldIndexer struct {
	Fields []Field
}

SubFieldIndexer is used to extract a field from an object using reflection and builds an index on that field.

func (*SubFieldIndexer) FromArgs

func (s *SubFieldIndexer) FromArgs(args ...interface{}) ([]byte, error)

FromArgs takes in a string and returns its byte form.

func (*SubFieldIndexer) FromObject

func (s *SubFieldIndexer) FromObject(obj interface{}) (bool, []byte, error)

FromObject take Obj and returns index key formed using the field SubField.

Jump to

Keyboard shortcuts

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