helps

package
v0.0.0-...-1968fcb Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//默认时区
	DEFAULTZONE = "Asia/Shanghai"

	//LOGPATH  LOGPATH/time.Now().Format(FORMAT)/*.log
	LOGPATH = "log/"
	//FORMAT .
	FORMAT = "20060102"
	//LineFeed 换行
	LineFeed = "\r\n"
)

默认时区

Variables

This section is empty.

Functions

func CreateDir

func CreateDir(path string) error

CreateDir 文件夹创建

func ErrorLog

func ErrorLog(log map[string]interface{}, logId string, scene string, annotation string, file string)

写错误日志

func FileLog

func FileLog(level string, levelKey string, logId string, values map[string]interface{}, scene string, annotation string, file string)

写日志

func GetDateTime

func GetDateTime(timezone, format string) string

返回格式化时间

func GetTime

func GetTime(timezone string) int64

获取时间戳

func IsExist

func IsExist(f string) bool

IsExist 判断文件夹/文件是否存在 存在返回 true

func JSONToMap

func JSONToMap(s string) map[string]interface{}

JSONToMap ...

func MapToJSON

func MapToJSON(m map[string]interface{}) string

MapToJSON ...

func WriteLog

func WriteLog(fileName, msg, file string) error

WriteLog return error

Types

This section is empty.

Jump to

Keyboard shortcuts

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