measurement

package
v1.0.28 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ImperialLengthUnits = imperialLengthUnits{
	Twip:         ImperialLengthUnit("twip"),
	Thou:         ImperialLengthUnit("thou"),
	Barleycorn:   ImperialLengthUnit("barleycorn"),
	Inch:         ImperialLengthUnit("inch"),
	Hand:         ImperialLengthUnit("hand"),
	Foot:         ImperialLengthUnit("foot"),
	Yard:         ImperialLengthUnit("yard"),
	Chain:        ImperialLengthUnit("chain"),
	Furlong:      ImperialLengthUnit("furlong"),
	Mile:         ImperialLengthUnit("mile"),
	League:       ImperialLengthUnit("league"),
	Fathom:       ImperialLengthUnit("fathom"),
	Cable:        ImperialLengthUnit("cable"),
	NauticalMile: ImperialLengthUnit("nautical-mile"),
	Link:         ImperialLengthUnit("link"),
	Rod:          ImperialLengthUnit("rod"),
	Err:          fmt.Errorf("invalid ImperialLengthUnit"),
}
View Source
var MeasurementFormatTypes = measurementFormatTypes{
	Full:         MeasurementFormatType("full"),
	Abbreviation: MeasurementFormatType("abbreviation"),
	Err:          fmt.Errorf("invalid MeasurementFormatType"),
}
View Source
var MeasurementSystems = measurementSystems{
	Metric:   MeasurementSystem("metric"),
	Imperial: MeasurementSystem("imperial"),
	Err:      fmt.Errorf("invalid MeasurementSystem"),
}
View Source
var MetricUnits = metricUnits{
	Tera:  MetricUnit("tera"),
	Giga:  MetricUnit("giga"),
	Mega:  MetricUnit("mega"),
	Kilo:  MetricUnit("kilo"),
	Hecto: MetricUnit("hecto"),
	Deca:  MetricUnit("deca"),
	Unit:  MetricUnit("unit"),
	Deci:  MetricUnit("deci"),
	Centi: MetricUnit("centi"),
	Milli: MetricUnit("milli"),
	Micro: MetricUnit("micro"),
	Nano:  MetricUnit("nano"),
	Pico:  MetricUnit("pico"),
	Err:   fmt.Errorf("invalid MetricUnit"),
}

Functions

This section is empty.

Types

type Dimensions

type Dimensions struct {
	Width    Length `json:"width,omitempty"`
	Heigth   Length `json:"heigth,omitempty"`
	Depth    Length `json:"depth,omitempty"`
	Length   Length `json:"length,omitempty"`
	Radius   Length `json:"radius,omitempty"`
	Diameter Length `json:"diameter,omitempty"`
}

type Electrical

type Electrical struct {
	Capacity string `json:"capacity,omitempty"`
	Voltage  string `json:"voltage,omitempty"`
	Amp      string `json:"amp,omitempty"`
}

type ImperialLengthUnit

type ImperialLengthUnit string

func (ImperialLengthUnit) MarshalJSON

func (t ImperialLengthUnit) MarshalJSON() ([]byte, error)

func (ImperialLengthUnit) MarshalYAML

func (t ImperialLengthUnit) MarshalYAML() (interface{}, error)

func (*ImperialLengthUnit) Scan

func (t *ImperialLengthUnit) Scan(value interface{}) error

func (ImperialLengthUnit) String

func (t ImperialLengthUnit) String() string

func (*ImperialLengthUnit) UnmarshalJSON

func (t *ImperialLengthUnit) UnmarshalJSON(data []byte) error

func (*ImperialLengthUnit) UnmarshalYAML

func (t *ImperialLengthUnit) UnmarshalYAML(unmarshal func(interface{}) error) error

func (ImperialLengthUnit) Value

func (t ImperialLengthUnit) Value() (driver.Value, error)

type Length

type Length struct {
	Unit   rational.Rational     `json:"unit,omitempty"`
	System MeasurementSystem     `json:"system,omitempty"`
	Format MeasurementFormatType `json:"format,omitempty"`
}

func Parse

func Parse(s string) (Length, error)

func (Length) Imperial

func (t Length) Imperial() Length

func (Length) Metric

func (t Length) Metric() Length

type MeasurementFormatType

type MeasurementFormatType string

func (MeasurementFormatType) MarshalJSON

func (t MeasurementFormatType) MarshalJSON() ([]byte, error)

func (MeasurementFormatType) MarshalYAML

func (t MeasurementFormatType) MarshalYAML() (interface{}, error)

func (*MeasurementFormatType) Scan

func (t *MeasurementFormatType) Scan(value interface{}) error

func (MeasurementFormatType) String

func (t MeasurementFormatType) String() string

func (*MeasurementFormatType) UnmarshalJSON

func (t *MeasurementFormatType) UnmarshalJSON(data []byte) error

func (*MeasurementFormatType) UnmarshalYAML

func (t *MeasurementFormatType) UnmarshalYAML(unmarshal func(interface{}) error) error

func (MeasurementFormatType) Value

func (t MeasurementFormatType) Value() (driver.Value, error)

type MeasurementSystem

type MeasurementSystem string

func (MeasurementSystem) MarshalJSON

func (t MeasurementSystem) MarshalJSON() ([]byte, error)

func (MeasurementSystem) MarshalYAML

func (t MeasurementSystem) MarshalYAML() (interface{}, error)

func (*MeasurementSystem) Scan

func (t *MeasurementSystem) Scan(value interface{}) error

func (MeasurementSystem) String

func (t MeasurementSystem) String() string

func (*MeasurementSystem) UnmarshalJSON

func (t *MeasurementSystem) UnmarshalJSON(data []byte) error

func (*MeasurementSystem) UnmarshalYAML

func (t *MeasurementSystem) UnmarshalYAML(unmarshal func(interface{}) error) error

func (MeasurementSystem) Value

func (t MeasurementSystem) Value() (driver.Value, error)

type MetricUnit

type MetricUnit string

func (MetricUnit) MarshalJSON

func (t MetricUnit) MarshalJSON() ([]byte, error)

func (MetricUnit) MarshalYAML

func (t MetricUnit) MarshalYAML() (interface{}, error)

func (*MetricUnit) Scan

func (t *MetricUnit) Scan(value interface{}) error

func (MetricUnit) String

func (t MetricUnit) String() string

func (*MetricUnit) UnmarshalJSON

func (t *MetricUnit) UnmarshalJSON(data []byte) error

func (*MetricUnit) UnmarshalYAML

func (t *MetricUnit) UnmarshalYAML(unmarshal func(interface{}) error) error

func (MetricUnit) Value

func (t MetricUnit) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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