Documentation ¶
Index ¶
- Constants
- type Filter
- func And(filters ...Filter) Filter
- func Between(field string, v1 interface{}, v2 interface{}) Filter
- func Equal(field string, value interface{}) Filter
- func Exists(field string) Filter
- func Gt(field string, value interface{}) Filter
- func Gte(field string, value interface{}) Filter
- func Lt(field string, value interface{}) Filter
- func Lte(field string, value interface{}) Filter
- func Nor(filters ...Filter) Filter
- func Not(filter Filter) Filter
- func NotEqual(field string, value interface{}) Filter
- func Or(filters ...Filter) Filter
- func StartWith(field string, prefix string) Filter
- type Index
- type IndexFields
- type IndexRequest
- type LogicOperator
- type Map
- type SortBy
- type SortByField
- type SortDirection
- type ValueOperator
Constants ¶
const MaxString = string(unicode.MaxRune)
MaxString is the unicode character \uFFFF, useful as an upperbound for queryies
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
A Filter is a filter on documents, to be passed as the selector of a couchdb.FindRequest In the future, we might add go-side validation but we will need to duplicate the couchdb UCA algorithm
type Index ¶
type Index struct { Doctype string Request *IndexRequest }
Index contains an index request on a specified domain.
func IndexOnFields ¶
IndexOnFields constructs a new Index it lets couchdb defaults for index & designdoc names.
type IndexFields ¶
type IndexFields []string
An IndexFields is just a list of fields to be indexed.
func (IndexFields) MarshalJSON ¶
func (def IndexFields) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface on IndexFields by wrapping it in a {"fields": ...}
type IndexRequest ¶
type IndexRequest struct { Name string `json:"name,omitempty"` DDoc string `json:"ddoc,omitempty"` Index IndexFields `json:"index"` }
IndexRequest is a request to be POSTED to create the index
type Map ¶
type Map map[string]interface{}
Map is an alias for map[string]interface{}
func (Map) MarshalJSON ¶
MarshalJSON returns a byte json representation of the map
type SortBy ¶
type SortBy []SortByField
SortBy is a sorting rule to be used as the sort of a couchdb.FindRequest a list of (field, direction) combination.
func (SortBy) MarshalJSON ¶
MarshalJSON implements json.Marshaller on SortBy it will returns a json array [field, direction]
type SortByField ¶
type SortByField struct { Field string Direction SortDirection }
SortByField is a sorting rule to be used as the sort for a pair of (field, direction).
type SortDirection ¶
type SortDirection string
SortDirection can be either ASC or DESC
const Asc SortDirection = "asc"
Asc is the ascending sorting order
const Desc SortDirection = "desc"
Desc is the descending sorting order
type ValueOperator ¶
type ValueOperator string
ValueOperator is an operator between a field and a value