humanizeutil

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2018 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

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

This section is empty.

Functions

func IBytes

func IBytes(value int64) string

IBytes is an int64 version of go-humanize's IBytes.

func ParseBytes

func ParseBytes(s string) (int64, error)

ParseBytes is an int64 version of go-humanize's ParseBytes.

Types

type BytesValue

type BytesValue struct {
	// contains filtered or unexported fields
}

BytesValue is a struct that implements flag.Value and pflag.Value suitable to create command-line parameters that accept sizes specified using a format recognized by humanize. The value is written atomically, so that it is safe to use this struct to make a parameter configurable that is used by an asynchronous process spawned before command-line argument handling. This is useful e.g. for the log file settings which are used by the asynchronous log file GC daemon.

func NewBytesValue

func NewBytesValue(val *int64) *BytesValue

NewBytesValue creates a new pflag.Value bound to the specified int64 variable. It also happens to be a flag.Value.

func (*BytesValue) IsSet added in v1.1.0

func (b *BytesValue) IsSet() bool

IsSet returns true iff Set has successfully been called.

func (*BytesValue) Set

func (b *BytesValue) Set(s string) error

Set implements the flag.Value and pflag.Value interfaces.

func (*BytesValue) String

func (b *BytesValue) String() string

String implements the flag.Value and pflag.Value interfaces.

func (*BytesValue) Type

func (b *BytesValue) Type() string

Type implements the pflag.Value interface.

Jump to

Keyboard shortcuts

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