indexers

package
v1.28.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 MethodIndexer

type MethodIndexer struct {
	// Method name to call to get the string to bulid the index on.
	Method string
}

MethodIndexer is used to create an index based on a string returned as a result of calling a method on the object. It is assumed that the method has no arguments.

func (*MethodIndexer) FromArgs

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

FromArgs takes in a string and returns its byte form.

func (*MethodIndexer) FromObject

func (s *MethodIndexer) 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