utils

package
v1.0.34 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Length10Second 10位 精确到秒
	Length10Second = TimestampLength(10)
	//Length13Milli 13位 精确到毫秒(默认)
	Length13Milli = TimestampLength(13)
	//Length16Micro 16位 精确到微妙
	Length16Micro = TimestampLength(16)
	//Length19Nano 19位 精确到纳秒
	Length19Nano = TimestampLength(19)
)

Variables

This section is empty.

Functions

func BaseDir

func BaseDir() string

func DefaultRateLimit

func DefaultRateLimit() bool

func FullFilePath

func FullFilePath(fileWithPath string) string

func RateLimit

func RateLimit(l *rate.Limiter) bool

Types

type Jtime

type Jtime struct {
	Format string
	Tslen  TimestampLength
	// contains filtered or unexported fields
}

func Now

func Now() *Jtime

Now 将当前时间转为 Jtime

func TextToJtime

func TextToJtime(format, timetext string) *Jtime

TextToJtime time.Time 转为 JTime

func TimeToJtime

func TimeToJtime(tm time.Time) *Jtime

TimeToJtime time.Time 转为 JTime

func (Jtime) ToTimeText

func (j Jtime) ToTimeText() string

ToTimeText 时间 根据 format ,转为 文本输出

func (Jtime) ToTimestamp

func (j Jtime) ToTimestamp() int64

ToTimestamp 时间 转为 Timestamp 时间戳 输出

func (*Jtime) Totime

func (j *Jtime) Totime() time.Time

Totime :JTime 转为 time.Time

type TimestampLength

type TimestampLength int

TimestampLength 时间戳长度

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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