package streamformatter

import "github.com/docker/docker/pkg/streamformatter"

Package streamformatter provides helper functions to format a stream.

Index

Functions

func FormatError

func FormatError(err error) []byte

FormatError formats the error as a JSON object

func FormatStatus

func FormatStatus(id, format string, a ...interface{}) []byte

FormatStatus formats the specified objects according to the specified format (and id).

func NewJSONProgressOutput

func NewJSONProgressOutput(out io.Writer, newLines bool) progress.Output

NewJSONProgressOutput returns a progress.Output that formats output using JSON objects

func NewProgressOutput

func NewProgressOutput(out io.Writer) progress.Output

NewProgressOutput returns a progress.Output object that can be passed to progress.NewProgressReader.

func NewStderrWriter

func NewStderrWriter(out io.Writer) io.Writer

NewStderrWriter returns a writer which formats the output as json message representing stderr lines

func NewStdoutWriter

func NewStdoutWriter(out io.Writer) io.Writer

NewStdoutWriter returns a writer which formats the output as json message representing stdout lines

Types

type AuxFormatter

type AuxFormatter struct {
	io.Writer
}

AuxFormatter is a streamFormatter that writes aux progress messages

func (*AuxFormatter) Emit

func (sf *AuxFormatter) Emit(id string, aux interface{}) error

Emit emits the given interface as an aux progress message

Source Files

streamformatter.go streamwriter.go

Version
v27.0.0-rc.2+incompatible
Published
Jun 17, 2024
Platform
js/wasm
Imports
6 packages
Last checked
48 minutes ago

Tools for package owners.