Documentation
¶
Index ¶
- func MultiWriter(writers ...io.Writer) io.Writer
- func NewCockpitOutputWriter(t *task.Task, w io.Writer, close chan bool) *cockpitOutputDecorator
- func NewPrefixedOutputWriter(t *task.Task, w io.Writer) *prefixedOutputDecorator
- type DecoratedOutputWriter
- type OutputEnum
- type SafeWriter
- type TaskOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MultiWriter ¶ added in v1.7.0
MultiWriter creates a writer that duplicates its writes to all the provided writers, similar to the Unix tee(1) command.
Each write is written to each listed writer, one at a time. If a listed writer returns an error, that overall write operation stops and returns the error; it does not continue down the list.
func NewCockpitOutputWriter ¶ added in v1.6.4
Types ¶
type DecoratedOutputWriter ¶
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 OutputEnum ¶ added in v1.6.4
type OutputEnum string
const ( RawOutput OutputEnum = "raw" CockpitOutput OutputEnum = "cockpit" PrefixedOutput OutputEnum = "prefixed" )
type SafeWriter ¶ added in v1.6.4
type SafeWriter struct {
// contains filtered or unexported fields
}
SafeWriter is a go routine safe implementation of any io.Writer.
Outside of os.File no other writer is concurrency safe,
bytes.Buffer, and so on will need a concurrency lock on writes, and reads
func NewSafeWriter ¶ added in v1.6.4
func NewSafeWriter(writerImpl io.Writer) *SafeWriter
NewSafeWriter initiates a new concurrency safe writer
func (*SafeWriter) Len ¶ added in v1.6.4
func (tw *SafeWriter) Len() int
Len returns the currently written bytes length Currently only used in tests
func (*SafeWriter) String ¶ added in v1.6.4
func (tw *SafeWriter) String() string
String returns the stringified version of bytes written Currently only used in tests
type TaskOutput ¶
type TaskOutput struct {
// contains filtered or unexported fields
}
TaskOutput connects given task with requested decorator
func NewTaskOutput ¶
NewTaskOutput creates new TaskOutput instance for given task.
func (*TaskOutput) Close ¶ added in v1.6.4
func (t *TaskOutput) Close()
Close releases resources and closes underlying decorators
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
func (*TaskOutput) WithCloseCh ¶ added in v1.6.4
func (t *TaskOutput) WithCloseCh(closeCh chan bool) *TaskOutput