streaming

package
v0.0.0-...-d8c8bc9 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FLUX_STATE_RECEIVED  string = "FLUX_STATE_RECEIVED"
	FLUX_EVENTS_RECEIVED string = "FLUX_EVENTS_RECEIVED"
	POD_LOGS_RECEIVED    string = "POD_LOGS_RECEIVED"

	DEPLOYMENT_CREATED string = "DEPLOYMENT_CREATED"
	DEPLOYMENT_UPDATED string = "DEPLOYMENT_UPDATED"
	DEPLOYMENT_DELETED string = "DEPLOYMENT_DELETED"

	POD_CREATED string = "POD_CREATED"
	POD_UPDATED string = "POD_UPDATED"
	POD_DELETED string = "POD_DELETED"

	SERVICE_CREATED string = "SERVICE_CREATED"
	SERVICE_UPDATED string = "SERVICE_UPDATED"
	SERVICE_DELETED string = "SERVICE_DELETED"

	INGRESS_CREATED string = "INGRESS_CREATED"
	INGRESS_UPDATED string = "INGRESS_UPDATED"
	INGRESS_DELETED string = "INGRESS_DELETED"
)

Variables

This section is empty.

Functions

func ServeWs

func ServeWs(hub *ClientHub, w http.ResponseWriter, r *http.Request)

ServeWs handles websocket requests from the peer.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a middleman between the websocket connection and the hub.

type ClientHub

type ClientHub struct {
	// Registered clients.
	Clients map[*Client]bool

	// Updates to be broadcasted to the clients.
	Broadcast chan []byte

	// Updates to be sent to a single user.
	Send chan *ClientMessage

	// Register requests from the clients.
	Register chan *Client

	// Unregister requests from clients.
	Unregister chan *Client
}

ClientHub maintains the set of active clients and broadcasts messages to the clients.

func NewClientHub

func NewClientHub() *ClientHub

func (*ClientHub) Run

func (h *ClientHub) Run()

type ClientMessage

type ClientMessage struct {
	ClientId string
	Message  []byte
}

type Envelope

type Envelope struct {
	Type    string      `json:"type"`
	Payload interface{} `json:"payload"`
}

type PodLogMessage

type PodLogMessage struct {
	Timestamp  string `json:"timestamp"`
	Container  string `json:"container"`
	Message    string `json:"message"`
	Pod        string `json:"pod"`
	Deployment string `json:"deployment"`
}

Jump to

Keyboard shortcuts

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