iorate

package
v0.0.0-...-1b8e598 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateHumanize

func GenerateHumanize(sz, base float64, units []string) string

GenerateHumanize generates custom humanization routines.

func HumanizeBinary

func HumanizeBinary(sz float64) string

HumanizeBinary formats sz to a human-readable IEC bytes (2^10).

func HumanizeBytes

func HumanizeBytes(sz float64) string

HumanizeBytes formats sz to a human-readable SI bytes (10^3).

Types

type Rate

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

func New

func New() *Rate

func (*Rate) Add

func (r *Rate) Add(n int)

func (*Rate) Calculate

func (r *Rate) Calculate(per time.Duration) float64

Jump to

Keyboard shortcuts

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