Documentation ¶
Overview ¶
Package observer provides a facility for publishing progress updates and state changes from parts of the daemon, an a SSE http handler for consumers of these events.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CtxRequestID ctxkey = "id"
CtxRequestID is the context WithValue key for a request id.
Functions ¶
This section is empty.
Types ¶
type EventType ¶
type EventType string
EventType represents all possible types of events that can be observed.
type Notifier ¶
Notifier belongs to a transactions and represents one segment in a series of actions. A Notifier can send many messages.
type Observer ¶
type Observer struct {
// contains filtered or unexported fields
}
Observer receives events via Notify, and publishes them as SSEs via its ServeHTTP function.
func (*Observer) ServeHTTP ¶
func (o *Observer) ServeHTTP(rw http.ResponseWriter, r *http.Request)
ServeHTTP implements the http.Handler interface for providing server-sent events of observed notifications.
Click to show internal directories.
Click to hide internal directories.