Help us shape the future of Go! Take the 2026 Go Developer Survey

crud

package
v1.3.64 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InputTypeNumber                      = "InputTypeNumber"
	MultiSelectTypeArrayNumber           = "MultiSelectTypeArrayNumber"
	RangeSliderTypeArrayNumber           = "RangeSliderTypeArrayNumber"
	InputTypeString                      = "InputTypeString"
	ArrayStringType                      = "ArrayStringType" //not sure what element should be, we can rename it whenever we need it
	SelectTypeStringString               = "SelectTypeStringString"
	SelectTypeIntString                  = "SelectTypeIntString"
	DateTimePickerTypeDateTime           = "DateTimePickerTypeDateTime"
	DatePickerTypeDate                   = "DatePickerTypeDate"
	RangeDateTimePickerTypeArrayDateTime = "RangeDateTimePickerTypeArrayDateTime"
	RangeDatePickerTypeArrayDate         = "RangeDatePickerTypeArrayDate"
	CheckboxTypeBoolean                  = "CheckboxTypeBoolean"
)
View Source
const (
	FieldTypeBool        = "Bool"
	FieldTypeCoordinates = "Coordinates"
	FieldTypeDateTime    = "DateTime"
)

Variables

This section is empty.

Functions

func GetExporterDataCrud added in v1.2.77

func GetExporterDataCrud(columns []*Column, rows interface{}) ([]string, [][]interface{})

Types

type Column

type Column struct {
	Key                               string
	Label                             string
	FilterType                        string
	FieldType                         string
	Searchable                        bool
	Sortable                          bool
	Visible                           bool
	TranslationDataEnabled            bool
	FilterDependencyField             string                             `json:",omitempty"`
	DataMapStringStringKeyStringValue map[string][]*StringKeyStringValue `json:",omitempty"`
	DataStringKeyStringValue          []*StringKeyStringValue            `json:",omitempty"`
	DataIntKeyStringValue             []*IntKeyStringValue               `json:",omitempty"`
}

type Crud

type Crud struct {
	ExportConfigs      []ExportConfig
	TranslationService translation.ITranslationService
}

func (*Crud) ExtractListParams

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

func (*Crud) GenerateListMysqlQuery added in v0.8.4

func (c *Crud) GenerateListMysqlQuery(params SearchParams) *beeorm.Where

func (*Crud) GenerateListRedisSearchQuery

func (c *Crud) GenerateListRedisSearchQuery(params SearchParams) *beeorm.RedisSearchQuery

GenerateListRedisSearchQuery TODO : add full text queries when supported by hitrix

func (*Crud) GetExportConfig added in v1.2.77

func (c *Crud) GetExportConfig(id string) (*ExportConfig, bool)

func (*Crud) GetExportHandler added in v1.2.77

func (c *Crud) GetExportHandler(id string) (ExportHandler, bool)

func (*Crud) TranslateColumns added in v1.3.22

func (c *Crud) TranslateColumns(ormService *beeorm.Engine, lang entity.TranslationTextLang, cols []*Column) []*Column

type ExportConfig added in v1.2.77

type ExportConfig struct {
	Handler          ExportHandler
	ID               string
	AllowedExtraArgs []string
	Resource         string
	Permissions      []string
}

type ExportHandler added in v1.2.77

type ExportHandler func(entity.TranslationTextLang, *beeorm.Engine, *ListRequest, uint64, map[string]string) ([]string, [][]interface{}, error)

type IntKeyStringValue added in v1.2.33

type IntKeyStringValue struct {
	Key   uint64
	Label string
}

type ListRequest

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

type SearchParams

type SearchParams struct {
	Page                 int
	PageSize             int
	StringORFilters      map[string]string
	StringFilters        map[string]string
	TagFilters           map[string]string
	ArrayStringFilters   map[string][]string
	NumberFilters        map[string]int64
	ArrayNumberFilters   map[string][]int64
	RangeNumberFilters   map[string][]int64
	DateTimeFilters      map[string]time.Time
	DateFilters          map[string]time.Time
	RangeDateTimeFilters map[string][]time.Time
	RangeDateFilters     map[string][]time.Time
	BooleanFilters       map[string]bool
	Sort                 map[string]bool
}

type StringKeyStringValue added in v1.2.33

type StringKeyStringValue struct {
	Key   string
	Label string
}

Jump to

Keyboard shortcuts

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