logstream

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogBroker

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

LogBroker manages log streams for jobs

func NewBroker

func NewBroker() *LogBroker

NewBroker creates a new log broker

func (*LogBroker) Close

func (b *LogBroker) Close(jobID uuid.UUID)

Close closes all subscriptions for a job

func (*LogBroker) HasSubscribers

func (b *LogBroker) HasSubscribers(jobID uuid.UUID) bool

HasSubscribers returns true if there are active subscribers for a job

func (*LogBroker) Publish

func (b *LogBroker) Publish(jobID uuid.UUID, line string)

Publish sends a log line to all subscribers of a job

func (*LogBroker) Subscribe

func (b *LogBroker) Subscribe(jobID uuid.UUID) chan string

Subscribe creates a new subscription for a job's logs

func (*LogBroker) Unsubscribe

func (b *LogBroker) Unsubscribe(jobID uuid.UUID, ch chan string)

Unsubscribe removes a subscription

type StreamWriter

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

StreamWriter is an io.Writer that broadcasts to both a buffer and the broker

func NewStreamWriter

func NewStreamWriter(jobID uuid.UUID, broker *LogBroker, buffer io.Writer) *StreamWriter

NewStreamWriter creates a writer that broadcasts to the broker and writes to a buffer

func (*StreamWriter) Write

func (w *StreamWriter) Write(p []byte) (n int, err error)

Write implements io.Writer interface

type ValkeyLogWriter

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

ValkeyLogWriter publishes log lines to Valkey pub/sub channel Implements io.Writer interface for use with log streaming

func NewValkeyLogWriter

func NewValkeyLogWriter(client valkey.Client, jobID string) *ValkeyLogWriter

NewValkeyLogWriter creates a new Valkey log publisher

func (*ValkeyLogWriter) Publish

func (w *ValkeyLogWriter) Publish(message string) error

Publish sends a message to the log channel (for completion/error messages)

func (*ValkeyLogWriter) SetTTL

func (w *ValkeyLogWriter) SetTTL(seconds int64) error

SetTTL sets the TTL on the log channel for cleanup

func (*ValkeyLogWriter) Write

func (w *ValkeyLogWriter) Write(p []byte) (n int, err error)

Write implements io.Writer - publishes log line to Valkey

Jump to

Keyboard shortcuts

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