Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldParseValidatorFromStruct ¶
func FieldParseValidatorFromStruct(gorm reflect.Value) map[string]ParseValidateFunc
FieldParseValidatorFromStruct TODO: gorm.model gets included as a valid field which we probably don't want. Don't panic - reflection is only used once on initialisation.
func IntegerValidator ¶
func NullValidator ¶
func NumericValidator ¶
Types ¶
type ParseValidateFunc ¶
type ParseValidateFunc = func(ex *parser.Expression) (*SqlResponse, error)
ParseValidateFunc takes an Expression from the AST and returns a templated SQL query.
func DefaultMatcherWithValidator ¶
func DefaultMatcherWithValidator(validate ValidatorFunc) ParseValidateFunc
DefaultMatcherWithValidator wraps the default matcher with validation on the value.
type SqlAdaptor ¶
type SqlAdaptor struct {
// contains filtered or unexported fields
}
func NewDefaultAdaptorFromStruct ¶
func NewDefaultAdaptorFromStruct(gorm reflect.Value) (*SqlAdaptor, error)
func NewSqlAdaptor ¶
func NewSqlAdaptor(fieldMappings map[string]string, defaultFields map[string]ParseValidateFunc, matchers map[*regexp.Regexp]ParseValidateFunc) *SqlAdaptor
func (*SqlAdaptor) Parse ¶
func (s *SqlAdaptor) Parse(str string) (*SqlResponse, error)
type SqlResponse ¶
func DefaultMatcher ¶
func DefaultMatcher(ex *parser.Expression) *SqlResponse
DefaultMatcher takes an expression and spits out the default SqlResponse.
type ValidatorFunc ¶
ValidatorFunc takes a field name and validates that it is a legal/correct format.
Click to show internal directories.
Click to hide internal directories.