validate

package
v0.0.0-...-dc23390 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2018 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package validate provides utilities for commonly-used validation purposes (e.g., for input validation).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InRange

func InRange(value, inclusiveStart, inclusiveEnd float64, argumentName string) error

InRange validates that the specified value is in the specified range; argumentName is optional.

Types

type ValidationError

type ValidationError struct {
	ArgumentName string
	// contains filtered or unexported fields
}

ValidationError represents a validation error that can be handled differently in recovery.

func NewValidationError

func NewValidationError(err error, argumentName string) *ValidationError

NewValidationError creates a new validation error that can be handled differently in recovery. The parameter argumentName is optional.

func (*ValidationError) Error

func (err *ValidationError) Error() (message string)

Jump to

Keyboard shortcuts

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