comparators

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrFailCastType added in v0.0.3

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

func NewErrNotImplementComparator added in v0.0.3

func NewErrNotImplementComparator(field string, 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() string

func (BoolFieldComparator) GetType

func (BoolFieldComparator) Values added in v0.0.3

func (fc BoolFieldComparator) Values() []interface{}

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() string

func (Enum16FieldComparator) GetType

func (Enum16FieldComparator) Values added in v0.0.3

func (fc Enum16FieldComparator) Values() []interface{}

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() string

func (Enum8FieldComparator) GetType

func (Enum8FieldComparator) Values added in v0.0.3

func (fc Enum8FieldComparator) Values() []interface{}

type ErrFailCastType

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

func (ErrFailCastType) Error added in v0.0.3

func (e ErrFailCastType) Error() string

func (ErrFailCastType) Is added in v0.0.3

func (e ErrFailCastType) Is(err error) bool

type ErrNotImplementComparator

type ErrNotImplementComparator struct {
	Field string
	Cmp   where.ComparatorType
}

func (ErrNotImplementComparator) Error added in v0.0.3

func (ErrNotImplementComparator) Is added in v0.0.3

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() string

func (Int32FieldComparator) GetType

func (Int32FieldComparator) Values added in v0.0.3

func (fc Int32FieldComparator) Values() []interface{}

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() string

func (Int64FieldComparator) GetType

func (Int64FieldComparator) Values added in v0.0.3

func (fc Int64FieldComparator) Values() []interface{}

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() string

func (IntFieldComparator) GetType

func (IntFieldComparator) Values added in v0.0.3

func (fc IntFieldComparator) Values() []interface{}

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() string

func (InterfaceFieldComparator) GetType

func (InterfaceFieldComparator) Values added in v0.0.3

func (fc InterfaceFieldComparator) Values() []interface{}

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() string

func (MapFieldComparator) GetType

func (MapFieldComparator) Values added in v0.0.3

func (fc MapFieldComparator) Values() []interface{}

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() string

func (SetFieldComparator) GetType

func (SetFieldComparator) Values added in v0.0.3

func (fc SetFieldComparator) Values() []interface{}

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() string

func (StringFieldComparator) GetType

func (StringFieldComparator) Values added in v0.0.3

func (fc StringFieldComparator) Values() []interface{}

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 (fc StringFieldRegexpComparator) GetField() string

func (StringFieldRegexpComparator) GetType

func (StringFieldRegexpComparator) Values added in v0.0.3

func (fc StringFieldRegexpComparator) Values() []interface{}

Jump to

Keyboard shortcuts

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