Documentation
¶
Overview ¶
Package bytesize adds logic to help parse byte sizes in various forms such as gb, mb, GiB, etc.
Index ¶
- type ByteSize
- func (bs *ByteSize) Bytes() uint64
- func (bs *ByteSize) Gibibytes() uint64
- func (bs *ByteSize) Gigabytes() uint64
- func (bs *ByteSize) Mebibytetes() uint64
- func (bs *ByteSize) Megabytes() uint64
- func (bs *ByteSize) Set(in string) error
- func (bs *ByteSize) SetDefaultUnit(unit string)
- func (bs *ByteSize) String() string
- func (bs *ByteSize) Type() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteSize ¶
type ByteSize struct {
// contains filtered or unexported fields
}
ByteSize implements pflag.Value interface and is meant to be used with flags specifying a size in bytes. A value can be set before assigning to a flag to function as a default value.
func WithDefaultUnit ¶
WithDefaultUnit creates a New ByteSize with a default unit.
func (*ByteSize) Mebibytetes ¶
Mebibytetes returns the value in binary megabytes.
func (*ByteSize) SetDefaultUnit ¶
SetDefaultUnit sets the default unit to use in case one wasn't specifies.
Click to show internal directories.
Click to hide internal directories.