repo_filter

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Field string
	Type  FilterType
	Value any
}

func (Field) ApplyTo

func (f Field) ApplyTo(c *gorm.DB) *gorm.DB

func (Field) Condition

func (f Field) Condition() string

func (Field) Values

func (f Field) Values() []any

type FilterType

type FilterType string
const (
	EQ      FilterType = "="
	NE      FilterType = "!="
	GE      FilterType = ">="
	GT      FilterType = ">"
	LE      FilterType = "<="
	LT      FilterType = "<"
	LIKE    FilterType = "LIKE"
	IN      FilterType = "IN"
	NOTIN   FilterType = "NOT IN"
	BETWEEN FilterType = "BETWEEN"
)

type Pager

type Pager struct {
	Page  int
	Limit int
}

func (Pager) ApplyTo

func (p Pager) ApplyTo(c *gorm.DB) *gorm.DB

func (Pager) Condition

func (p Pager) Condition() string

func (Pager) Values

func (p Pager) Values() []any

type Where

type Where []any

func (Where) ApplyTo

func (w Where) ApplyTo(c *gorm.DB) *gorm.DB

func (Where) Condition

func (w Where) Condition() string

func (Where) Values

func (w Where) Values() []any

Jump to

Keyboard shortcuts

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