Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultValidator ¶
type DefaultValidator struct {
// contains filtered or unexported fields
}
DefaultValidator is the default arguments validator for handlers in pitaya
func (*DefaultValidator) Validate ¶
func (v *DefaultValidator) Validate(ctx context.Context, in interface{}) (context.Context, interface{}, error)
Validate is the the function responsible for validating the 'in' parameter based on the struct tags the parameter has. This function has the pipeline.Handler signature so it is possible to use it as a pipeline function
type StructValidator ¶
type StructValidator interface {
Validate(context.Context, interface{}) (context.Context, interface{}, error)
}
StructValidator is the interface that must be implemented by a struct validator for the request arguments on pitaya.
The default struct validator used by pitaya is https://github.com/go-playground/validator.
var StructValidatorInstance StructValidator = &DefaultValidator{}
StructValidatorInstance holds the default validator on start but can be overridden if needed.
Click to show internal directories.
Click to hide internal directories.