package units
import "github.com/dotcloud/docker/pkg/units"
Index ¶
- func FromHumanSize(size string) (int64, error)
- func HumanDuration(d time.Duration) string
- func HumanSize(size int64) string
- func RAMInBytes(size string) (bytes int64, err error)
Functions ¶
func FromHumanSize ¶
FromHumanSize returns an integer from a human-readable specification of a size using SI standard (eg. "44kB", "17MB")
func HumanDuration ¶
HumanDuration returns a human-readable approximation of a duration (eg. "About a minute", "4 hours ago", etc.)
func HumanSize ¶
HumanSize returns a human-readable approximation of a size using SI standard (eg. "44kB", "17MB")
func RAMInBytes ¶
Parses a human-readable string representing an amount of RAM in bytes, kibibytes, mebibytes or gibibytes, and returns the number of bytes, or -1 if the string is unparseable. Units are case-insensitive, and the 'b' suffix is optional.
Source Files ¶
- Version
- v1.0.1
- Published
- Jun 19, 2014
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 8 minutes ago –
Tools for package owners.