events

package
v2.36.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

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()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL