Documentation ¶
Overview ¶
Package streamformatter provides helper functions to format a stream.
Index ¶
- func FormatError(err error) []byte
- func FormatStatus(id, format string, a ...interface{}) []byte
- func NewJSONProgressOutput(out io.Writer, newLines bool) progress.Output
- func NewProgressOutput(out io.Writer) progress.Output
- func NewStderrWriter(out io.Writer) io.Writer
- func NewStdoutWriter(out io.Writer) io.Writer
- type AuxFormatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatError ¶
FormatError formats the error as a JSON object
func FormatStatus ¶
FormatStatus formats the specified objects according to the specified format (and id).
func NewJSONProgressOutput ¶
NewJSONProgressOutput returns a progress.Output that formats output using JSON objects
func NewProgressOutput ¶
NewProgressOutput returns a progress.Output object that can be passed to progress.NewProgressReader.
func NewStderrWriter ¶
NewStderrWriter returns a writer which formats the output as json message representing stderr lines
Types ¶
type AuxFormatter ¶
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
Click to show internal directories.
Click to hide internal directories.