Documentation
¶
Index ¶
- Variables
- func CheckPortAvailable(port int) bool
- func GetFormatTime() string
- func GetNanoTimeStamp() int64
- func GetTimeStamp() int64
- func GetTimeStampFloat64() float64
- func GetUUID() string
- func PrintGoroutineStack()
- func SetJsonCoder(j jsonCoder)
- func SetLogger(l LogInterface)
- type DefaultJson
- type Log
- type LogInterface
- type Ticker
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LogLevelInfo = 1 << 0 LogLevelError = LogLevelInfo | (1 << 1) LogLevelWarning = LogLevelError | (1 << 2) LogLevelDebug = LogLevelWarning | (1 << 3) )
LogLevel 日志等级
View Source
var ( Reset = "\033[0m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" )
各种颜色
View Source
var Json jsonCoder
Json 使用的解析器 使用字节的sonic库 由于只支持amd64, 所以提供了修改的方法
Functions ¶
func GetTimeStampFloat64 ¶
func GetTimeStampFloat64() float64
GetTimeStampFloat64 获取当前时间戳
https://12.onebot.dev/connect/data-protocol/event/ 要求的Time为float64
func PrintGoroutineStack ¶
func PrintGoroutineStack()
Types ¶
type DefaultJson ¶
type DefaultJson struct { }
func (*DefaultJson) Marshal ¶
func (d *DefaultJson) Marshal(v interface{}) ([]byte, error)
Marshal 默认解析器编码
func (*DefaultJson) Unmarshal ¶
func (d *DefaultJson) Unmarshal(data []byte, v interface{}) error
Unmarshal 默认解析器解码
type LogInterface ¶
type LogInterface interface { Println(string) Info(string) Warning(string) Error(string) Debug(string) SetLogLevel(int) }
LogInterface 日志接口
var Logger LogInterface
Logger log的接口
type Ticker ¶
type Ticker struct {
// contains filtered or unexported fields
}
Ticker 计时器
func (*Ticker) GetDurationString ¶
GetDurationString 获取计时器的时间 字符串 包含单位
Click to show internal directories.
Click to hide internal directories.