Documentation ¶
Overview ¶
Package queryparser provive instrument to parse query in user format
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory interface { MapRegexField(field string, values []string) (interface{}, error) MapField(field string, values []string) (interface{}, error) ValidateRegexField(field string, values []string) error Validate(field string, values []string) error AddQueryTypeMapperField(field string, queryType typemapper.QueryTypeMapper) }
type FinalizeParseFunc ¶
type FinalizeParseFunc func(result ParseResult, field string, value ResultOrError)
type ParseResult ¶
type ParseResult map[string]ResultOrError
type ParseSchema ¶
type ParseSchema map[string]ParseSchemaItem
type ParseSchemaItem ¶
type ParseSchemaItem struct { // Func to validate after parse ValidationFunc validator.ValidateFunc // Func to map type TypeMapFunc typemapper.TypeMapperFunc // Func to validate field ValidateFieldFunc typemapper.ValidateFieldFunc // Func to validate values ValidateValuesFunc typemapper.ValidateValuesFunc // Check if field is regex IsRegex bool // Finalize FinalizeParseFunc FinalizeParseFunc }
type Parser ¶
type Parser struct { ParseSchema ParseSchema Factory Factory }
func New ¶
func New( Factory Factory, Schema ParseSchema, ) *Parser
func (*Parser) ParseUrlValues ¶
func (p *Parser) ParseUrlValues( urlValues url.Values, ) ParseResult
type ResultOrError ¶
type ResultOrError struct { Err error Result interface{} }
func (ResultOrError) IsError ¶
func (r ResultOrError) IsError() bool
Directories ¶
Path | Synopsis |
---|---|
example
|
|
Package validator provide types for validate query after parsing
|
Package validator provide types for validate query after parsing |
Click to show internal directories.
Click to hide internal directories.