data

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: GPL-2.0 Imports: 2 Imported by: 0

README

Data: Common data unit functions

This is early stages and provides minimum functionality.

License

GPL2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Amount

type Amount interface {
	InclusiveBytes() ByteSize
	Value() float64
	To(ByteSize) float64
	fmt.Stringer
}

type Byte

type Byte struct {
	// contains filtered or unexported fields
}

func NewByte

func NewByte(b ByteSize) Byte

func (Byte) InclusiveBytes added in v0.2.0

func (b Byte) InclusiveBytes() ByteSize

func (Byte) String

func (b Byte) String() string

func (Byte) To

func (b Byte) To(base ByteSize) float64

func (Byte) Value

func (b Byte) Value() float64

type ByteSize

type ByteSize int64
const (
	B            = iota + 1
	KiB ByteSize = 1 << (10 * iota)
	MiB
	GiB
	TiB
	PiB
	EiB
)

type KibiByte

type KibiByte struct {
	// contains filtered or unexported fields
}

func NewKibiByte

func NewKibiByte(b ByteSize) KibiByte

func (KibiByte) InclusiveBytes added in v0.2.0

func (k KibiByte) InclusiveBytes() ByteSize

func (KibiByte) String

func (k KibiByte) String() string

func (KibiByte) To

func (k KibiByte) To(base ByteSize) float64

func (KibiByte) Value

func (k KibiByte) Value() float64

Jump to

Keyboard shortcuts

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