datatable

package
v0.0.0-...-a97d171 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataTablesQuery

type DataTablesQuery struct {
	Draw   string                            `json:"draw"`
	Order  map[string]map[string]interface{} `json:"order"`
	Start  string                            `json:"start"`
	Search map[string]interface{}            `json:"search"`
	// contains filtered or unexported fields
}

func NewDataTableQuery

func NewDataTableQuery(r *http.Request, limit bool) (query DataTablesQuery)

DataTablesQuery

func (DataTablesQuery) GetOffset

func (q DataTablesQuery) GetOffset() int

func (DataTablesQuery) GetOffset64

func (q DataTablesQuery) GetOffset64() int64

func (DataTablesQuery) GetOrderBackend

func (q DataTablesQuery) GetOrderBackend(columns map[string]string) (a, b string)

func (DataTablesQuery) GetOrderElastic

func (q DataTablesQuery) GetOrderElastic(columns map[string]string) (sorters []elastic.Sorter)

func (DataTablesQuery) GetOrderMongo

func (q DataTablesQuery) GetOrderMongo(columns map[string]string) (cols bson.D)

func (DataTablesQuery) GetOrderSQL

func (q DataTablesQuery) GetOrderSQL(columns map[string]string) (order string)

func (DataTablesQuery) GetPage

func (q DataTablesQuery) GetPage(perPage int) int

func (DataTablesQuery) GetSearchSlice

func (q DataTablesQuery) GetSearchSlice(k string) (search []string)

func (DataTablesQuery) GetSearchSliceInterface

func (q DataTablesQuery) GetSearchSliceInterface(k string) (search []interface{})

func (DataTablesQuery) GetSearchString

func (q DataTablesQuery) GetSearchString(k string) (search string)

func (DataTablesQuery) SetOrderOffsetGorm

func (q DataTablesQuery) SetOrderOffsetGorm(db *gorm.DB, columns map[string]string) *gorm.DB

type DataTablesResponse

type DataTablesResponse struct {
	Draw            string                      `json:"draw"`
	RecordsTotal    int64                       `json:"recordsTotal,string"`
	RecordsFiltered int64                       `json:"recordsFiltered,string"`
	LevelLimited    int                         `json:"limited"` // 0 - Not limited, 1 - logged in, 2 - guest
	Data            [][]interface{}             `json:"data"`
	Aggregations    map[string]map[string]int64 `json:"aggregations"`
}

DataTablesResponse

func NewDataTablesResponse

func NewDataTablesResponse(r *http.Request, query DataTablesQuery, count int64, countFiltered int64, aggregations map[string]map[string]int64) (ret *DataTablesResponse)

func (*DataTablesResponse) AddRow

func (t *DataTablesResponse) AddRow(row []interface{})

Jump to

Keyboard shortcuts

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