comparators

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFailCastTypeError added in v0.1.0

func NewFailCastTypeError(field record.Field, cmp where.ComparatorType, receivedType interface{}, expectedType string) error

func NewNotImplementComparatorError added in v0.1.0

func NewNotImplementComparatorError(field record.Field, cmp where.ComparatorType) error

Types

type BoolFieldComparator

type BoolFieldComparator struct {
	Cmp    where.ComparatorType
	Getter record.BoolGetter
	Value  []bool
}

func (BoolFieldComparator) Compare

func (fc BoolFieldComparator) Compare(item record.Record) (bool, error)

func (BoolFieldComparator) CompareValue

func (fc BoolFieldComparator) CompareValue(value bool) (bool, error)

func (BoolFieldComparator) GetField

func (fc BoolFieldComparator) GetField() record.Field

func (BoolFieldComparator) GetType

func (BoolFieldComparator) ValueAt added in v0.1.0

func (fc BoolFieldComparator) ValueAt(index int) interface{}

func (BoolFieldComparator) ValuesCount added in v0.1.0

func (fc BoolFieldComparator) ValuesCount() int

type Enum16FieldComparator

type Enum16FieldComparator struct {
	Cmp    where.ComparatorType
	Getter record.Enum16Getter
	Value  []record.Enum16
}

func (Enum16FieldComparator) Compare

func (fc Enum16FieldComparator) Compare(item record.Record) (bool, error)

func (Enum16FieldComparator) CompareValue

func (fc Enum16FieldComparator) CompareValue(value uint16) (bool, error)

func (Enum16FieldComparator) GetField

func (fc Enum16FieldComparator) GetField() record.Field

func (Enum16FieldComparator) GetType

func (Enum16FieldComparator) ValueAt added in v0.1.0

func (fc Enum16FieldComparator) ValueAt(index int) interface{}

func (Enum16FieldComparator) ValuesCount added in v0.1.0

func (fc Enum16FieldComparator) ValuesCount() int

type Enum8FieldComparator

type Enum8FieldComparator struct {
	Cmp    where.ComparatorType
	Getter record.Enum8Getter
	Value  []record.Enum8
}

func (Enum8FieldComparator) Compare

func (fc Enum8FieldComparator) Compare(item record.Record) (bool, error)

func (Enum8FieldComparator) CompareValue

func (fc Enum8FieldComparator) CompareValue(value uint8) (bool, error)

func (Enum8FieldComparator) GetField

func (fc Enum8FieldComparator) GetField() record.Field

func (Enum8FieldComparator) GetType

func (Enum8FieldComparator) ValueAt added in v0.1.0

func (fc Enum8FieldComparator) ValueAt(index int) interface{}

func (Enum8FieldComparator) ValuesCount added in v0.1.0

func (fc Enum8FieldComparator) ValuesCount() int

type FailCastTypeError added in v0.1.0

type FailCastTypeError struct {
	Field        record.Field
	Cmp          where.ComparatorType
	ExpectedType string
	ReceivedType interface{}
}

func (FailCastTypeError) Error added in v0.1.0

func (e FailCastTypeError) Error() string

func (FailCastTypeError) Is added in v0.1.0

func (e FailCastTypeError) Is(err error) bool

type Int32FieldComparator

type Int32FieldComparator struct {
	Cmp    where.ComparatorType
	Getter record.Int32Getter
	Value  []int32
}

func (Int32FieldComparator) Compare

func (fc Int32FieldComparator) Compare(item record.Record) (bool, error)

func (Int32FieldComparator) CompareValue

func (fc Int32FieldComparator) CompareValue(value int32) (bool, error)

func (Int32FieldComparator) GetField

func (fc Int32FieldComparator) GetField() record.Field

func (Int32FieldComparator) GetType

func (Int32FieldComparator) ValueAt added in v0.1.0

func (fc Int32FieldComparator) ValueAt(index int) interface{}

func (Int32FieldComparator) ValuesCount added in v0.1.0

func (fc Int32FieldComparator) ValuesCount() int

type Int64FieldComparator

type Int64FieldComparator struct {
	Cmp    where.ComparatorType
	Getter record.Int64Getter
	Value  []int64
}

func (Int64FieldComparator) Compare

func (fc Int64FieldComparator) Compare(item record.Record) (bool, error)

func (Int64FieldComparator) CompareValue

func (fc Int64FieldComparator) CompareValue(value int64) (bool, error)

func (Int64FieldComparator) GetField

func (fc Int64FieldComparator) GetField() record.Field

func (Int64FieldComparator) GetType

func (Int64FieldComparator) ValueAt added in v0.1.0

func (fc Int64FieldComparator) ValueAt(index int) interface{}

func (Int64FieldComparator) ValuesCount added in v0.1.0

func (fc Int64FieldComparator) ValuesCount() int

type IntFieldComparator

type IntFieldComparator struct {
	Cmp    where.ComparatorType
	Getter record.IntGetter
	Value  []int
}

func (IntFieldComparator) Compare

func (fc IntFieldComparator) Compare(item record.Record) (bool, error)

func (IntFieldComparator) CompareValue

func (fc IntFieldComparator) CompareValue(value int) (bool, error)

func (IntFieldComparator) GetField

func (fc IntFieldComparator) GetField() record.Field

func (IntFieldComparator) GetType

func (IntFieldComparator) ValueAt added in v0.1.0

func (fc IntFieldComparator) ValueAt(index int) interface{}

func (IntFieldComparator) ValuesCount added in v0.1.0

func (fc IntFieldComparator) ValuesCount() int

type InterfaceFieldComparator

type InterfaceFieldComparator struct {
	Cmp    where.ComparatorType
	Getter record.InterfaceGetter
	Value  []interface{}
}

func (InterfaceFieldComparator) Compare

func (fc InterfaceFieldComparator) Compare(item record.Record) (bool, error)

func (InterfaceFieldComparator) CompareValue

func (fc InterfaceFieldComparator) CompareValue(value interface{}) (bool, error)

func (InterfaceFieldComparator) GetField

func (fc InterfaceFieldComparator) GetField() record.Field

func (InterfaceFieldComparator) GetType

func (InterfaceFieldComparator) ValueAt added in v0.1.0

func (fc InterfaceFieldComparator) ValueAt(index int) interface{}

func (InterfaceFieldComparator) ValuesCount added in v0.1.0

func (fc InterfaceFieldComparator) ValuesCount() int

type MapFieldComparator

type MapFieldComparator struct {
	Cmp    where.ComparatorType
	Getter record.MapGetter
	Value  []interface{}
}

func (MapFieldComparator) Compare

func (fc MapFieldComparator) Compare(item record.Record) (bool, error)

func (MapFieldComparator) CompareValue

func (fc MapFieldComparator) CompareValue(value record.Map) (bool, error)

func (MapFieldComparator) GetField

func (fc MapFieldComparator) GetField() record.Field

func (MapFieldComparator) GetType

func (MapFieldComparator) ValueAt added in v0.1.0

func (fc MapFieldComparator) ValueAt(index int) interface{}

func (MapFieldComparator) ValuesCount added in v0.1.0

func (fc MapFieldComparator) ValuesCount() int

type NotImplementComparatorError added in v0.1.0

type NotImplementComparatorError struct {
	Field record.Field
	Cmp   where.ComparatorType
}

func (NotImplementComparatorError) Error added in v0.1.0

func (NotImplementComparatorError) Is added in v0.1.0

type SetFieldComparator

type SetFieldComparator struct {
	Cmp    where.ComparatorType
	Getter record.SetGetter
	Value  []interface{}
}

func (SetFieldComparator) Compare

func (fc SetFieldComparator) Compare(item record.Record) (bool, error)

func (SetFieldComparator) CompareValue

func (fc SetFieldComparator) CompareValue(value record.Set) (bool, error)

func (SetFieldComparator) GetField

func (fc SetFieldComparator) GetField() record.Field

func (SetFieldComparator) GetType

func (SetFieldComparator) ValueAt added in v0.1.0

func (fc SetFieldComparator) ValueAt(index int) interface{}

func (SetFieldComparator) ValuesCount added in v0.1.0

func (fc SetFieldComparator) ValuesCount() int

type StringFieldComparator

type StringFieldComparator struct {
	Cmp    where.ComparatorType
	Getter record.StringGetter
	Value  []string
}

func (StringFieldComparator) Compare

func (fc StringFieldComparator) Compare(item record.Record) (bool, error)

func (StringFieldComparator) CompareValue

func (fc StringFieldComparator) CompareValue(value string) (bool, error)

func (StringFieldComparator) GetField

func (fc StringFieldComparator) GetField() record.Field

func (StringFieldComparator) GetType

func (StringFieldComparator) ValueAt added in v0.1.0

func (fc StringFieldComparator) ValueAt(index int) interface{}

func (StringFieldComparator) ValuesCount added in v0.1.0

func (fc StringFieldComparator) ValuesCount() int

type StringFieldRegexpComparator

type StringFieldRegexpComparator struct {
	Cmp    where.ComparatorType
	Getter record.StringGetter
	Value  *regexp.Regexp
}

StringFieldRegexpComparator is a special comparator for handling Regexp

func (StringFieldRegexpComparator) Compare

func (fc StringFieldRegexpComparator) Compare(item record.Record) (bool, error)

func (StringFieldRegexpComparator) CompareValue

func (fc StringFieldRegexpComparator) CompareValue(value string) (bool, error)

func (StringFieldRegexpComparator) GetField

func (StringFieldRegexpComparator) GetType

func (StringFieldRegexpComparator) ValueAt added in v0.1.0

func (fc StringFieldRegexpComparator) ValueAt(index int) interface{}

func (StringFieldRegexpComparator) ValuesCount added in v0.1.0

func (fc StringFieldRegexpComparator) ValuesCount() int

Jump to

Keyboard shortcuts

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