units

package
v0.0.0-...-8da4130 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidFloatWithUnit = errors.New("invalid float value with optional unit")
)

Functions

func UnmarshalFloatWithUnits

func UnmarshalFloatWithUnits(data []byte, units ...string) (float64, error)

Types

type Decibel

type Decibel float64

Decibel (dB) is a relative unit of measurement equal to one tenth of a bel (B).

https://en.wikipedia.org/wiki/Decibel

func (*Decibel) UnmarshalText

func (t *Decibel) UnmarshalText(data []byte) error

type DecibelMilliwatt

type DecibelMilliwatt float64

DecibelMilliwatt (dBm) is a unit of level used to indicate that a power level is expressed in decibels (dB) with reference to one milliwatt (mW).

https://en.wikipedia.org/wiki/DBm

func (*DecibelMilliwatt) UnmarshalText

func (t *DecibelMilliwatt) UnmarshalText(data []byte) error

type Mbps

type Mbps float64

Mbps is Megabits per second.

https://en.wikipedia.org/wiki/Data-rate_units#Megabit_per_second

func (Mbps) BitsPerSec

func (t Mbps) BitsPerSec() float64

func (*Mbps) UnmarshalText

func (t *Mbps) UnmarshalText(data []byte) error

Jump to

Keyboard shortcuts

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