Documentation
¶
Overview ¶
Package predicate defines public predicate templates, filters, and custom handler contracts. Runtime compilation and SQL expansion remain Datly-owned.
Index ¶
- func RegisterTemplate(template *Template)
- func Templates(callback NotifierFn) (map[string]*Template, func())
- type BoolFilter
- type Criteria
- type Handler
- type HandlerFunc
- type IntFilter
- type Lookup
- type NamedArgument
- type NamedFilter
- type NamedFilters
- type NotifierFn
- type Registry
- type StringsFilter
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTemplate ¶
func RegisterTemplate(template *Template)
func Templates ¶
func Templates(callback NotifierFn) (map[string]*Template, func())
Types ¶
type BoolFilter ¶
BoolFilter is the reduced bool filter payload shape.
type Criteria ¶ added in v1.0.0
Criteria is the SQL fragment produced by a custom predicate handler.
type HandlerFunc ¶ added in v1.0.0
HandlerFunc adapts a function to Handler.
type Lookup ¶ added in v1.0.0
Lookup defines the minimal read-only predicate-template registry contract.
type NamedArgument ¶
NamedArgument describes one named template argument.
type NamedFilter ¶
type NamedFilter struct {
Name string `xls:"name=Filter"`
Include []string `json:",omitempty"`
Exclude []string `json:",omitempty"`
}
NamedFilter groups include/exclude values under one named filter.
type NamedFilters ¶
type NamedFilters []*NamedFilter
NamedFilters is the reduced public filter payload contract.
type NotifierFn ¶
type NotifierFn func(template *Template)
type StringsFilter ¶
type StringsFilter struct {
Include []string `json:",omitempty"`
Exclude []string `json:",omitempty"`
}
StringsFilter is the reduced string filter payload shape.
type Template ¶
type Template struct {
Name string
Source string
Args []*NamedArgument
}
Template is the public predicate-template contract.