utils

package
v0.0.0-...-b86a68b Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B  = 1
	KB = B << 10
	MB = KB << 10
	GB = MB << 10
	TB = GB << 10
	PB = TB << 10
	EB = PB << 10
)
View Source
const (
	// 默认格式化为 Y-M-D h:m:s 的模板,死变态老把时间模板设置到这个时间点格式
	DEF_TIME_FORMAT     = "2006-01-02 15:04:05"
	TIME_FORMAT_YMD     = "20060102"   // 时间格式:20140725
	TIME_FORMAT_YYYMMDD = "2006-01-02" // 时间格式:2014-07-25
)

Variables

This section is empty.

Functions

func Fatal

func Fatal(msg string, err error)

func SecTimeHuman

func SecTimeHuman(sec uint64) (human string)

秒时间格式化为可视字符串显示【110 Days 10:20:30】

func TimeFormat

func TimeFormat(t time.Time, fmt string) string

把时间 time.Time 格式化【格式错误返回的信息也是不对版的】

Types

type ByteSize

type ByteSize uint64

func (ByteSize) Format

func (b ByteSize) Format() string

func (ByteSize) SetFormat

func (b ByteSize) SetFormat(i int) ByteSize

func (ByteSize) Setunit

func (b ByteSize) Setunit(_unit bool) ByteSize

func (ByteSize) String

func (b ByteSize) String() string

func (ByteSize) StringFormat

func (b ByteSize) StringFormat() string

func (ByteSize) Unit

func (b ByteSize) Unit() string

Jump to

Keyboard shortcuts

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