Documentation ¶
Index ¶
- type Floating
- type NumericalQuantity
- type Ping
- type Quantity
- type Temperature
- func (t *Temperature) Degrees() float64
- func (t *Temperature) Fahrenheit() float64
- func (t *Temperature) Float() float64
- func (t *Temperature) FromFloat(val float64)
- func (t *Temperature) FromString(valstr string)
- func (t *Temperature) Kelvin() float64
- func (t *Temperature) MarshalJSON() (b []byte, e error)
- func (t *Temperature) String() string
- func (t *Temperature) Type() string
- func (t *Temperature) UnmarshalJSON(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Floating ¶
type Floating struct {
Val float64
}
Floating point quantity
func (*Floating) FromString ¶
FromString converts a provided numerical value as a string into a float and stores it inside t
func (*Floating) MarshalJSON ¶
func (*Floating) UnmarshalJSON ¶
type NumericalQuantity ¶
type Ping ¶
type Ping struct { HostName string IPAddr string PacketsRecv int64 PacketsSent int64 MinRtt time.Duration MaxRtt time.Duration AvgRtt time.Duration StdDevRtt time.Duration }
Ping quantity
func (*Ping) FromString ¶
FromString converts a provided numerical value as a string into a float and stores it inside t
func (*Ping) MarshalJSON ¶
func (*Ping) UnmarshalJSON ¶
type Temperature ¶
type Temperature struct {
Val float64
}
Temperature quantity
func (*Temperature) Degrees ¶
func (t *Temperature) Degrees() float64
Degrees returns the temperature value in degrees centigrate
func (*Temperature) Fahrenheit ¶
func (t *Temperature) Fahrenheit() float64
Fahrenheit returns the temperature value in fahrenheit
func (*Temperature) Float ¶
func (t *Temperature) Float() float64
Float returns the value as a float64
func (*Temperature) FromFloat ¶
func (t *Temperature) FromFloat(val float64)
FromFloat stores the provided value inside t
func (*Temperature) FromString ¶
func (t *Temperature) FromString(valstr string)
FromString converts a provided numerical value as a string into a float and stores it inside t
func (*Temperature) Kelvin ¶
func (t *Temperature) Kelvin() float64
Kelvin returns the temperature value in kelvin
func (*Temperature) MarshalJSON ¶
func (t *Temperature) MarshalJSON() (b []byte, e error)
func (*Temperature) String ¶
func (t *Temperature) String() string
String returns the value as a string
func (*Temperature) Type ¶
func (t *Temperature) Type() string
Type returns the type of the quantity
func (*Temperature) UnmarshalJSON ¶
func (t *Temperature) UnmarshalJSON(b []byte) error