Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrStreamNotFound = errors.New("stream: not found")
ErrStreamNotFound is returned when a stream is not registered with the streamer.
View Source
var WireSet = wire.NewSet( ProvideLogStream, )
WireSet provides a wire set for this package.
Functions ¶
This section is empty.
Types ¶
type Line ¶
type Line struct { Number int `json:"pos"` Message string `json:"out"` Timestamp int64 `json:"time"` }
Line represents a line in the logs.
type LogStream ¶
type LogStream interface { // Create creates the log stream for the step ID. Create(context.Context, int64) error // Delete deletes the log stream for the step ID. Delete(context.Context, int64) error // Writes writes to the log stream. Write(context.Context, int64, *Line) error // Tail tails the log stream. Tail(context.Context, int64) (<-chan *Line, <-chan error) // Info returns internal stream information. Info(context.Context) *LogStreamInfo }
LogStream manages a live stream of logs.
func ProvideLogStream ¶
func ProvideLogStream() LogStream
ProvideLogStream provides an implementation of a logs streamer.
type LogStreamInfo ¶
type LogStreamInfo struct { // Streams is a key-value pair where the key is the step // identifier, and the value is the count of subscribers // streaming the logs. Streams map[int64]int `json:"streams"` }
LogStreamInfo provides internal stream information. This can be used to monitor the number of registered streams and subscribers.
Click to show internal directories.
Click to hide internal directories.