output

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: GPL-3.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	FormatRaw      = "raw"
	FormatPrefixed = "prefixed"
	FormatCockpit  = "cockpit"
)

Output types

Variables

This section is empty.

Functions

func Close

func Close()

Close releases resources and closes underlying decorators

Types

type DecoratedOutputWriter

type DecoratedOutputWriter interface {
	io.Writer
	WriteHeader() error
	WriteFooter() error
}

DecoratedOutputWriter is a decorator for task output. It extends io.Writer with methods to write header before output starts and footer after execution completes

type TaskOutput

type TaskOutput struct {
	// contains filtered or unexported fields
}

TaskOutput connects given task with requested decorator

func NewTaskOutput

func NewTaskOutput(t *task.Task, format string, stdout, stderr io.Writer) (*TaskOutput, error)

NewTaskOutput creates new TaskOutput instance for given task.

func (TaskOutput) Finish

func (o TaskOutput) Finish() error

Finish should be called after task completes

func (TaskOutput) Start

func (o TaskOutput) Start() error

Start should be called before task's output starts

func (*TaskOutput) Stderr

func (o *TaskOutput) Stderr() io.Writer

Stderr returns io.Writer that can be used for Job's STDERR

func (*TaskOutput) Stdout

func (o *TaskOutput) Stdout() io.Writer

Stdout returns io.Writer that can be used for Job's STDOUT

Jump to

Keyboard shortcuts

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