streaming

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LineScanner

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

LineScanner is a helper for reading lines from a stream

func NewLineScanner

func NewLineScanner(reader io.Reader) *LineScanner

NewLineScanner creates a new line scanner

func (*LineScanner) ReadLine

func (ls *LineScanner) ReadLine() (string, error)

ReadLine reads a line from the stream

type Message

type Message struct {
	Type      StreamType      `json:"type"`
	Timestamp time.Time       `json:"timestamp"`
	Source    string          `json:"source"` // hostname or container name
	Data      json.RawMessage `json:"data"`
}

Message represents a streamed message

type Server

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

Server handles real-time streaming from remote servers

func NewServer

func NewServer(client *ssh.Client, hostname string) *Server

NewServer creates a new streaming server

func (*Server) Start

func (s *Server) Start() error

Start begins streaming from all sources

func (*Server) Stop

func (s *Server) Stop()

Stop stops all streaming

func (*Server) Subscribe

func (s *Server) Subscribe(types []StreamType) *Subscription

Subscribe creates a new subscription for specific stream types

func (*Server) Unsubscribe

func (s *Server) Unsubscribe(subID string)

Unsubscribe removes a subscription

type StreamType

type StreamType string

StreamType represents different types of streams

const (
	StreamMetrics StreamType = "metrics"
	StreamLogs    StreamType = "logs"
	StreamEvents  StreamType = "events"
	StreamDocker  StreamType = "docker"
)

type Subscription

type Subscription struct {
	ID       string
	Types    []StreamType
	Messages chan Message
	// contains filtered or unexported fields
}

Subscription represents a client subscription

Jump to

Keyboard shortcuts

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