validator

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2016 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorFloatNotInRange

func ErrorFloatNotInRange(value float64, lowerLimit float64, upperLimit float64) *service.Error

func ErrorFloatNotOneOf

func ErrorFloatNotOneOf(value float64, allowedValues []float64) *service.Error

func ErrorFloatOneOf

func ErrorFloatOneOf(value float64, disallowedValues []float64) *service.Error

func ErrorIntegerNotInRange

func ErrorIntegerNotInRange(value int, lowerLimit int, upperLimit int) *service.Error

func ErrorIntegerNotOneOf

func ErrorIntegerNotOneOf(value int, allowedValues []int) *service.Error

func ErrorIntegerOneOf

func ErrorIntegerOneOf(value int, disallowedValues []int) *service.Error

func ErrorLengthEqualTo

func ErrorLengthEqualTo(length int, limit int) *service.Error

func ErrorLengthNotEqualTo

func ErrorLengthNotEqualTo(length int, limit int) *service.Error

func ErrorLengthNotGreaterThan

func ErrorLengthNotGreaterThan(length int, limit int) *service.Error

func ErrorLengthNotGreaterThanOrEqualTo

func ErrorLengthNotGreaterThanOrEqualTo(length int, limit int) *service.Error

func ErrorLengthNotInRange

func ErrorLengthNotInRange(length int, lowerLimit int, upperLimit int) *service.Error

func ErrorLengthNotLessThan

func ErrorLengthNotLessThan(length int, limit int) *service.Error

func ErrorLengthNotLessThanOrEqualTo

func ErrorLengthNotLessThanOrEqualTo(length int, limit int) *service.Error

func ErrorStringNotOneOf

func ErrorStringNotOneOf(value string, allowedValues []string) *service.Error

func ErrorStringOneOf

func ErrorStringOneOf(value string, disallowedValues []string) *service.Error

func ErrorTimeNotAfter

func ErrorTimeNotAfter(value time.Time, limit time.Time, timeLayout string) *service.Error

func ErrorTimeNotAfterNow

func ErrorTimeNotAfterNow(value time.Time, timeLayout string) *service.Error

func ErrorTimeNotBefore

func ErrorTimeNotBefore(value time.Time, limit time.Time, timeLayout string) *service.Error

func ErrorTimeNotBeforeNow

func ErrorTimeNotBeforeNow(value time.Time, timeLayout string) *service.Error

func ErrorTimeNotValid

func ErrorTimeNotValid(value string, timeLayout string) *service.Error

func ErrorValueEmpty

func ErrorValueEmpty() *service.Error

func ErrorValueEqualTo

func ErrorValueEqualTo(value interface{}, limit interface{}) *service.Error

func ErrorValueExists

func ErrorValueExists() *service.Error

func ErrorValueNotEmpty

func ErrorValueNotEmpty() *service.Error

func ErrorValueNotEqualTo

func ErrorValueNotEqualTo(value interface{}, limit interface{}) *service.Error

func ErrorValueNotExists

func ErrorValueNotExists() *service.Error

func ErrorValueNotFalse

func ErrorValueNotFalse() *service.Error

func ErrorValueNotGreaterThan

func ErrorValueNotGreaterThan(value interface{}, limit interface{}) *service.Error

func ErrorValueNotGreaterThanOrEqualTo

func ErrorValueNotGreaterThanOrEqualTo(value interface{}, limit interface{}) *service.Error

func ErrorValueNotLessThan

func ErrorValueNotLessThan(value interface{}, limit interface{}) *service.Error

func ErrorValueNotLessThanOrEqualTo

func ErrorValueNotLessThanOrEqualTo(value interface{}, limit interface{}) *service.Error

func ErrorValueNotTrue

func ErrorValueNotTrue() *service.Error

Types

type Standard

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

func NewStandard

func NewStandard(context data.Context) (*Standard, error)

func (*Standard) AppendError

func (s *Standard) AppendError(reference interface{}, err *service.Error)

func (*Standard) Logger

func (s *Standard) Logger() log.Logger

func (*Standard) NewChildValidator

func (s *Standard) NewChildValidator(reference interface{}) data.Validator

func (*Standard) SetMeta

func (s *Standard) SetMeta(meta interface{})

func (*Standard) ValidateBoolean

func (s *Standard) ValidateBoolean(reference interface{}, value *bool) data.Boolean

func (*Standard) ValidateFloat

func (s *Standard) ValidateFloat(reference interface{}, value *float64) data.Float

func (*Standard) ValidateFloatAsBloodGlucoseValue

func (s *Standard) ValidateFloatAsBloodGlucoseValue(reference interface{}, floatValue *float64) data.BloodGlucoseValue

func (*Standard) ValidateInteger

func (s *Standard) ValidateInteger(reference interface{}, value *int) data.Integer

func (*Standard) ValidateInterface

func (s *Standard) ValidateInterface(reference interface{}, value *interface{}) data.Interface

func (*Standard) ValidateInterfaceArray

func (s *Standard) ValidateInterfaceArray(reference interface{}, value *[]interface{}) data.InterfaceArray

func (*Standard) ValidateObject

func (s *Standard) ValidateObject(reference interface{}, value *map[string]interface{}) data.Object

func (*Standard) ValidateObjectArray

func (s *Standard) ValidateObjectArray(reference interface{}, value *[]map[string]interface{}) data.ObjectArray

func (*Standard) ValidateString

func (s *Standard) ValidateString(reference interface{}, value *string) data.String

func (*Standard) ValidateStringArray

func (s *Standard) ValidateStringArray(reference interface{}, value *[]string) data.StringArray

func (*Standard) ValidateStringAsBloodGlucoseUnits

func (s *Standard) ValidateStringAsBloodGlucoseUnits(reference interface{}, stringValue *string) data.BloodGlucoseUnits

func (*Standard) ValidateStringAsTime

func (s *Standard) ValidateStringAsTime(reference interface{}, stringValue *string, timeLayout string) data.Time

type StandardBoolean

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

func NewStandardBoolean

func NewStandardBoolean(context data.Context, reference interface{}, value *bool) *StandardBoolean

func (*StandardBoolean) Exists

func (s *StandardBoolean) Exists() data.Boolean

func (*StandardBoolean) False

func (s *StandardBoolean) False() data.Boolean

func (*StandardBoolean) NotExists

func (s *StandardBoolean) NotExists() data.Boolean

func (*StandardBoolean) True

func (s *StandardBoolean) True() data.Boolean

type StandardFloat

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

func NewStandardFloat

func NewStandardFloat(context data.Context, reference interface{}, value *float64) *StandardFloat

func (*StandardFloat) EqualTo

func (s *StandardFloat) EqualTo(value float64) data.Float

func (*StandardFloat) Exists

func (s *StandardFloat) Exists() data.Float

func (*StandardFloat) GreaterThan

func (s *StandardFloat) GreaterThan(limit float64) data.Float

func (*StandardFloat) GreaterThanOrEqualTo

func (s *StandardFloat) GreaterThanOrEqualTo(limit float64) data.Float

func (*StandardFloat) InRange

func (s *StandardFloat) InRange(lowerLimit float64, upperLimit float64) data.Float

func (*StandardFloat) LessThan

func (s *StandardFloat) LessThan(limit float64) data.Float

func (*StandardFloat) LessThanOrEqualTo

func (s *StandardFloat) LessThanOrEqualTo(limit float64) data.Float

func (*StandardFloat) NotEqualTo

func (s *StandardFloat) NotEqualTo(value float64) data.Float

func (*StandardFloat) NotExists

func (s *StandardFloat) NotExists() data.Float

func (*StandardFloat) NotOneOf

func (s *StandardFloat) NotOneOf(disallowedValues []float64) data.Float

func (*StandardFloat) OneOf

func (s *StandardFloat) OneOf(allowedValues []float64) data.Float

type StandardFloatAsBloodGlucoseValue

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

func NewStandardFloatAsBloodGlucoseValue

func NewStandardFloatAsBloodGlucoseValue(context data.Context, reference interface{}, floatValue *float64) *StandardFloatAsBloodGlucoseValue

func (*StandardFloatAsBloodGlucoseValue) Exists

func (*StandardFloatAsBloodGlucoseValue) InRange

func (s *StandardFloatAsBloodGlucoseValue) InRange(lowerLimit float64, upperLimit float64) data.BloodGlucoseValue

func (*StandardFloatAsBloodGlucoseValue) InRangeForUnits

func (*StandardFloatAsBloodGlucoseValue) NotExists

type StandardInteger

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

func NewStandardInteger

func NewStandardInteger(context data.Context, reference interface{}, value *int) *StandardInteger

func (*StandardInteger) EqualTo

func (s *StandardInteger) EqualTo(value int) data.Integer

func (*StandardInteger) Exists

func (s *StandardInteger) Exists() data.Integer

func (*StandardInteger) GreaterThan

func (s *StandardInteger) GreaterThan(limit int) data.Integer

func (*StandardInteger) GreaterThanOrEqualTo

func (s *StandardInteger) GreaterThanOrEqualTo(limit int) data.Integer

func (*StandardInteger) InRange

func (s *StandardInteger) InRange(lowerLimit int, upperLimit int) data.Integer

func (*StandardInteger) LessThan

func (s *StandardInteger) LessThan(limit int) data.Integer

func (*StandardInteger) LessThanOrEqualTo

func (s *StandardInteger) LessThanOrEqualTo(limit int) data.Integer

func (*StandardInteger) NotEqualTo

func (s *StandardInteger) NotEqualTo(value int) data.Integer

func (*StandardInteger) NotExists

func (s *StandardInteger) NotExists() data.Integer

func (*StandardInteger) NotOneOf

func (s *StandardInteger) NotOneOf(disallowedValues []int) data.Integer

func (*StandardInteger) OneOf

func (s *StandardInteger) OneOf(allowedValues []int) data.Integer

type StandardInterface

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

func NewStandardInterface

func NewStandardInterface(context data.Context, reference interface{}, value *interface{}) *StandardInterface

func (*StandardInterface) Exists

func (s *StandardInterface) Exists() data.Interface

func (*StandardInterface) NotExists

func (s *StandardInterface) NotExists() data.Interface

type StandardInterfaceArray

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

func NewStandardInterfaceArray

func NewStandardInterfaceArray(context data.Context, reference interface{}, value *[]interface{}) *StandardInterfaceArray

func (*StandardInterfaceArray) Empty

func (*StandardInterfaceArray) Exists

func (*StandardInterfaceArray) LengthEqualTo

func (s *StandardInterfaceArray) LengthEqualTo(limit int) data.InterfaceArray

func (*StandardInterfaceArray) LengthGreaterThan

func (s *StandardInterfaceArray) LengthGreaterThan(limit int) data.InterfaceArray

func (*StandardInterfaceArray) LengthGreaterThanOrEqualTo

func (s *StandardInterfaceArray) LengthGreaterThanOrEqualTo(limit int) data.InterfaceArray

func (*StandardInterfaceArray) LengthInRange

func (s *StandardInterfaceArray) LengthInRange(lowerLimit int, upperLimit int) data.InterfaceArray

func (*StandardInterfaceArray) LengthLessThan

func (s *StandardInterfaceArray) LengthLessThan(limit int) data.InterfaceArray

func (*StandardInterfaceArray) LengthLessThanOrEqualTo

func (s *StandardInterfaceArray) LengthLessThanOrEqualTo(limit int) data.InterfaceArray

func (*StandardInterfaceArray) LengthNotEqualTo

func (s *StandardInterfaceArray) LengthNotEqualTo(limit int) data.InterfaceArray

func (*StandardInterfaceArray) NotEmpty

func (*StandardInterfaceArray) NotExists

type StandardObject

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

func NewStandardObject

func NewStandardObject(context data.Context, reference interface{}, value *map[string]interface{}) *StandardObject

func (*StandardObject) Empty

func (s *StandardObject) Empty() data.Object

func (*StandardObject) Exists

func (s *StandardObject) Exists() data.Object

func (*StandardObject) NotEmpty

func (s *StandardObject) NotEmpty() data.Object

func (*StandardObject) NotExists

func (s *StandardObject) NotExists() data.Object

type StandardObjectArray

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

func NewStandardObjectArray

func NewStandardObjectArray(context data.Context, reference interface{}, value *[]map[string]interface{}) *StandardObjectArray

func (*StandardObjectArray) Empty

func (*StandardObjectArray) Exists

func (s *StandardObjectArray) Exists() data.ObjectArray

func (*StandardObjectArray) LengthEqualTo

func (s *StandardObjectArray) LengthEqualTo(limit int) data.ObjectArray

func (*StandardObjectArray) LengthGreaterThan

func (s *StandardObjectArray) LengthGreaterThan(limit int) data.ObjectArray

func (*StandardObjectArray) LengthGreaterThanOrEqualTo

func (s *StandardObjectArray) LengthGreaterThanOrEqualTo(limit int) data.ObjectArray

func (*StandardObjectArray) LengthInRange

func (s *StandardObjectArray) LengthInRange(lowerLimit int, upperLimit int) data.ObjectArray

func (*StandardObjectArray) LengthLessThan

func (s *StandardObjectArray) LengthLessThan(limit int) data.ObjectArray

func (*StandardObjectArray) LengthLessThanOrEqualTo

func (s *StandardObjectArray) LengthLessThanOrEqualTo(limit int) data.ObjectArray

func (*StandardObjectArray) LengthNotEqualTo

func (s *StandardObjectArray) LengthNotEqualTo(limit int) data.ObjectArray

func (*StandardObjectArray) NotEmpty

func (s *StandardObjectArray) NotEmpty() data.ObjectArray

func (*StandardObjectArray) NotExists

func (s *StandardObjectArray) NotExists() data.ObjectArray

type StandardString

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

func NewStandardString

func NewStandardString(context data.Context, reference interface{}, value *string) *StandardString

func (*StandardString) Empty

func (s *StandardString) Empty() data.String

func (*StandardString) EqualTo

func (s *StandardString) EqualTo(value string) data.String

func (*StandardString) Exists

func (s *StandardString) Exists() data.String

func (*StandardString) LengthEqualTo

func (s *StandardString) LengthEqualTo(limit int) data.String

func (*StandardString) LengthGreaterThan

func (s *StandardString) LengthGreaterThan(limit int) data.String

func (*StandardString) LengthGreaterThanOrEqualTo

func (s *StandardString) LengthGreaterThanOrEqualTo(limit int) data.String

func (*StandardString) LengthInRange

func (s *StandardString) LengthInRange(lowerLimit int, upperLimit int) data.String

func (*StandardString) LengthLessThan

func (s *StandardString) LengthLessThan(limit int) data.String

func (*StandardString) LengthLessThanOrEqualTo

func (s *StandardString) LengthLessThanOrEqualTo(limit int) data.String

func (*StandardString) LengthNotEqualTo

func (s *StandardString) LengthNotEqualTo(limit int) data.String

func (*StandardString) NotEmpty

func (s *StandardString) NotEmpty() data.String

func (*StandardString) NotEqualTo

func (s *StandardString) NotEqualTo(value string) data.String

func (*StandardString) NotExists

func (s *StandardString) NotExists() data.String

func (*StandardString) NotOneOf

func (s *StandardString) NotOneOf(disallowedValues []string) data.String

func (*StandardString) OneOf

func (s *StandardString) OneOf(allowedValues []string) data.String

type StandardStringArray

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

func NewStandardStringArray

func NewStandardStringArray(context data.Context, reference interface{}, value *[]string) *StandardStringArray

func (*StandardStringArray) EachNotOneOf

func (s *StandardStringArray) EachNotOneOf(disallowedValues []string) data.StringArray

func (*StandardStringArray) EachOneOf

func (s *StandardStringArray) EachOneOf(allowedValues []string) data.StringArray

func (*StandardStringArray) Empty

func (*StandardStringArray) Exists

func (s *StandardStringArray) Exists() data.StringArray

func (*StandardStringArray) LengthEqualTo

func (s *StandardStringArray) LengthEqualTo(limit int) data.StringArray

func (*StandardStringArray) LengthGreaterThan

func (s *StandardStringArray) LengthGreaterThan(limit int) data.StringArray

func (*StandardStringArray) LengthGreaterThanOrEqualTo

func (s *StandardStringArray) LengthGreaterThanOrEqualTo(limit int) data.StringArray

func (*StandardStringArray) LengthInRange

func (s *StandardStringArray) LengthInRange(lowerLimit int, upperLimit int) data.StringArray

func (*StandardStringArray) LengthLessThan

func (s *StandardStringArray) LengthLessThan(limit int) data.StringArray

func (*StandardStringArray) LengthLessThanOrEqualTo

func (s *StandardStringArray) LengthLessThanOrEqualTo(limit int) data.StringArray

func (*StandardStringArray) LengthNotEqualTo

func (s *StandardStringArray) LengthNotEqualTo(limit int) data.StringArray

func (*StandardStringArray) NotEmpty

func (s *StandardStringArray) NotEmpty() data.StringArray

func (*StandardStringArray) NotExists

func (s *StandardStringArray) NotExists() data.StringArray

type StandardStringAsBloodGlucoseUnits

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

func NewStandardStringAsBloodGlucoseUnits

func NewStandardStringAsBloodGlucoseUnits(context data.Context, reference interface{}, stringValue *string) *StandardStringAsBloodGlucoseUnits

func (*StandardStringAsBloodGlucoseUnits) Exists

func (*StandardStringAsBloodGlucoseUnits) NotExists

type StandardStringAsTime

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

func NewStandardStringAsTime

func NewStandardStringAsTime(context data.Context, reference interface{}, stringValue *string, timeLayout string) *StandardStringAsTime

func (*StandardStringAsTime) After

func (s *StandardStringAsTime) After(limit time.Time) data.Time

func (*StandardStringAsTime) AfterNow

func (s *StandardStringAsTime) AfterNow() data.Time

func (*StandardStringAsTime) Before

func (s *StandardStringAsTime) Before(limit time.Time) data.Time

func (*StandardStringAsTime) BeforeNow

func (s *StandardStringAsTime) BeforeNow() data.Time

func (*StandardStringAsTime) Exists

func (s *StandardStringAsTime) Exists() data.Time

func (*StandardStringAsTime) NotExists

func (s *StandardStringAsTime) NotExists() data.Time

Jump to

Keyboard shortcuts

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