Documentation ¶
Index ¶
- Constants
- func CountWords(s string) int
- type BeginsWith
- type Between
- type Condition
- type Contains
- type Counters
- type DBField
- type Details
- type Empty
- type EndsWith
- type Eq
- type Export
- func (e *Export) GenerateExcel() bool
- func (e *Export) GeneratePdf()
- func (e *Export) GetExcelCreatedAt() time.Time
- func (e *Export) GetExcelError() error
- func (e *Export) GetExcelExportPath() (string, error)
- func (e *Export) GetExcelFileExtension() string
- func (e *Export) GetExcelFileID() uuid.UUID
- func (e *Export) GetExcelFileName() string
- func (e *Export) GetExcelFileSizeBytes() int64
- func (e *Export) GetExcelFullFileName() string
- func (e *Export) GetExcelFullFilePath() string
- func (e *Export) GetHtmlExportPath() (string, error)
- func (e *Export) GetItems() interface{}
- func (e *Export) GetJsonExportPath() (string, error)
- func (e *Export) GetNrOfRows() int64
- func (e *Export) GetPdfExportPath() (string, error)
- func (e *Export) GetWordExportPath() (string, error)
- func (e *Export) QueryItems() error
- func (e *Export) SetColumns(columns []ExportColumn) *Export
- func (e *Export) SetItems(items interface{}) *Export
- type ExportColumn
- type ExportHandler
- type ExportRow
- type ExportValue
- type GroupCondition
- type GroupConditionInput
- type He
- type Ht
- type In
- type Input
- func (f *Input) Apply() *Input
- func (f *Input) ApplyConditions() *Input
- func (f *Input) ApplyOrdering() *Input
- func (f *Input) ApplyPagination() *Input
- func (f *Input) DB() *gorm.DB
- func (f *Input) DisableDBFieldsAutoCaching() *Input
- func (f *Input) DisableDefaultScope() *Input
- func (f *Input) EnableDBFieldsAutoCaching() *Input
- func (f *Input) EnableDefaultScope() *Input
- func (f *Input) GetNrOfItems() (*Counters, error)
- func (f *Input) NewInstanceWithConditions() *Input
- func (f *Input) SetContext(ctx context.Context) *Input
- func (f *Input) SetCounterDB(dbClient *gorm.DB) *Input
- func (f *Input) SetDB(db *gorm.DB) *Input
- func (f *Input) SetDb(dbClient *gorm.DB) *Input
- func (f *Input) SetMainDB(dbClient *gorm.DB) *Input
- func (f *Input) SetMaxNrOfItems(maxNrOfItems int64) *Input
- func (f *Input) SetModels(models ...InputModel) *Input
- func (f *Input) SetNrOfItems(nrOfItems int64) *Input
- func (f *Input) SetPageNr(pageNr int64) *Input
- type InputModel
- type IsFalse
- type IsNull
- type IsTrue
- type Le
- type Lt
- type NotBeginsWith
- type NotBetween
- type NotContains
- type NotEmpty
- type NotEndsWith
- type NotEq
- type NotIn
- type NotNull
- type Order
- type QueryStatement
Constants ¶
View Source
const ( DefaultPageNr int64 = 1 DefaultNrOfItems int64 = 50 DefaultMaxNrOfItems int64 = 1000 )
Variables ¶
This section is empty.
Functions ¶
func CountWords ¶
Types ¶
type BeginsWith ¶
type Condition ¶
type Condition struct { Or *bool `json:"Or"` // Group *GroupCondition `json:"Group"` Eq *Eq `json:"Eq"` NotEq *NotEq `json:"NotEqual"` Ht *Ht `json:"HigherThan"` He *He `json:"HigherOrEqual"` Lt *Lt `json:"LowerThan"` Le *Le `json:"LowerOrEqual"` Contains *Contains `json:"Contains"` NotContains *NotContains `json:"NotContains"` BeginsWith *BeginsWith `json:"BeginsWith"` NotBeginsWith *NotBeginsWith `json:"NotBeginsWith"` EndsWith *EndsWith `json:"EndsWith"` NotEndsWith *NotEndsWith `json:"NotEndsWith"` In *In `json:"In"` NotIn *NotIn `json:"NotIn"` IsNull *IsNull `json:"IsNull"` NotNull *NotNull `json:"IsNotNull"` IsTrue *IsTrue `json:"IsTrue"` IsFalse *IsFalse `json:"IsFalse"` Empty *Empty `json:"IsEmpty"` NotEmpty *NotEmpty `json:"IsNotEmpty"` Between *Between `json:"Between"` NotBetween *NotBetween `json:"NotBetween"` }
type Counters ¶
type Counters struct { // how many items there are in the db without pagination TotalItems int64 // how many pages there are based on the requested nr of items TotalPages int64 // How many items have been requested RequestedNrOfItems int64 // what is the requested page nr RequestedPageNr int64 // how many items have been received from the server ReceivedNrOfItems int64 }
type Export ¶
type Export struct { // This is a prefix for exporting/generating the file! ExportName string TableName string Model interface{} Columns []ExportColumn Filter *Input Preloads []string // It will delete itself after a period of time... // if 0, then it will not be deleted! SelfDeleteAfterSeconds int64 // contains filtered or unexported fields }
func (*Export) GenerateExcel ¶
func (*Export) GeneratePdf ¶
func (e *Export) GeneratePdf()
func (*Export) GetExcelCreatedAt ¶
func (*Export) GetExcelError ¶
func (*Export) GetExcelExportPath ¶
func (*Export) GetExcelFileExtension ¶
func (*Export) GetExcelFileID ¶
func (*Export) GetExcelFileName ¶
func (*Export) GetExcelFileSizeBytes ¶
func (*Export) GetExcelFullFileName ¶
func (*Export) GetExcelFullFilePath ¶
func (*Export) GetHtmlExportPath ¶
func (*Export) GetItems ¶
func (e *Export) GetItems() interface{}
func (e *Export) GetItems() []map[string]interface{} {
func (*Export) GetJsonExportPath ¶
func (*Export) GetNrOfRows ¶
func (*Export) GetPdfExportPath ¶
func (*Export) GetWordExportPath ¶
func (*Export) QueryItems ¶
func (*Export) SetColumns ¶
func (e *Export) SetColumns(columns []ExportColumn) *Export
type ExportColumn ¶
type ExportColumn struct { // you can choose of these options: (it's the search criteria) FieldName string // it can contain . // This is the name of the column in the header HeaderName string Handler ExportHandler ColWidth float64 }
type ExportHandler ¶
type ExportHandler func(row *ExportRow) ExportValue
type ExportRow ¶
type ExportRow struct { ReflectVal reflect.Value RowMap map[string]interface{} Row interface{} FieldValue interface{} }
func (*ExportRow) GetStructValue ¶
type ExportValue ¶
type ExportValue interface{}
type GroupCondition ¶
type GroupCondition struct { Or *bool `json:"Or"` Conditions []*Condition `json:"Conditions"` Groups []*GroupCondition `json:"Groups"` }
type GroupConditionInput ¶
type GroupConditionInput struct { // This is the original clean DB Client //ODB *gorm.DB // This is the one that modifies... DB *gorm.DB GroupCondition *GroupCondition }
type Input ¶
type Input struct { PageNr *int64 `json:"PageNr"` NrOfItems *int64 `json:"NrOfItems"` // it allows to go higher than 1000 limit! Order []*Order `json:"OrderBy"` Search *string `json:"Search"` RootConditions *GroupCondition `json:"RootConditions"` // contains filtered or unexported fields }
func (*Input) ApplyConditions ¶
func (*Input) ApplyOrdering ¶
func (*Input) ApplyPagination ¶
func (*Input) DisableDBFieldsAutoCaching ¶
func (*Input) DisableDefaultScope ¶
func (*Input) EnableDBFieldsAutoCaching ¶
func (*Input) EnableDefaultScope ¶
func (*Input) GetNrOfItems ¶
func (*Input) NewInstanceWithConditions ¶
func (*Input) SetMaxNrOfItems ¶
SetMaxNrOfItems -> this is the max allowed value that can be set when requesting... or the max value that will be taken in case of if NrOfItems is higher than this limit! -1 can also be set! -> this means it's ALL or unlimited!
func (*Input) SetModels ¶
func (f *Input) SetModels(models ...InputModel) *Input
func (*Input) SetNrOfItems ¶
SetNrOfItems -> this is the requested nr of items!
type InputModel ¶
type NotBeginsWith ¶
type NotBetween ¶
type NotContains ¶
type NotEndsWith ¶
type QueryStatement ¶
type QueryStatement struct { Query interface{} Args []interface{} }
Source Files ¶
- clone.go
- condition_model.go
- conditions_model.go
- constructor.go
- context.go
- defaults.go
- export_constructor.go
- export_generate.go
- export_model.go
- filter.go
- filter_auto_caching.go
- filter_conditions.go
- filter_counter.go
- filter_default_scope.go
- filter_model.go
- filter_order.go
- filter_pagination.go
- filter_set_db.go
- group_model.go
- order_model.go
- validation.go
Click to show internal directories.
Click to hide internal directories.