fields

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookupFieldByTag

func LookupFieldByTag(tag string, input *sdk.SignedTxnWithAD) (interface{}, error)

LookupFieldByTag takes a tag and associated SignedTxnWithAD and returns the value referenced by the tag. An error is returned if the tag does not exist

func ValidFieldOperation

func ValidFieldOperation(input string) bool

ValidFieldOperation returns true if the input is a valid operation

Types

type Filter

type Filter struct {
	Op        Operation
	Searchers []*Searcher
	OmitGroup bool
}

Filter an object that combines field searches with a boolean operator

func (Filter) SearchAndFilter

func (f Filter) SearchAndFilter(payset []sdk.SignedTxnInBlock) ([]sdk.SignedTxnInBlock, error)

SearchAndFilter searches through the block data and applies the operation to the results

type Operation

type Operation string

Operation an operation like "any" or "all" for boolean logic

type Searcher

type Searcher struct {
	Exp         expression.Expression
	Tag         string
	SearchInner bool
}

Searcher searches the struct with an expression

func MakeFieldSearcher

func MakeFieldSearcher(e expression.Expression, expressionType expression.Type, tag string, searchInner bool) (*Searcher, error)

MakeFieldSearcher will check that the field exists and that it contains the necessary "conversion" function TODO: Remove expressionType. It is validated when the expression is created.

Jump to

Keyboard shortcuts

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