Documentation ¶
Index ¶
Constants ¶
View Source
const ( LOGS = "logs" // Logs event channel, contains daemon logs STATUS = "status" // status event channel, contains VM load info )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventProducer ¶
type EventProducer interface { Start(publisher EventPublisher) Stop() }
func NewStatusListener ¶
func NewStatusListener(machine crcMachine.Client) EventProducer
func NewTickListener ¶
func NewTickListener(generator genData) EventProducer
type EventPublisher ¶
type EventPublisher interface {
Publish(event *sse.Event)
}
type EventServer ¶
type EventServer struct {
// contains filtered or unexported fields
}
func NewEventServer ¶
func NewEventServer(machine machine.Client) *EventServer
func (*EventServer) ServeHTTP ¶
func (es *EventServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type EventStream ¶
type EventStream interface { AddSubscriber(subscriber *sse.Subscriber) RemoveSubscriber(subscriber *sse.Subscriber) }
type TickListener ¶
type TickListener struct {
// contains filtered or unexported fields
}
TickListener a data generator for an event stream. It will fetch data at regular intervals, and send it to all clients connected to the endpoint.
func (*TickListener) Start ¶
func (s *TickListener) Start(publisher EventPublisher)
func (*TickListener) Stop ¶
func (s *TickListener) Stop()
Click to show internal directories.
Click to hide internal directories.