Documentation ¶
Overview ¶
Package seaflog provides tools to process SeaFlow V1 instrument log files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var EventDefs map[string]EventDef
EventDefs hold event defintions keyed by name.
var Log *log.Logger
Log is seaflog's logger
var Version string = "v0.1.4"
Functions ¶
Types ¶
type Event ¶
type Event struct { Name string Type string Line string Value interface{} Time time.Time LineNumber int `json:"line_number"` Error error }
Event is parsed log file event
func CreateEvent ¶
CreateEvent creates an event
func UnhandledToNote ¶
UnhandledToNote converts an unhandled event to a note event
type EventExample ¶
EventExample contains example input and parsed data for an Event.
type EventForm ¶
type EventForm struct { StartsWith string `json:"startswith"` ValueAction string `json:"value_action"` Examples []EventExample }
EventForm defines a form of an event with a unique line prefix.
type EventScanner ¶
type EventScanner struct {
// contains filtered or unexported fields
}
EventScanner provides an interface for reading through a SeaFlow v1 instrument log file.
func NewEventScanner ¶
func NewEventScanner(r io.Reader) *EventScanner
func (*EventScanner) Err ¶
func (es *EventScanner) Err() error
Err returns any unrecoverable error encountered during event scanning.
func (*EventScanner) Event ¶
func (es *EventScanner) Event() Event
func (*EventScanner) Scan ¶
func (es *EventScanner) Scan() bool
Scan advances to the next event, which will then be available through the Event method. Returns false when the end of the input has been reached or after encountering an unrevorable error. This error which will be available with the Err method.
type TsdataWriter ¶
type TsdataWriter struct {
// contains filtered or unexported fields
}
TsdataWriter provides tools to write SeaFlow log files in TSDATA file format
func NewTsdataWriter ¶
func NewTsdataWriter(fileType string, project string, description string) TsdataWriter
NewTsdataWriter creates a new TsdataWriter struct
func (TsdataWriter) EventText ¶
func (t TsdataWriter) EventText(event Event) (string, error)
EventText returns a TSDATA event line string for one Event
func (TsdataWriter) HeaderText ¶
func (t TsdataWriter) HeaderText() string
HeaderText returns a TSDATA header string