Documentation ¶
Overview ¶
Package stream contains the main logic for handling actions within a stream, such as reading the lines retrieved, setting up the command to run, and executing the command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
// FieldDelim - regex that matches a field pattern.
FieldDelim = `.*\#\{[0-9]*\}.*`
)
var ( // LogDebug controls the logging level, when true the stream will // write logs to stdout. LogDebug = false )
Functions ¶
This section is empty.
Types ¶
type Publisher ¶ added in v0.3.0
Publisher provides functions to publish to any subscribers of a stream.
func NewPublisher ¶ added in v0.3.0
NewPublisher returns an encapsulated RW allowing the consumer to publish text to any subscribers.
type RW ¶
type RW struct {
// contains filtered or unexported fields
}
RW implements the Subscriber and Publisher interfaces for a given Stream, allowing for communication between the interested parties.
type Stream ¶
Stream holds the information for the monitored stream.
func NewStream ¶
NewStream constructs a Stream for processing of a file. This calls the necessary field parsing functions before returning.
func (*Stream) ExecStreamComm ¶
ExecStreamComm is called with a matched line from the Stream, and executes the command for that stream.
type Subscriber ¶ added in v0.3.0
Subscriber provides functions for a consumer of the Stream's output to subscribe, ie. receive text coming through the stream.
func NewSubscriber ¶ added in v0.3.0
func NewSubscriber(s *Stream) Subscriber
NewSubscriber returns an encapsulated RW allowing the consumer to subscribe to text coming from the Stream.