Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogManager ¶
type LogManager interface {
CollectLogs(ctx context.Context, serviceID string, lines int) ([]string, error)
GetLogFile(serviceID string) (io.ReadCloser, error)
RotateLogs(serviceID string) error
StreamLogs(ctx context.Context, serviceID string, tailLines int, follow bool, logChan chan<- string) error
QueryLogs(ctx context.Context, serviceID string, options LogQueryOptions) (*LogQueryResult, error)
}
LogManager 日志管理器接口
func NewLogManager ¶
NewLogManager 创建日志管理器
type LogQueryOptions ¶
type LogQueryOptions struct {
Keyword string // 搜索关键词
Level string // 日志级别过滤
StartTime *time.Time // 开始时间
EndTime *time.Time // 结束时间
Limit int // 返回的最大行数
Offset int // 偏移量
Reverse bool // 是否反向排序
}
LogQueryOptions 日志查询选项
type LogQueryResult ¶
type LogQueryResult struct {
Logs []string // 匹配的日志行
Total int // 总行数(匹配条件的)
HasMore bool // 是否还有更多结果
}
LogQueryResult 日志查询结果
Click to show internal directories.
Click to hide internal directories.