helper

package
v0.0.0-...-9047660 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDataFilter

func AddDataFilter(column string, action model.Operation, value string, db *gorm.DB) *gorm.DB

func AddTimeFilter

func AddTimeFilter(timeFilter model.TimeFilter, column string, db *gorm.DB) *gorm.DB

func Paginate

func Paginate(value interface{}, pagination *Pagination, db *gorm.DB) func(db *gorm.DB) *gorm.DB

func TimeFilterFromValue

func TimeFilterFromValue(timeFilter model.TimeFilter) time.Time

func TimeFilterToValue

func TimeFilterToValue(timeFilter model.TimeFilter) time.Time

Types

type Pagination

type Pagination struct {
	Limit      int         `json:"limit,omitempty;query:limit"`
	Page       int         `json:"page,omitempty;query:page"`
	TotalRows  int64       `json:"total_rows"`
	TotalPages int         `json:"total_pages"`
	Rows       interface{} `json:"rows"`
}

func (*Pagination) GetLimit

func (p *Pagination) GetLimit() int

func (*Pagination) GetOffset

func (p *Pagination) GetOffset() int

func (*Pagination) GetPage

func (p *Pagination) GetPage() int

type QueryResult

type QueryResult struct {
	Result interface{}
	Error  error
}

Jump to

Keyboard shortcuts

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