goatquery

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(db *gorm.DB, query Query, maxTop *int, searchFunc func(db *gorm.DB, searchTerm string) *gorm.DB, model interface{}) (*gorm.DB, *int64, error)

func GetGormColumnNameByJsonTag added in v0.3.0

func GetGormColumnNameByJsonTag(namer schema.Namer, tableName string, t reflect.Type, property string) string

Types

type PagedResponse

type PagedResponse[T any] struct {
	Count *int64 `json:"count,omitempty"`
	Value []T    `json:"value"`
}

func BuildPagedResponse

func BuildPagedResponse[T any](res []T, query Query, totalCount *int64) PagedResponse[map[string]interface{}]

type Query

type Query struct {
	Top     int
	Skip    int
	Count   bool
	OrderBy string
	Select  string
	Search  string
	Filter  string
}

type QueryErrorResponse

type QueryErrorResponse struct {
	Status  uint   `json:"status"`
	Message string `json:"message"`
}

Directories

Path Synopsis
examples
fiber Module

Jump to

Keyboard shortcuts

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