diff options
Diffstat (limited to 'internal/io/line/line.go')
| -rw-r--r-- | internal/io/line/line.go | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/internal/io/line/line.go b/internal/io/line/line.go index 97e7795..69cc667 100644 --- a/internal/io/line/line.go +++ b/internal/io/line/line.go @@ -30,6 +30,8 @@ type Line struct { // directories in case multiple log files with the same basename are // followed. SourceID string + // Session generation this line belongs to. Zero means unscoped/legacy output. + Generation uint64 } // New creaters a new line object. This is a DTail internal helper structure for reading files. @@ -39,13 +41,7 @@ func New(content *bytes.Buffer, count uint64, transmittedPerc int, sourceID stri l.Count = count l.TransmittedPerc = transmittedPerc l.SourceID = sourceID - return l -} - -// Null returns a new line with all members initialized to their null value. -func Null() *Line { - l := lineBuffer.Get().(*Line) - l.NullValues() + l.Generation = 0 return l } @@ -65,11 +61,3 @@ func (l *Line) Recycle() { //l.Reset() lineBuffer.Put(l) } - -// NullValues nulls all line struct members to their default state. -func (l *Line) NullValues() { - l.Content = nil - l.Count = 0 - l.TransmittedPerc = 0 - l.SourceID = "" -} |
