quintodrome/model/base.go

22 lines
509 B
Go
Raw Normal View History

2020-01-14 18:22:34 -09:00
package model
import "errors"
var (
2016-03-23 12:30:38 -08:00
ErrNotFound = errors.New("data not found")
)
// Filters use the same operators as Beego ORM: See https://beego.me/docs/mvc/model/query.md#operators
// Ex: var q = QueryOptions{Filters: Filters{"name__istartswith": "Deluan","age__gt": 25}}
// All conditions will be ANDed together
// TODO Implement filter in repositories' methods
type Filters map[string]interface{}
2016-03-03 18:44:28 -09:00
type QueryOptions struct {
SortBy string
Desc bool
Offset int
Size int
Filters Filters
2016-03-03 18:44:28 -09:00
}