units

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(from, to string, data interface{}) interface{}

Convert .

Types

type BaseConverter

type BaseConverter struct {
	Default string
	Units   map[string]float64
}

BaseConverter .

func (*BaseConverter) Convert

func (c *BaseConverter) Convert(from, to string, value float64) (float64, bool)

Convert .

func (*BaseConverter) Valid

func (c *BaseConverter) Valid(unit string) bool

Valid .

type ByteConverter

type ByteConverter struct {
	BaseConverter
}

ByteConverter .

type Converter

type Converter interface {
	Valid(unit string) bool
	Convert(from, to string, value float64) (float64, bool)
}

Converter .

type TimeConverter

type TimeConverter struct {
	BaseConverter
}

TimeConverter .

Jump to

Keyboard shortcuts

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