Documentation
¶
Index ¶
- Constants
- func Print(toJSON interface{}, format string, outWriter io.Writer, ...) error
- func PrintPrettySection(out io.Writer, printer func(writer io.Writer), headers ...string) error
- func ToJSON(i interface{}, prefix string, indentation string) (string, error)
- func ToStandardJSON(i interface{}) (string, error)
- type LogConsumer
- type MemBytes
Constants ¶
View Source
const ( // JSON is the constant for Json formats on list commands JSON = "json" // TemplateLegacyJSON the legacy json formatting value using go template TemplateLegacyJSON = "{{json.}}" // PRETTY is the constant for default formats on list commands PRETTY = "pretty" )
Variables ¶
This section is empty.
Functions ¶
func Print ¶ added in v0.1.20
func Print(toJSON interface{}, format string, outWriter io.Writer, writerFn func(w io.Writer), headers ...string) error
Print prints formatted lists in different formats
func PrintPrettySection ¶ added in v0.1.20
PrintPrettySection prints a tabbed section on the writer parameter
func ToJSON ¶ added in v0.1.20
ToJSON return a string with the JSON representation of the interface{}
func ToStandardJSON ¶
ToStandardJSON return a string with the JSON representation of the interface{}
Types ¶
type LogConsumer ¶ added in v1.0.3
type LogConsumer struct {
// contains filtered or unexported fields
}
LogConsumer consume logs from services and format them
func NewLogConsumer ¶ added in v1.0.3
func NewLogConsumer(w io.Writer) LogConsumer
NewLogConsumer creates a new LogConsumer
func (*LogConsumer) GetWriter ¶ added in v1.0.3
func (l *LogConsumer) GetWriter(service, container string) io.Writer
GetWriter creates a io.Writer that will actually split by line and format by LogConsumer
func (*LogConsumer) Log ¶ added in v1.0.3
func (l *LogConsumer) Log(service, container, message string)
Log formats a log message as received from service/container
Source Files
¶
Click to show internal directories.
Click to hide internal directories.