Documentation
¶
Index ¶
- type EventActionComplete
- type EventActionStart
- type EventError
- type EventFileFetch
- type EventLogLine
- type EventStream
- func (es *EventStream) Handler(w http.ResponseWriter, r *http.Request)
- func (es *EventStream) PublishActionComplete(action string)
- func (es *EventStream) PublishActionStart(action, msg string)
- func (es *EventStream) PublishError(err error)
- func (es *EventStream) PublishFileFetch(file string)
- func (es *EventStream) PublishLogLine(msg string)
- type EventType
- type NullStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventActionComplete ¶
EventActionComplete conatins an action name to signal completion for.
type EventActionStart ¶
EventActionStart contains an action name, and a message
type EventError ¶
EventError contains the underlying error that occured.
type EventFileFetch ¶
EventFileFetch contains a filename that was fetched successfully.
type EventLogLine ¶
EventLogLine contains a message from a log.
type EventStream ¶
type EventStream struct {
// contains filtered or unexported fields
}
EventStream binds all the components of the event streaming server.
func New ¶
func New(l hclog.Logger) *EventStream
New returns an initialized event streamer ready for use.
func (*EventStream) Handler ¶
func (es *EventStream) Handler(w http.ResponseWriter, r *http.Request)
Handler implements the http.Handler interface so that the eventstream can be plugged into a webserver.
func (*EventStream) PublishActionComplete ¶
func (es *EventStream) PublishActionComplete(action string)
PublishActionComplete pushes an asynchronous action complete message.
func (*EventStream) PublishActionStart ¶
func (es *EventStream) PublishActionStart(action, msg string)
PublishActionStart pushes an asynchronous action start message.
func (*EventStream) PublishError ¶
func (es *EventStream) PublishError(err error)
PublishError pushes an error out into the event stream.
func (*EventStream) PublishFileFetch ¶
func (es *EventStream) PublishFileFetch(file string)
PublishFileFetch pushes a filename into the event stream.
func (*EventStream) PublishLogLine ¶
func (es *EventStream) PublishLogLine(msg string)
PublishLogLine pushes a log message into the event stream.
type EventType ¶
type EventType uint8
EventType is used to identify what type of event is crossing the wire.
const ( // EventTypeUnknown is used as a zero value to ensure that this // always has to be set to something. EventTypeUnknown EventType = iota // EventTypeError is pushed across the wire in the event that the // system has encountered some kind of error that was // non-recoverable. EventTypeError // EventTypeLogLine is used to signify that the event in question // is a log line, which may be associated with one or more // other events. EventTypeLogLine // EventTypeActionStart is used to signal that an asynchronous // action has been requested, and that the system is // attempting to process it. EventTypeActionStart // EventTypeActionComplete is used to signal that an // asynchronous action has successfully completed. EventTypeActionComplete // EventTypeFileFetch is fired when a file is successfully // retrieved from a remote source. EventTypeFileFetch )
type NullStream ¶
type NullStream struct{}
NullStream doesn't publish events anywhere and is mostly for testing or non-server CLI cmdlets.
func NewNullStreamer ¶
func NewNullStreamer() *NullStream
NewNullStreamer hands back a null stream instance that discards everything.
func (*NullStream) PublishActionComplete ¶
func (ns *NullStream) PublishActionComplete(_ string)
PublishActionComplete discards all actions.
func (*NullStream) PublishActionStart ¶
func (ns *NullStream) PublishActionStart(_, _ string)
PublishActionStart discards all actions.
func (*NullStream) PublishError ¶
func (ns *NullStream) PublishError(_ error)
PublishError discards all errors.
func (*NullStream) PublishFileFetch ¶
func (ns *NullStream) PublishFileFetch(_ string)
PublishFileFetch discards all filenames.
func (*NullStream) PublishLogLine ¶
func (ns *NullStream) PublishLogLine(_ string)
PublishLogLine discards all log lines.