cockroach: github.com/cockroachdb/cockroach/pkg/util/humanizeutil Index | Files

package humanizeutil

import "github.com/cockroachdb/cockroach/pkg/util/humanizeutil"

Index

Package Files

humanize.go

func DataRate Uses

func DataRate(bytes int64, elapsed time.Duration) string

DataRate formats the passed byte count over duration as "x MiB/s".

func IBytes Uses

func IBytes(value int64) string

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

func ParseBytes Uses

func ParseBytes(s string) (int64, error)

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

type BytesValue Uses

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 Uses

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 Uses

func (b *BytesValue) IsSet() bool

IsSet returns true iff Set has successfully been called.

func (*BytesValue) Set Uses

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

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

func (*BytesValue) String Uses

func (b *BytesValue) String() string

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

func (*BytesValue) Type Uses

func (b *BytesValue) Type() string

Type implements the pflag.Value interface.

Package humanizeutil imports 7 packages (graph) and is imported by 56 packages. Updated 2019-07-12. Refresh now. Tools for package owners.