Documentation ¶
Index ¶
Constants ¶
View Source
const ( ConfigDeviceTypeJSON = "json" ConfigDeviceTypeText = "text" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device interface { WriteLogEntry(LogEntry) error WriteErrorEntry(ErrorEntry) error }
type ErrorEntry ¶
type ErrorEntry struct { Time int64 `json:"time"` Body ErrorEntryBody `json:"error"` }
type ErrorEntryBody ¶
type JSONDevice ¶
type JSONDevice struct {
// contains filtered or unexported fields
}
JSONDevice writes events as JSON log entries
func NewJSONDevice ¶
func NewJSONDevice(writer io.Writer) JSONDevice
func (JSONDevice) WriteErrorEntry ¶
func (d JSONDevice) WriteErrorEntry(entry ErrorEntry) error
func (JSONDevice) WriteLogEntry ¶
func (d JSONDevice) WriteLogEntry(entry LogEntry) error
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
func (Log) WriteLogEntryNoErr ¶
type LogEntry ¶
type LogEntry struct { Time int64 `json:"time"` Stage string `json:"stage"` Task string `json:"task"` Tags []string `json:"tags"` Total int `json:"total"` Index int `json:"index"` State string `json:"state"` Progress int `json:"progress"` // Might contain error key Data map[string]interface{} `json:"data,omitempty"` }
type TextDevice ¶
type TextDevice struct {
// contains filtered or unexported fields
}
TextDevice writes events in user friendly format
func NewTextDevice ¶
func NewTextDevice(writer io.Writer) TextDevice
func (TextDevice) WriteErrorEntry ¶
func (d TextDevice) WriteErrorEntry(entry ErrorEntry) error
func (TextDevice) WriteLogEntry ¶
func (d TextDevice) WriteLogEntry(entry LogEntry) error
Click to show internal directories.
Click to hide internal directories.