-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #897 from google/logstream-refactors
refactor: Clean up internals of the logstreams
- Loading branch information
Showing
16 changed files
with
324 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2024 Google Inc. All Rights Reserved. | ||
// This file is available under the Apache license. | ||
|
||
package logstream | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/google/mtail/internal/logline" | ||
) | ||
|
||
type streamBase struct { | ||
sourcename string // human readable name of the logstream source | ||
|
||
lines chan *logline.LogLine // outbound channel for lines | ||
|
||
staleTimer *time.Timer // Expire the stream if no read in 24h. | ||
} | ||
|
||
// Lines returns the output log line channel for this stream. The stream is | ||
// completed when this channel closes. | ||
func (s *streamBase) Lines() <-chan *logline.LogLine { | ||
return s.lines | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.