unit

package
v0.0.0-...-8845ca5 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: AGPL-3.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Byte = 1
	KB   = 1024 * Byte
	MB   = 1024 * KB
	GB   = 1024 * MB
	TB   = 1024 * GB
	PB   = 1024 * TB
	EB   = 1024 * PB
)
View Source
const (
	Bit = 8 * Byte
	Kb  = 1024 * Bit
	Mb  = 1024 * Kb
	Gb  = 1024 * Mb
	Tb  = 1024 * Gb
	Pb  = 1024 * Tb
	Eb  = 1024 * Pb
)

Variables

This section is empty.

Functions

func DurationMinuteSecond

func DurationMinuteSecond(t time.Duration) string

func DurationMonthDayHour

func DurationMonthDayHour(t time.Duration) string

func DurationYearMonthDay

func DurationYearMonthDay(t time.Duration) string

func DurationYearMonthDayHourMinuteSecond

func DurationYearMonthDayHourMinuteSecond(t time.Duration) string

func Format2B

func Format2B(fileSize int64) string

func Format2Bs

func Format2Bs(speed float64) string

func Format2b

func Format2b(fileSize int64) string

func Format2bps

func Format2bps(speed float64) string

func FormatSize

func FormatSize(fileSize int64) string

func FormatSpeed

func FormatSpeed(speed float64) string

func FormatSpeedWithUnit

func FormatSpeedWithUnit(speed float64) (string, string)

func TimeYearMonthDayHourMinute

func TimeYearMonthDayHourMinute(t time.Time) string

func TimeYearMonthDayHourMinuteSecond

func TimeYearMonthDayHourMinuteSecond(t time.Time) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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