crud

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NumberType   = "Number"
	StringType   = "String"
	EnumType     = "Enum"
	DateTimeType = "DateTime"
	DateType     = "Date"
	BooleanType  = "Boolean"
)

Variables

This section is empty.

Functions

func GenerateListRedisSearchQuery

func GenerateListRedisSearchQuery(params SearchParams) *orm.RedisSearchQuery

TODO : add full text queries when supported by hitrix

Types

type Column

type Column struct {
	Key            string
	Label          string
	Type           string
	Searchable     bool
	Sortable       bool
	Filterable     bool
	Visible        bool
	FilterValidMap []string
}

type ListRequest

type ListRequest struct {
	Page     *int
	PageSize *int
	Filter   map[string]interface{}
	Search   map[string]interface{}
	Sort     map[string]interface{}
}

type SearchParams

type SearchParams struct {
	Page           int
	PageSize       int
	Search         map[string]string
	StringFilters  map[string]string
	NumberFilters  map[string]int64
	BooleanFilters map[string]bool
	Sort           map[string]bool
}

func ExtractListParams

func ExtractListParams(cols []Column, request *ListRequest) SearchParams

Jump to

Keyboard shortcuts

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