models

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 0 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clause

type Clause struct {
	Field    string    `json:"field"`
	Operator string    `json:"operator"`
	Value    any       `json:"value"`
	Children []IClause `json:"children"`
}

func (*Clause) GetChildren

func (c *Clause) GetChildren() []IClause

func (*Clause) GetField

func (c *Clause) GetField() string

func (*Clause) GetOperator

func (c *Clause) GetOperator() string

func (*Clause) GetValue

func (c *Clause) GetValue() any

func (*Clause) SetChildren

func (c *Clause) SetChildren(children []IClause)

func (*Clause) SetField

func (c *Clause) SetField(field string)

func (*Clause) SetOperator

func (c *Clause) SetOperator(operator string)

func (*Clause) SetValue

func (c *Clause) SetValue(value any)

type IClause

type IClause interface {
	GetField() string
	SetField(string)
	GetOperator() string
	SetOperator(string)
	GetValue() any
	SetValue(any)
	GetChildren() []IClause
	SetChildren([]IClause)
}

type IPagination

type IPagination interface {
	GetPage() int
	SetPage(page int)
	GetSize() int
	SetSize(size int)
	GetTotal() int64
	SetTotal(total int64)
}

type ISorting

type ISorting interface {
	GetBy() string
	SetBy(by string)
	GetAsc() bool
	SetAsc(asc bool)
}

type Pagination

type Pagination struct {
	Page  int   `form:"page" json:"page"`
	Size  int   `form:"size" json:"size"`
	Total int64 `form:"-" json:"total"` // this field is used in response, not in query
}

func (*Pagination) GetPage

func (p *Pagination) GetPage() int

func (*Pagination) GetSize

func (p *Pagination) GetSize() int

func (*Pagination) GetTotal

func (p *Pagination) GetTotal() int64

func (*Pagination) SetPage

func (p *Pagination) SetPage(page int)

func (*Pagination) SetSize

func (p *Pagination) SetSize(size int)

func (*Pagination) SetTotal

func (p *Pagination) SetTotal(total int64)

type Sorting

type Sorting struct {
	By  string `form:"by" json:"by"`
	Asc bool   `form:"asc" json:"asc"`
}

func (*Sorting) GetAsc

func (s *Sorting) GetAsc() bool

func (*Sorting) GetBy

func (s *Sorting) GetBy() string

func (*Sorting) SetAsc

func (s *Sorting) SetAsc(asc bool)

func (*Sorting) SetBy

func (s *Sorting) SetBy(by string)

Jump to

Keyboard shortcuts

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