Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NoExpire = base.Datetime2TimeObj("9999-12-31 23:59:59") // 不过期
)
Functions ¶
Types ¶
type FileInfo ¶
type FileInfo struct { Handler *Handler // 这里优先 PsLog.handler Dir string // 文件目录 Name string // 文件名 // contains filtered or unexported fields }
func (*FileInfo) CleanNameFmt ¶
CleanNameFmt 清理 Name 中的格式, 如: test.log => test
type Handler ¶
type Handler struct { Tail bool // 是否实时处理, 说明: true 为实时; false 需要外部定时调用 Change int32 // 文件 offset 变化次数, 为持久化文件偏移量数阈值, 当, 说明: -1 为实时保存; 0 达到默认值 defaultHandleChange 时保存; 其他 大于后会保存 ExpireAt time.Time // 文件句柄过期时间, 如: 2022-12-03 11:11:10 Targets []*Target // 目标 msg // contains filtered or unexported fields }
Handler 处理的部分
type PsLog ¶
type PsLog struct {
// contains filtered or unexported fields
}
PsLog 解析 log
func (*PsLog) AddPath2HandlerMap ¶
AddPath2HandlerMap 添加文件对应的处理方法 只会根据文件对应的 Handler 进行处理
type Target ¶
type Target struct { Content string // 目标内容 Excludes []string // 排除 msg To []io.Writer // 处理 // contains filtered or unexported fields }
Target 目标内容
type Watch ¶
type Watch struct {
// contains filtered or unexported fields
}
Watch 监听的文件
type WatchFileInfo ¶
type WatchFileInfo struct { IsDir bool // 是否为目录 Path string // 原始添加的文件路径, 这里可能是文件路径或目录路径 WatchFilePath string // 监听到的变化的文件全路径 }
WatchFileInfo
Source Files
¶
Click to show internal directories.
Click to hide internal directories.