filter

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package filter holds the filters used by a ListBy query.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EqFilter

type EqFilter struct {
	// contains filtered or unexported fields
}

EqFilter matches a field by an exact value.

func Eq

func Eq(field string) EqFilter

Eq filters a field by an exact value.

func (EqFilter) Filter

func (ef EqFilter) Filter()

marker method for sealed interface

func (EqFilter) GetField

func (ef EqFilter) GetField() string

GetField returns the field the filter works on.

func (EqFilter) IsOptional

func (ef EqFilter) IsOptional() bool

IsOptional reports if the filter can be skipped at call time.

func (EqFilter) Optional

func (ef EqFilter) Optional() EqFilter

Optional makes the filter skippable at call time.

type Filter

type Filter interface {
	Filter()
	// GetField returns the field the filter works on.
	GetField() string
	// IsOptional reports if the filter can be skipped at call time.
	IsOptional() bool
}

Filter is one condition on a field in a ListBy query.

type RangeFilter

type RangeFilter struct {
	// contains filtered or unexported fields
}

RangeFilter matches values between a lower and an upper bound.

func Range

func Range(field string) RangeFilter

Range filters a field by a lower and an upper bound.

func (RangeFilter) Filter

func (rf RangeFilter) Filter()

marker method for sealed interface

func (RangeFilter) GetField

func (rf RangeFilter) GetField() string

GetField returns the field the filter works on.

func (RangeFilter) IsOptional

func (rf RangeFilter) IsOptional() bool

IsOptional reports if the filter can be skipped at call time.

func (RangeFilter) Optional

func (rf RangeFilter) Optional() RangeFilter

Optional makes the filter skippable at call time.

type SearchFilter

type SearchFilter struct {
	// contains filtered or unexported fields
}

SearchFilter matches a field by a text pattern.

func Search(field string) SearchFilter

Search filters a field by a text pattern.

func (SearchFilter) Filter

func (sf SearchFilter) Filter()

marker method for sealed interface

func (SearchFilter) GetField

func (sf SearchFilter) GetField() string

GetField returns the field the filter works on.

func (SearchFilter) IsOptional

func (sf SearchFilter) IsOptional() bool

IsOptional reports if the filter can be skipped at call time.

func (SearchFilter) Optional

func (sf SearchFilter) Optional() SearchFilter

Optional makes the filter skippable at call time.

Jump to

Keyboard shortcuts

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