bindvalidate

package
v0.0.0-...-141310f Latest Latest
Warning

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

Go to latest
Published: May 12, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package bindvalidate is package of validators and sanitizers for strings, structs and collections. Form Post is removed as we use JSON API only

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StatusTitle

func StatusTitle(code string) string

StatusTitle returns a text for the HTTP status code. It returns the empty string if the code is unknown.

Types

type BindAndValidate

type BindAndValidate struct{}

BindAndValidate struct

func (*BindAndValidate) Bind

func (cb *BindAndValidate) Bind(i interface{}, c echo.Context) error

Bind override

type JSONError

type JSONError struct {
	Code   string `json:"code"`   // an application-specific error code, expressed as a string value.
	Title  string `json:"title"`  // a short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
	Source string `json:"source"` // an object containing references to the source of the error
	Detail string `json:"detail"` // a human-readable explanation specific to this occurrence of the problem.
}

JSONError custom implementation of JSONAPI error

func NewError

func NewError(code, source, detail string) *JSONError

NewError creates new error

type JSONErrors

type JSONErrors struct {
	Errors []*JSONError `json:"errors"`
}

JSONErrors for multiple return

func (JSONErrors) Error

func (e JSONErrors) Error() string

Jump to

Keyboard shortcuts

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