validator

package
v0.0.0-...-1a5deed Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrInvalidEmailOrPassword is thrown when the user's email/password is wrong.
	ErrInvalidEmailOrPassword = errors.New("invalid email or password")
)

Functions

This section is empty.

Types

type Helpers

type Helpers struct {
	// contains filtered or unexported fields
}

Helpers are custom validations that are package agnostic

func NewHelpers

func NewHelpers(ovChipkaartAPIClient ovchipkaart.APIClient) Helpers

NewHelpers creates new helpers

func (Helpers) ValidateOvChipkaartCredentials

func (h Helpers) ValidateOvChipkaartCredentials(username string, password string) (err error)

ValidateOvChipkaartCredentials checks that the username and password for an ov chipkaart are valid

type ValidationResult

type ValidationResult struct {
	HasError bool
	Errors   url.Values
}

ValidationResult stores the result of a validation

type Validator

type Validator interface {
	ValidateCreateUserInput(input model.CreateUserInput, localeTag language.Tag) ValidationResult
	ValidateLoginInput(input model.LoginInput, localeTag language.Tag) ValidationResult
	ValidateStoreAnalzyeRequest(input model.StoreAnalyzeRequestInput, localTag language.Tag) ValidationResult
	ValidateAnalzyeRequestsInput(skip *int, take *int, orderBy *string, orderDirection *string, localTag language.Tag) ValidationResult
}

Validator represents a validator

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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