dehumanize

package module
v0.0.0-...-dd404e9 Latest Latest
Warning

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

Go to latest
Published: May 13, 2015 License: MIT Imports: 2 Imported by: 0

README

dehumanize

Convert "humanized" sizes to approximate int64 sizes

Specifically written to convert elasticsearch's tendency to convert sizes to "human readable" 1.2mb style sizes.

Currently supports formats like:

1.1b 1kb 1.304mb 1.3gb 1.2tb 1.2pb

default for an "unconvertable" format is 0

Tests in goconvey

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SizeConvert

func SizeConvert(s string, base int64) (size int64)

convert a supported size from human readable to an approximate size, if the base is 0, kb = 1024 or you can specify it for your needs (eg marketing/metric kbytes of 1000bytes) this will return 0 for unconvertable values

Types

This section is empty.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/cihub/seelog
Package seelog implements logging functionality with flexible dispatching, filtering, and formatting.
Package seelog implements logging functionality with flexible dispatching, filtering, and formatting.
_workspace/src/github.com/jtolds/gls
Package gls implements goroutine-local storage.
Package gls implements goroutine-local storage.
_workspace/src/github.com/smartystreets/goconvey/convey
Package convey contains all of the public-facing entry points to this project.
Package convey contains all of the public-facing entry points to this project.
_workspace/src/github.com/smartystreets/goconvey/convey/assertions
Package assertions contains the implementations for all assertions which are referenced in the convey package for use with the So(...) method.
Package assertions contains the implementations for all assertions which are referenced in the convey package for use with the So(...) method.
_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglematchers
Package oglematchers provides a set of matchers useful in a testing or mocking framework.
Package oglematchers provides a set of matchers useful in a testing or mocking framework.
_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/createmock
createmock is used to generate source code for mock versions of interfaces from installed packages.
createmock is used to generate source code for mock versions of interfaces from installed packages.
_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate
Package generate implements code generation for mock classes.
Package generate implements code generation for mock classes.
_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/complicated_pkg
Package complicated_pkg contains an interface with lots of interesting cases, for use in integration testing.
Package complicated_pkg contains an interface with lots of interesting cases, for use in integration testing.
_workspace/src/github.com/smartystreets/goconvey/convey/assertions/oglemock/generate/test_cases/renamed_pkg
A package that calls itself something different than its package path would have you believe.
A package that calls itself something different than its package path would have you believe.
_workspace/src/github.com/smartystreets/goconvey/convey/assertions/ogletest
Package ogletest provides a framework for writing expressive unit tests.
Package ogletest provides a framework for writing expressive unit tests.
_workspace/src/github.com/smartystreets/goconvey/convey/gotest
Package gotest contains internal functionality.
Package gotest contains internal functionality.
_workspace/src/github.com/smartystreets/goconvey/convey/reporting
Package reporting contains internal functionality related to console reporting and output.
Package reporting contains internal functionality related to console reporting and output.

Jump to

Keyboard shortcuts

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