io

package
v0.0.0-...-86100e0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: BSD-3-Clause Imports: 15 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidStreamChunk = errors.New("invalid stream chunk")

Functions

func NewKeepAliveWriter

func NewKeepAliveWriter(w io.Writer, interval time.Duration, msg string) *keepAliveWriter

func NewStreamWriter

func NewStreamWriter(w io.Writer, formatter Formatter) *streamWriter

Types

type DockerErrorCheckWriter

type DockerErrorCheckWriter struct {
	W io.Writer
	// contains filtered or unexported fields
}

func (*DockerErrorCheckWriter) Write

func (w *DockerErrorCheckWriter) Write(data []byte) (n int, err error)

type FlushingWriter

type FlushingWriter struct {
	WriterFlusher
	MaxLatency time.Duration
	// contains filtered or unexported fields
}

FlushingWriter is a custom writer that flushes after writing, if the underlying ResponseWriter is also an http.Flusher.

func (*FlushingWriter) Close

func (w *FlushingWriter) Close()

func (*FlushingWriter) Flush

func (w *FlushingWriter) Flush()

func (*FlushingWriter) Hijack

func (w *FlushingWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)

Hijack will hijack the underlying TCP connection, if available in the ResponseWriter.

func (*FlushingWriter) Write

func (w *FlushingWriter) Write(data []byte) (written int, err error)

Write writes and flushes the data.

func (*FlushingWriter) WriteHeader

func (w *FlushingWriter) WriteHeader(code int)

func (*FlushingWriter) Wrote

func (w *FlushingWriter) Wrote() bool

Wrote returns whether the method WriteHeader has been called or not.

type Formatter

type Formatter interface {
	Format(out io.Writer, data []byte) error
}

type NoErrorWriter

type NoErrorWriter struct {
	io.Writer
	// contains filtered or unexported fields
}

func (*NoErrorWriter) Write

func (w *NoErrorWriter) Write(data []byte) (int, error)

type SimpleJsonMessage

type SimpleJsonMessage struct {
	Message   string
	Timestamp time.Time
	Error     string `json:",omitempty"`
}

type SimpleJsonMessageEncoderWriter

type SimpleJsonMessageEncoderWriter struct {
	*json.Encoder
	// contains filtered or unexported fields
}

func (*SimpleJsonMessageEncoderWriter) Write

func (w *SimpleJsonMessageEncoderWriter) Write(msg []byte) (int, error)

type SimpleJsonMessageFormatter

type SimpleJsonMessageFormatter struct {
	NoTimestamp bool
	// contains filtered or unexported fields
}

func (*SimpleJsonMessageFormatter) Close

func (f *SimpleJsonMessageFormatter) Close() error

func (*SimpleJsonMessageFormatter) Format

func (f *SimpleJsonMessageFormatter) Format(out io.Writer, data []byte) error

type WriterFlusher

type WriterFlusher interface {
	http.ResponseWriter
	http.Flusher
}

Jump to

Keyboard shortcuts

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