Documentation ¶
Index ¶
- Constants
- func IsEnd(line string) bool
- type HostLogger
- type Manager
- func (s *Manager) CreateHostLogger(taskId int64, host string) (*HostLogger, error)
- func (s *Manager) CreateManifestLogger(taskId int64) (*ManifestLogger, error)
- func (s *Manager) OpenHostLogger(taskId int64, host string, hostLogName string) (*HostLogger, error)
- func (s *Manager) OpenLatestManifestLogger(taskId int64) (*ManifestLogger, error)
- func (s *Manager) RemoveLogs(taskId int64)
- func (s *Manager) RemoveOldLogs(taskId int64, remainHistoryCount int)
- type ManifestEntry
- type ManifestLogger
Constants ¶
View Source
const EndFlag = "-[EOF]-"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HostLogger ¶
type HostLogger struct {
// contains filtered or unexported fields
}
func NewHostLogger ¶
func NewHostLogger(file *os.File) *HostLogger
func (*HostLogger) Append ¶
func (s *HostLogger) Append(lineContent string)
func (*HostLogger) Close ¶
func (s *HostLogger) Close()
func (*HostLogger) GetName ¶
func (s *HostLogger) GetName() string
func (*HostLogger) GetReader ¶
func (s *HostLogger) GetReader() *bufio.Reader
func (*HostLogger) Original ¶
func (s *HostLogger) Original() *os.File
func (*HostLogger) WriteEnd ¶
func (s *HostLogger) WriteEnd()
type Manager ¶
type Manager struct { dvservice.WorkDirService LocateDir string // workdir下的相对路径 }
func NewManager ¶
func (*Manager) CreateHostLogger ¶
func (s *Manager) CreateHostLogger(taskId int64, host string) (*HostLogger, error)
func (*Manager) CreateManifestLogger ¶
func (s *Manager) CreateManifestLogger(taskId int64) (*ManifestLogger, error)
func (*Manager) OpenHostLogger ¶
func (*Manager) OpenLatestManifestLogger ¶
func (s *Manager) OpenLatestManifestLogger(taskId int64) (*ManifestLogger, error)
func (*Manager) RemoveLogs ¶
func (*Manager) RemoveOldLogs ¶
RemoveOldLogs 保留最近的remainHistoryCount次日志,会清除较老的日志
type ManifestEntry ¶
type ManifestEntry struct { Index int `json:"index"` // 序号 Time string `json:"time"` // 时间 Host string `json:"host"` // 主机地址(IP) HostLogName string `json:"hostLogName"` // 主机日志名称 Status string `json:"status"` // 执行状态,成功、失败等 }
func NewEntry ¶
func NewEntry(index int, host, hostLogFileName, status string) *ManifestEntry
func ParseEntry ¶
func ParseEntry(entryLine string) (*ManifestEntry, error)
func (*ManifestEntry) FormatString ¶
func (s *ManifestEntry) FormatString() string
type ManifestLogger ¶
type ManifestLogger struct {
// contains filtered or unexported fields
}
func NewManifestLogger ¶
func NewManifestLogger(file *os.File) *ManifestLogger
func (*ManifestLogger) Append ¶
func (s *ManifestLogger) Append(entry *ManifestEntry)
func (*ManifestLogger) Close ¶
func (s *ManifestLogger) Close()
func (*ManifestLogger) GetReader ¶
func (s *ManifestLogger) GetReader() *bufio.Reader
func (*ManifestLogger) Original ¶
func (s *ManifestLogger) Original() *os.File
func (*ManifestLogger) WriteEnd ¶
func (s *ManifestLogger) WriteEnd()
Click to show internal directories.
Click to hide internal directories.