physical

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2018 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnitsHours   = "hours"
	UnitsMinutes = "minutes"
	UnitsSeconds = "seconds"

	ValueDaysMaximum    = 7
	ValueHoursMaximum   = ValueDaysMaximum * MinutesPerHour
	ValueMinutesMaximum = ValueHoursMaximum * MinutesPerHour
	ValueSecondsMaximum = ValueMinutesMaximum * SecondsPerMinute

	HoursPerDay      = 24
	MinutesPerHour   = 60
	SecondsPerMinute = 60
)
View Source
const (
	ReportedIntensityHigh   = "high"
	ReportedIntensityMedium = "medium"
	ReportedIntensityLow    = "low"
)

Variables

This section is empty.

Functions

func NewDatum

func NewDatum() data.Datum

func Type

func Type() string

Types

type Duration

type Duration struct {
	Value *float64 `json:"value,omitempty" bson:"value,omitempty"`
	Units *string  `json:"units,omitempty" bson:"units,omitempty"`
}

func NewDuration

func NewDuration() *Duration

func ParseDuration

func ParseDuration(parser data.ObjectParser) *Duration

func (*Duration) Normalize

func (d *Duration) Normalize(normalizer data.Normalizer)

func (*Duration) Parse

func (d *Duration) Parse(parser data.ObjectParser)

func (*Duration) Validate

func (d *Duration) Validate(validator data.Validator)

type Physical

type Physical struct {
	types.Base `bson:",inline"`

	ReportedIntensity *string   `json:"reportedIntensity,omitempty" bson:"reportedIntensity,omitempty"`
	Duration          *Duration `json:"duration,omitempty" bson:"duration,omitempty"`
}

func Init

func Init() *Physical

func New

func New() *Physical

func (*Physical) Init

func (p *Physical) Init()

func (*Physical) Normalize

func (p *Physical) Normalize(normalizer data.Normalizer) error

func (*Physical) Parse

func (p *Physical) Parse(parser data.ObjectParser) error

func (*Physical) Validate

func (p *Physical) Validate(validator data.Validator) error

Jump to

Keyboard shortcuts

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