units

package
v0.0.1-rc11 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

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