defaultpipelines

package
v0.9.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2019 License: MIT Imports: 3 Imported by: 0

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{}) (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{}) (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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL