utils

package
v0.0.0-...-00e1031 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TIME_LAYOUT_DEFAULT = "2006-01-02 15:04:05.000"
	TIME_LAYOUT_SECOND  = "2006-01-02-15-04-05"
	TIME_LAYOUT_DAY     = "2006-01-02"
	TIME_LOCATION       = "Asia/Shanghai"
)
View Source
const DefaultConfigType = "yaml"

Variables

This section is empty.

Functions

func CurrentDay

func CurrentDay(now time.Time) string

func CurrentDayLogFilename

func CurrentDayLogFilename(now time.Time) string

func CurrentDayLogFilepath

func CurrentDayLogFilepath(basePath, loggerName string, now time.Time) string

CurrentDayLogFilepath basePath/loggerName/day.log

func DirFileCount

func DirFileCount(dirPath string) int

func GetConfigType

func GetConfigType(confPath string) string

func IsDirExisted

func IsDirExisted(dirPath string) bool

func IsFileExisted

func IsFileExisted(filePath string) bool

func ReadLastLine

func ReadLastLine(filePath string) ([]byte, error)

func TimeStr

func TimeStr(t time.Time) string

func TimeStrLocal

func TimeStrLocal(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