Documentation ¶
Index ¶
- Constants
- func Acquire4KBuffer() []byte
- func AcquireBuffer() *bytes.Buffer
- func FormatBytes(bytes uint64) string
- func FromString(s string) []byte
- func NewReadCloser(p []byte) io.ReadCloser
- func ParseBytes(s string) (uint64, error)
- func Release4KBuffer(buf []byte)
- func ReleaseBuffer(buf *bytes.Buffer)
- func ToString(p []byte) string
- type ReadCloser
Constants ¶
View Source
const ( BYTE = 1 << (10 * iota) KILOBYTE MEGABYTE GIGABYTE TERABYTE PETABYTE EXABYTE )
Variables ¶
This section is empty.
Functions ¶
func Acquire4KBuffer ¶ added in v1.1.0
func Acquire4KBuffer() []byte
func AcquireBuffer ¶ added in v1.1.3
func FormatBytes ¶ added in v1.0.10
FormatBytes returns a human-readable byte string of the form 10M, 12.5K, and so forth. The following units are available:
E: Exabyte P: Petabyte T: Terabyte G: Gigabyte M: Megabyte K: Kilobyte B: Byte
The unit that results in the smallest number greater than or equal to 1 is always chosen.
func FromString ¶
func NewReadCloser ¶ added in v1.1.0
func NewReadCloser(p []byte) io.ReadCloser
func ParseBytes ¶ added in v1.0.10
ParseBytes parses a string formatted by FormatBytes as bytes. Note binary-prefixed and SI prefixed units both mean a base-2 units KB = K = KiB = 1024 MB = M = MiB = 1024 * K GB = G = GiB = 1024 * M TB = T = TiB = 1024 * G PB = P = PiB = 1024 * T EB = E = EiB = 1024 * P
func Release4KBuffer ¶ added in v1.1.0
func Release4KBuffer(buf []byte)
func ReleaseBuffer ¶ added in v1.1.3
Types ¶
type ReadCloser ¶ added in v1.1.0
func (*ReadCloser) Close ¶ added in v1.1.0
func (r *ReadCloser) Close() error
Click to show internal directories.
Click to hide internal directories.