streamer

package
v0.0.0-...-b6a7119 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFunc

type HandlerFunc func(StreamID, io.Writer)

func (HandlerFunc) ServeHTTP

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

type StreamID

type StreamID string

StreamID identifies a pair of standard output and error channels used for streaming.

type Streamer

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

func New

func New(graceTime time.Duration) *Streamer

New creates a Streamer with the specified grace time which limits the duration of memory consumption by a stopped stream.

func (*Streamer) ServeStderr

func (m *Streamer) ServeStderr(streamID StreamID, writer io.Writer)

StreamStderr streams to the specified writer from the standard error channel of the specified pair of channels.

func (*Streamer) ServeStdout

func (m *Streamer) ServeStdout(streamID StreamID, writer io.Writer)

StreamStdout streams to the specified writer from the standard output channel of the specified pair of channels.

func (*Streamer) Stop

func (m *Streamer) Stop(streamID StreamID)

Stop stops streaming from the specified pair of channels.

func (*Streamer) Stream

func (m *Streamer) Stream(stdout, stderr chan []byte) StreamID

Stream sets up streaming for the given pair of channels and returns a StreamID to identify the pair. The caller must call Stop to avoid leaking memory.

Jump to

Keyboard shortcuts

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