Documentation ¶
Index ¶
- Constants
- func Cursor(state interface{}) (string, error)
- func Escape(s string) string
- func Helpers() template.FuncMap
- func ParseCursor(c string, state interface{}) error
- func RenderQuery(ctx context.Context, tmpl *template.Template, data RenderData) (query string, args []interface{}, err error)
- type RenderData
Constants ¶
View Source
const ( MaxQueryLen = 255 MaxResults = 150 DefaultMaxResults = 15 )
Shared configuration for search methods.
Variables ¶
This section is empty.
Functions ¶
func Escape ¶
Escape will escape a search string for use with the Postgres `like` and `ilike` operators.
func Helpers ¶ added in v0.28.0
Helpers returns a map of all the helper functions that can be used in a template.
func ParseCursor ¶
ParseCursor will parse the data held in cursor c into the passed state object.
func RenderQuery ¶
func RenderQuery(ctx context.Context, tmpl *template.Template, data RenderData) (query string, args []interface{}, err error)
RenderQuery will render a search query with the given template and data. Named args in the format `:name:` will be replaced with the appropriate numbered args (e.g. `$1`, `$2`)
Types ¶
type RenderData ¶
RenderData is used as the data for a template with the ability to output a list of all possible arguments.
Click to show internal directories.
Click to hide internal directories.