{"modulePath":"github.com/hyperhq/hypercli","version":"v1.10.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package streamformatter\n\nPackage streamformatter provides helper functions to format a stream.\n\n## Types\n\n```go\ntype StderrFormatter struct {\n\tio.Writer\n\t*StreamFormatter\n}\n```\nStderrFormatter is a streamFormatter that writes to the standard error.\n\n```go\nfunc (sf *StderrFormatter) Write(buf []byte) (int, error)\n```\n\n```go\ntype StdoutFormatter struct {\n\tio.Writer\n\t*StreamFormatter\n}\n```\nStdoutFormatter is a streamFormatter that writes to the standard output.\n\n```go\nfunc (sf *StdoutFormatter) Write(buf []byte) (int, error)\n```\n\n```go\ntype StreamFormatter struct {\n\t// contains filtered or unexported fields\n}\n```\nStreamFormatter formats a stream, optionally using JSON.\n\n```go\nfunc NewJSONStreamFormatter() *StreamFormatter\n```\nNewJSONStreamFormatter returns a StreamFormatter configured to stream json\n\n```go\nfunc NewStreamFormatter() *StreamFormatter\n```\nNewStreamFormatter returns a simple StreamFormatter\n\n```go\nfunc (sf *StreamFormatter) FormatError(err error) []byte\n```\nFormatError formats the specified error.\n\n```go\nfunc (sf *StreamFormatter) FormatProgress(id, action string, progress *jsonmessage.JSONProgress, aux interface{}) []byte\n```\nFormatProgress formats the progress information for a specified action.\n\n```go\nfunc (sf *StreamFormatter) FormatStatus(id, format string, a ...interface{}) []byte\n```\nFormatStatus formats the specified objects according to the specified format (and id).\n\n```go\nfunc (sf *StreamFormatter) FormatStream(str string) []byte\n```\nFormatStream formats the specified stream.\n\n```go\nfunc (sf *StreamFormatter) NewProgressOutput(out io.Writer, newLines bool) progress.Output\n```\nNewProgressOutput returns a progress.Output object that can be passed to progress.NewProgressReader.\n\n","path":"github.com/hyperhq/hypercli/pkg/streamformatter","name":"streamformatter","synopsis":"Package streamformatter provides helper functions to format a stream.","isRedistributable":true}
