caststream

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package caststream hosts lightweight remote streaming servers used by torque. It can expose log streams over WebSocket (e.g. `torque logs --ws-listen`) and render the deploy viewer HTML shell used by `torque apply --ui` / `torque delete --ui`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeLogRecord

func EncodeLogRecord(record tailer.LogRecord) ([]byte, error)

EncodeLogRecord converts a rendered log record into the JSON payload sent over /ws.

Types

type Mode

type Mode int
const (
	ModeWeb Mode = iota
	ModeWS
)

func (Mode) String

func (m Mode) String() string

type Option

type Option func(*Server)

Option configures the caststream server.

func WithDeployUI

func WithDeployUI() Option

WithDeployUI switches the server into deploy webcast mode.

type Server

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

Server exposes a lightweight HTML + WebSocket view of torque streams.

func New

func New(addr string, mode Mode, clusterInfo string, logger logr.Logger, opts ...Option) *Server

func (*Server) HandleDeployEvent

func (s *Server) HandleDeployEvent(event deploy.StreamEvent)

HandleDeployEvent satisfies deploy.StreamObserver so deploy applies can mirror structured events.

func (*Server) ObserveLog

func (s *Server) ObserveLog(record tailer.LogRecord)

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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