goatquery

package module
v0.0.0-...-4b7c3b1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: MIT Imports: 6 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) (*gorm.DB, *int64, error)

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"`
}

Jump to

Keyboard shortcuts

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