internal

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorLog logs.FieldLogger = &logs.Logger{
	Out:   os.Stdout,
	Hooks: make(logs.LevelHooks),
	Formatter: &logs.TextFormatter{
		ForceColors:      true,
		FullTimestamp:    true,
		TimestampFormat:  "01-02 15:04:05",
		QuoteEmptyFields: false,
		CallerPrettifier: nil,
		HideLevelText:    true,
	},
	ReportCaller: true,
	Level:        logs.DebugLevel,
}
View Source
var Log logs.FieldLogger = &logs.Logger{
	Out:   os.Stdout,
	Hooks: make(logs.LevelHooks),
	Formatter: &logs.TextFormatter{
		ForceColors:      true,
		FullTimestamp:    true,
		TimestampFormat:  "01-02 15:04:05",
		QuoteEmptyFields: false,
		CallerPrettifier: nil,
		HideLevelText:    true,
	},
	ReportCaller: false,
	Level:        logs.DebugLevel,
}

Functions

func BuildDir

func BuildDir(absDir string) error

BuildDir 创建目录

func FileIsExist

func FileIsExist(filename string) bool

FileIsExist 检查目录是否存在

func FindTag

func FindTag(obj interface{}, field, tag string) string

FindTag find struct of tag string.查找struct 的tag信息

func GetCommentAfterPrefixRegex

func GetCommentAfterPrefixRegex(fullComment string, name string) (prefix string, comment string, b bool)

GetCommentAfterPrefixRegex 解析注释 分离前缀和注释内容

func GetKvType

func GetKvType(k string, isArray, isType bool) string

GetKvType 获取类型转换

func GetMod

func GetMod(fileName string) string

func GetPathDirs

func GetPathDirs(absDir string) (re []string)

GetPathDirs 获取目录所有文件夹

func GetTimeWeek

func GetTimeWeek(timestamp int64) int

GetTimeWeek 获取给定时间的星期

func IsInternalType

func IsInternalType(t string) bool

IsInternalType 是否是内部类型

func OpenBrowser

func OpenBrowser(uri string) error

OpenBrowser Open calls the OS default program for uri

func ReadFile

func ReadFile(fname string) []byte

ReadFile 读取文件

func StrToTime

func StrToTime(tStr, format string, timeZone *time.Location) time.Time

StrToTime 字符串转时间

func WriteFile

func WriteFile(fname string, src []byte, isClear bool) bool

WriteFile 写入文件

Types

type Time

type Time struct {
	time.Time
}

Time json marsh 重写

func (*Time) MarshalJSON

func (t *Time) MarshalJSON() ([]byte, error)

MarshalJSON ...

func (*Time) String

func (t *Time) String() string

String ...

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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