units

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNegativeValue = fmt.Errorf("units: negative value not allowed")
	ErrOverflow      = fmt.Errorf("units: overflow")
	ErrInvalidFormat = fmt.Errorf("units: invalid format")
	ErrInvalidSuffix = fmt.Errorf("units: invalid suffix")
)

Functions

func ParseWithSuffix

func ParseWithSuffix(sval string) (uint64, error)

func ToStringWithSuffix

func ToStringWithSuffix(val uint64, suffix string) string

Types

type ByteQuantity

type ByteQuantity uint64

func ByteQuantityFromString

func ByteQuantityFromString(sval string) (ByteQuantity, error)

func (*ByteQuantity) StringWithSuffix

func (u *ByteQuantity) StringWithSuffix(suffix string) string

func (*ByteQuantity) UnmarshalYAML

func (u *ByteQuantity) UnmarshalYAML(node *yaml.Node) error

type MemoryQuantity

type MemoryQuantity uint64

func MemoryQuantityFromString

func MemoryQuantityFromString(sval string) (MemoryQuantity, error)

func (*MemoryQuantity) StringWithSuffix

func (u *MemoryQuantity) StringWithSuffix(suffix string) string

func (*MemoryQuantity) UnmarshalYAML

func (u *MemoryQuantity) UnmarshalYAML(node *yaml.Node) error

Jump to

Keyboard shortcuts

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