query

package
v1.93.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Direction

type Direction string
const (
	Asc  Direction = "asc"
	Desc Direction = "desc"
)

type Filter

type Filter struct {
	Field    string
	Operator Operator
	Value    interface{}
}

func NewFilterFromUrlString

func NewFilterFromUrlString(value string) ([]Filter, error)

func NewFiltersFromUrl

func NewFiltersFromUrl(value *url.URL) ([]Filter, error)

type Operator

type Operator string
const (
	Eq            Operator = "eq"
	Eqe           Operator = "eqe"
	Gt            Operator = "gt"
	Gte           Operator = "gte"
	Lt            Operator = "lt"
	Lte           Operator = "lte"
	Contains      Operator = "contains"
	ArrayContains Operator = "array-contains"
)

func (Operator) String

func (o Operator) String() string

func (Operator) ToFireStoreOperator

func (o Operator) ToFireStoreOperator() string

type QueryOptions

type QueryOptions struct {
	Limit            int
	Next             string
	Previous         string
	OrderBy          string
	OrderByDirection Direction
	Filters          []Filter
}

func NewQueryOptionsFromForm

func NewQueryOptionsFromForm(values url.Values, fieldMappings ...map[string]string) (QueryOptions, error)

func NewQueryOptionsFromUrl

func NewQueryOptionsFromUrl(value *url.URL) (QueryOptions, error)

func NewQueryOptionsFromUrlString

func NewQueryOptionsFromUrlString(value string) (QueryOptions, error)

Jump to

Keyboard shortcuts

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