util

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace = "NAMESPACE"
	Context   = "CONTEXT"
)

Keys of rest.Request.Env used by rest.Middleware.

View Source
const (
	AuthHeader      = "Authorization"
	NamespaceHeader = "A8-Namespace"
	RequestIDHeader = "A8-Request-Id"
)

Header keys

Variables

This section is empty.

Functions

func Validate

func Validate(validators []ValidatorFunc) error

Validate runs validation checks

Types

type ValidatorFunc

type ValidatorFunc func() error

ValidatorFunc performs a validation check

func IsInRange

func IsInRange(name string, value, min, max int) ValidatorFunc

IsInRange ensures the integer is within the specified inclusive range

func IsInRangeDuration

func IsInRangeDuration(name string, value, min, max time.Duration) ValidatorFunc

IsInRangeDuration ensures the time value is between the given min and max times

func IsNotEmpty

func IsNotEmpty(name, value string) ValidatorFunc

IsNotEmpty ensures the value is not empty

func IsValidURL

func IsValidURL(name, value string) ValidatorFunc

IsValidURL ensures that the URL is valid and has a protocol specified (http, https, etc...)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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