Documentation
¶
Index ¶
- Variables
- func GTimeNow() time.Time
- func GTimeNowString(layout string) string
- func GTimestamp() int64
- func GenAlarmData(code string, bs []byte) []byte
- func GenAlarmJson(code, info, more string) []byte
- func GetClockOffset() time.Duration
- func NewChanxOf[T any](maxBufferSize ...int) *chanx.UnboundedChanOf[T]
- func NewChanxWithContextOf[T any](ctx context.Context, maxBufferSize ...int) *chanx.UnboundedChanOf[T]
- func RecoverAlarm(err interface{}, trace []byte)
- func RecoverLogger(err interface{}, trace []byte)
- func Runtime() error
- func SendAlarm(code, info, more string)
- func Start() error
- func Stop() error
- type AppLogger
- type CronLogger
- type CurrentTime
- type Func
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // InternalIPv4 服务器 IP InternalIPv4 string ExternalIPv4 string )
View Source
var ( // Log 通用日志, Debug 时输出到控制台, 否则写入日志文件 Log zerolog.Logger // LogSampled 抽样日志 LogSampled zerolog.Logger // LogAlarm 报警日志, 写入通用日志并发送报警 LogAlarm zerolog.Logger )
View Source
var ( // ReqUpload HTTP 文件上传客户端 (调试模式不显示上传文件内容, 无超时时间) ReqUpload *req.Client // ReqDownload HTTP 文件下载客户端 (调试模式不显示下载文件内容, 无超时时间) ReqDownload *req.Client )
View Source
var ( // Funcs 通用函数集合, 用于远程配置获取等场景 Funcs = xsync.NewMapOf[string, Func]() )
View Source
var ( // LogChan 日志缓存队列 LogChan *chanx.UnboundedChanOf[[]byte] )
View Source
var ( // StartTime 系统启动时间 StartTime = time.Now() )
Functions ¶
func NewChanxOf ¶
func NewChanxOf[T any](maxBufferSize ...int) *chanx.UnboundedChanOf[T]
NewChanxOf 初始化无限缓冲信道
func NewChanxWithContextOf ¶
Types ¶
type AppLogger ¶
type AppLogger struct {
// contains filtered or unexported fields
}
func NewAppLogger ¶
func NewAppLogger() *AppLogger
NewAppLogger 类库日志实现: Req / Ants 注意: 受抽样日志影响, 日志可能不会被全部输出
type CronLogger ¶
type CronLogger struct {
// contains filtered or unexported fields
}
func (*CronLogger) Info ¶
func (l *CronLogger) Info(msg string, keysAndValues ...any)
Click to show internal directories.
Click to hide internal directories.