streaming

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEntry

type LogEntry struct {
	Level     string    `json:"level"`
	Message   string    `json:"message"`
	Timestamp time.Time `json:"timestamp"`
}

LogEntry represents a log entry

type ProgressUpdate

type ProgressUpdate struct {
	Current    int       `json:"current"`
	Total      int       `json:"total"`
	Percentage float64   `json:"percentage"`
	Message    string    `json:"message"`
	Timestamp  time.Time `json:"timestamp"`
}

ProgressUpdate represents a progress update

type StreamWriter

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

StreamWriter handles writing streaming responses

func NewStreamWriter

func NewStreamWriter(writer io.Writer) *StreamWriter

NewStreamWriter creates a new stream writer

func (*StreamWriter) Flush

func (w *StreamWriter) Flush() error

Flush flushes the writer if it supports flushing

func (*StreamWriter) WriteData

func (w *StreamWriter) WriteData(data interface{}) error

WriteData writes streaming data

func (*StreamWriter) WriteEvent

func (w *StreamWriter) WriteEvent(event string, data interface{}) error

WriteEvent writes a streaming event

func (*StreamWriter) WriteMessage

func (w *StreamWriter) WriteMessage(message string) error

WriteMessage writes a plain text message

type StreamingClient

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

StreamingClient handles streaming responses

func NewStreamingClient

func NewStreamingClient() *StreamingClient

NewStreamingClient creates a new streaming client

func (*StreamingClient) StreamRequest

func (c *StreamingClient) StreamRequest(ctx context.Context, url string, headers map[string]string) (<-chan *StreamingResponse, error)

StreamRequest makes a streaming request and returns a channel of responses

type StreamingCommandExecutor

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

StreamingCommandExecutor executes commands and streams output

func NewStreamingCommandExecutor

func NewStreamingCommandExecutor(writer *StreamWriter) *StreamingCommandExecutor

NewStreamingCommandExecutor creates a new streaming command executor

func (*StreamingCommandExecutor) ExecuteCommand

func (e *StreamingCommandExecutor) ExecuteCommand(ctx context.Context, command string, args []string) error

ExecuteCommand executes a command and streams its output

type StreamingHTTPHandler

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

StreamingHTTPHandler creates HTTP handlers for streaming responses

func NewStreamingHTTPHandler

func NewStreamingHTTPHandler() *StreamingHTTPHandler

NewStreamingHTTPHandler creates a new streaming HTTP handler

func (*StreamingHTTPHandler) ServeHTTP

func (h *StreamingHTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles HTTP requests with streaming responses

type StreamingLogWriter

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

StreamingLogWriter streams log messages

func NewStreamingLogWriter

func NewStreamingLogWriter(writer *StreamWriter) *StreamingLogWriter

NewStreamingLogWriter creates a new streaming log writer

func (*StreamingLogWriter) WriteLog

func (w *StreamingLogWriter) WriteLog(level, message string) error

WriteLog writes a log message

type StreamingMetricsCollector

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

StreamingMetricsCollector streams metrics data

func NewStreamingMetricsCollector

func NewStreamingMetricsCollector(writer *StreamWriter, interval time.Duration) *StreamingMetricsCollector

NewStreamingMetricsCollector creates a new streaming metrics collector

func (*StreamingMetricsCollector) Start

Start starts streaming metrics

func (*StreamingMetricsCollector) Stop

func (c *StreamingMetricsCollector) Stop()

Stop stops streaming metrics

type StreamingProgressTracker

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

StreamingProgressTracker tracks progress and streams updates

func NewStreamingProgressTracker

func NewStreamingProgressTracker(writer *StreamWriter, total int) *StreamingProgressTracker

NewStreamingProgressTracker creates a new streaming progress tracker

func (*StreamingProgressTracker) Update

func (t *StreamingProgressTracker) Update(current int, message string) error

Update updates the progress and potentially streams an update

type StreamingResponse

type StreamingResponse struct {
	ID        string                 `json:"id"`
	Event     string                 `json:"event"`
	Data      map[string]interface{} `json:"data"`
	Timestamp time.Time              `json:"timestamp"`
}

StreamingResponse represents a streaming response

Jump to

Keyboard shortcuts

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