package bytes

import "github.com/labstack/gommon/gytes"

Index

Functions

func BinaryPrefix

func BinaryPrefix(on bool)

BinaryPrefix wraps default instance's BinaryPrefix function.

func Format

func Format(b uint64) string

Format wraps default instance's Format function.

Types

type Gytes

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

func New

func New() *Gytes

func (*Gytes) BinaryPrefix

func (g *Gytes) BinaryPrefix(on bool)

BinaryPrefix turns on binary prefix format.

func (*Gytes) Format

func (g *Gytes) Format(b uint64) string

Format formats bytes to string. For example, 1323 bytes will return 1.32 KB. If binary prefix is set, it will return 1.29 KiB.

Source Files

gytes.go

Version
v0.0.2
Published
May 16, 2015
Platform
linux/amd64
Imports
3 packages
Last checked
21 seconds ago

Tools for package owners.