bytesize

package
v0.0.0-...-71fc4e6 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2015 License: MIT Imports: 5 Imported by: 7

Documentation

Index

Constants

View Source
const (
	B = 1 << (10 * iota)
	KB
	MB
	GB
	TB
	PB
)

Variables

View Source
var (
	ErrBadBytesize     = errors.New("invalid byte size")
	ErrBadBytesizeUnit = errors.New("invalid byte size unit")
)
View Source
var (
	BytesizeRegexp = regexp.MustCompile(`(?i)^\s*(\-?[\d\.]+)\s*([KMGTP]?B|[BKMGTP]|)\s*$`)
)

Functions

func MustParse

func MustParse(s string) int64

func Parse

func Parse(s string) (int64, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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