data

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2016 License: BSD-3-Clause Imports: 3 Imported by: 50

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayParser

type ArrayParser interface {
	Logger() log.Logger

	SetMeta(meta interface{})

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

	Array() *[]interface{}

	ParseBoolean(index int) *bool
	ParseInteger(index int) *int
	ParseFloat(index int) *float64
	ParseString(index int) *string
	ParseStringArray(index int) *[]string
	ParseObject(index int) *map[string]interface{}
	ParseObjectArray(index int) *[]map[string]interface{}
	ParseInterface(index int) *interface{}
	ParseInterfaceArray(index int) *[]interface{}
	ParseDatum(index int) *Datum
	ParseDatumArray(index int) *[]Datum

	ProcessNotParsed()

	NewChildObjectParser(index int) ObjectParser
	NewChildArrayParser(index int) ArrayParser
}

type BloodGlucoseNormalizer

type BloodGlucoseNormalizer interface {
	Units() *string
	Value(value *float64) *float64
	UnitsAndValue(value *float64) (*string, *float64)
}

type BloodGlucoseUnits

type BloodGlucoseUnits interface {
	Exists() BloodGlucoseUnits
	NotExists() BloodGlucoseUnits
}

type BloodGlucoseValue

type BloodGlucoseValue interface {
	Exists() BloodGlucoseValue
	NotExists() BloodGlucoseValue

	InRange(lowerLimit float64, upperLimit float64) BloodGlucoseValue
	InRangeForUnits(units *string) BloodGlucoseValue
}

type Boolean

type Boolean interface {
	Exists() Boolean
	NotExists() Boolean

	True() Boolean
	False() Boolean
}

type Context

type Context interface {
	Logger() log.Logger

	SetMeta(meta interface{})

	ResolveReference(reference interface{}) string

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

	NewChildContext(reference interface{}) Context
}

type Datum

type Datum interface {
	Init()

	Meta() interface{}

	Parse(parser ObjectParser) error
	Validate(validator Validator) error
	Normalize(normalizer Normalizer) error

	SetUserID(userID string)
	SetGroupID(groupID string)
	SetDatasetID(datasetID string)
	SetActive(active bool)
}

type Factory

type Factory interface {
	New(inspector Inspector) (Datum, error)
	Init(inspector Inspector) (Datum, error)
}

type Float

type Float interface {
	Exists() Float
	NotExists() Float

	EqualTo(value float64) Float
	NotEqualTo(value float64) Float

	LessThan(limit float64) Float
	LessThanOrEqualTo(limit float64) Float
	GreaterThan(limit float64) Float
	GreaterThanOrEqualTo(limit float64) Float
	InRange(lowerLimit float64, upperLimit float64) Float

	OneOf(allowedValues []float64) Float
	NotOneOf(disallowedValues []float64) Float
}

type Inspector

type Inspector interface {
	GetProperty(key string) *string
	NewMissingPropertyError(key string) error
	NewInvalidPropertyError(key string, value string, allowedValues []string) error
}

type Integer

type Integer interface {
	Exists() Integer
	NotExists() Integer

	EqualTo(value int) Integer
	NotEqualTo(value int) Integer

	LessThan(limit int) Integer
	LessThanOrEqualTo(limit int) Integer
	GreaterThan(limit int) Integer
	GreaterThanOrEqualTo(limit int) Integer
	InRange(lowerLimit int, upperLimit int) Integer

	OneOf(allowedValues []int) Integer
	NotOneOf(disallowedValues []int) Integer
}

type Interface

type Interface interface {
	Exists() Interface
	NotExists() Interface
}

type InterfaceArray

type InterfaceArray interface {
	Exists() InterfaceArray
	NotExists() InterfaceArray

	Empty() InterfaceArray
	NotEmpty() InterfaceArray

	LengthEqualTo(limit int) InterfaceArray
	LengthNotEqualTo(limit int) InterfaceArray
	LengthLessThan(limit int) InterfaceArray
	LengthLessThanOrEqualTo(limit int) InterfaceArray
	LengthGreaterThan(limit int) InterfaceArray
	LengthGreaterThanOrEqualTo(limit int) InterfaceArray
	LengthInRange(lowerLimit int, upperLimit int) InterfaceArray
}

type Normalizer

type Normalizer interface {
	Logger() log.Logger

	SetMeta(meta interface{})

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

	AppendDatum(datum Datum)

	NormalizeBloodGlucose(units *string) BloodGlucoseNormalizer

	NewChildNormalizer(reference interface{}) Normalizer
}

type Object

type Object interface {
	Exists() Object
	NotExists() Object

	Empty() Object
	NotEmpty() Object
}

type ObjectArray

type ObjectArray interface {
	Exists() ObjectArray
	NotExists() ObjectArray

	Empty() ObjectArray
	NotEmpty() ObjectArray

	LengthEqualTo(limit int) ObjectArray
	LengthNotEqualTo(limit int) ObjectArray
	LengthLessThan(limit int) ObjectArray
	LengthLessThanOrEqualTo(limit int) ObjectArray
	LengthGreaterThan(limit int) ObjectArray
	LengthGreaterThanOrEqualTo(limit int) ObjectArray
	LengthInRange(lowerLimit int, upperLimit int) ObjectArray
}

type ObjectParser

type ObjectParser interface {
	Logger() log.Logger

	SetMeta(meta interface{})

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

	Object() *map[string]interface{}

	ParseBoolean(key string) *bool
	ParseInteger(key string) *int
	ParseFloat(key string) *float64
	ParseString(key string) *string
	ParseStringArray(key string) *[]string
	ParseObject(key string) *map[string]interface{}
	ParseObjectArray(key string) *[]map[string]interface{}
	ParseInterface(key string) *interface{}
	ParseInterfaceArray(key string) *[]interface{}
	ParseDatum(key string) *Datum
	ParseDatumArray(key string) *[]Datum

	ProcessNotParsed()

	NewChildObjectParser(key string) ObjectParser
	NewChildArrayParser(key string) ArrayParser
}

type String

type String interface {
	Exists() String
	NotExists() String

	Empty() String
	NotEmpty() String

	EqualTo(value string) String
	NotEqualTo(value string) String

	LengthEqualTo(limit int) String
	LengthNotEqualTo(limit int) String
	LengthLessThan(limit int) String
	LengthLessThanOrEqualTo(limit int) String
	LengthGreaterThan(limit int) String
	LengthGreaterThanOrEqualTo(limit int) String
	LengthInRange(lowerLimit int, upperLimit int) String

	OneOf(allowedValues []string) String
	NotOneOf(disallowedValues []string) String
}

type StringArray

type StringArray interface {
	Exists() StringArray
	NotExists() StringArray

	Empty() StringArray
	NotEmpty() StringArray

	LengthEqualTo(limit int) StringArray
	LengthNotEqualTo(limit int) StringArray
	LengthLessThan(limit int) StringArray
	LengthLessThanOrEqualTo(limit int) StringArray
	LengthGreaterThan(limit int) StringArray
	LengthGreaterThanOrEqualTo(limit int) StringArray
	LengthInRange(lowerLimit int, upperLimit int) StringArray

	EachOneOf(allowedValues []string) StringArray
	EachNotOneOf(disallowedValues []string) StringArray
}

type Time

type Time interface {
	Exists() Time
	NotExists() Time

	After(limit time.Time) Time
	AfterNow() Time
	Before(limit time.Time) Time
	BeforeNow() Time
}

type Validator

type Validator interface {
	Logger() log.Logger

	SetMeta(meta interface{})

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

	ValidateBoolean(reference interface{}, value *bool) Boolean
	ValidateInteger(reference interface{}, value *int) Integer
	ValidateFloat(reference interface{}, value *float64) Float
	ValidateString(reference interface{}, value *string) String
	ValidateStringArray(reference interface{}, value *[]string) StringArray
	ValidateObject(reference interface{}, value *map[string]interface{}) Object
	ValidateObjectArray(reference interface{}, value *[]map[string]interface{}) ObjectArray
	ValidateInterface(reference interface{}, value *interface{}) Interface
	ValidateInterfaceArray(reference interface{}, value *[]interface{}) InterfaceArray

	ValidateStringAsTime(reference interface{}, stringValue *string, timeLayout string) Time

	ValidateStringAsBloodGlucoseUnits(reference interface{}, stringValue *string) BloodGlucoseUnits
	ValidateFloatAsBloodGlucoseValue(reference interface{}, floatValue *float64) BloodGlucoseValue

	NewChildValidator(reference interface{}) Validator
}

Jump to

Keyboard shortcuts

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