typed

package
v0.0.0-...-2132f45 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TypedValue

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

TypedValue is a value of some specific type.

func AsTyped

func AsTyped(v value.Value, s *schema.Schema, typeName string) (TypedValue, error)

AsTyped accepts a value and a type and returns a TypedValue. 'v' must have type 'typeName' in the schema. An error is returned if the v doesn't conform to the schema.

func AsTypedUnvalidated

func AsTypedUnvalidated(v value.Value, s *schema.Schema, typeName string) (TypedValue, error)

AsTypeUnvalidated is just like WithType, but doesn't validate that the type conforms to the schema, for cases where that has already been checked.

func (TypedValue) Validate

func (tv TypedValue) Validate() error

Validate returns an error with a list of every spec violation.

type ValidationError

type ValidationError struct {
	Path         fieldpath.Path
	ErrorMessage string
}

ValidationError reports an error about a particular field

func (ValidationError) Error

func (ve ValidationError) Error() string

Error returns a human readable error message.

type ValidationErrors

type ValidationErrors []ValidationError

ValidationErrors accumulates multiple validation error messages.

func (ValidationErrors) Error

func (errs ValidationErrors) Error() string

Error returns a human readable error message reporting each error in the list.

Jump to

Keyboard shortcuts

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