Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct { // List of fields as for the Field descriptor. // This field gets populated by reader during the read. Fields []string // Version of the ELF format used, as for the Version descriptor. // This field gets populated by reader during the read. Version string // Software that created the ELF file, as for the Software descriptor. // This field gets populated by reader during the read. Software string // StartDate of the oldest entry, as for the StartDate descriptor. // This field gets populated by reader during the read. StartDate string // EndDate of the oldest entry, as for the EndDate descriptor. // This field gets populated by reader during the read. EndDate string // Date of the oldest entry, as for the Date descriptor. // This field gets populated by reader during the read. Date string // Remarks, as for the Remarks descriptor. // This field gets populated by reader during the read. Remark string // contains filtered or unexported fields }
A Reader reads records from an Extended Log Format file.
As returned by NewReader, a Reader expects input conforming to the W3C ELF. The exported fields are populated by the Read and the ReadAll functions.
The Reader manages both \r\n and \n sequences.
func (*Reader) Read ¶
Read reads one record (a slice of fields) from r. If the record has an unexpected number of fields, it returns an error
Read always returns either a non-nil record or a non-nil error, but not both. The only exception is if the line is a comment or empty, then both the record and the error will be nil.
If there is no data left to be read, Read returns nil, io.EOF.
type Writer ¶
type Writer struct { Fields []string Version string Software string StartDate string EndDate string Date string Remark string Separator rune // Field delimiter (set to '\t' by NewWriter) UseCRLF bool // True to use \r\n as the line terminator // contains filtered or unexported fields }
Writer writes records to an ELF encoded file.
func (*Writer) Flush ¶
func (w *Writer) Flush()
Flush writes any buffered data to the underlying io.Writer. To check if an error occurred during the Flush, call Error.
func (*Writer) WriteAll ¶
WriteAll writes multiple elf records to w using Write and then calls Flush.
func (*Writer) WriteHeaders ¶
WriteHeaders write the ELF file header lines