output

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 6 Imported by: 35

Documentation

Overview

TODO will be moved to testkube lib when completed

Index

Constants

View Source
const TypeError = "error"
View Source
const TypeLogEvent = "event"
View Source
const TypeLogLine = "line"
View Source
const TypeResult = "result"

Variables

This section is empty.

Functions

func GetExecutionResult

func GetExecutionResult(b []byte) (is bool, result testkube.ExecutionResult)

GetExecutionResult tries to unmarshal execution result

func ParseRunnerOutput

func ParseRunnerOutput(b []byte) (result testkube.ExecutionResult, logs []string, err error)

ParseRunnerOutput try to parse possible runner output which is some bunch of json stream like {"type": "line", "message": "runner execution started ------------"} {"type": "line", "message": "GET /results"} {"type": "result", "result": {"id": "2323", "output": "-----"}}

func PrintError

func PrintError(err error)

func PrintEvent

func PrintEvent(message string, obj ...interface{})

func PrintLog

func PrintLog(message string)

func PrintResult

func PrintResult(result testkube.ExecutionResult)

Types

type JSONWrapWriter

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

func NewJSONWrapWriter

func NewJSONWrapWriter(writer io.Writer) *JSONWrapWriter

func (*JSONWrapWriter) Write

func (w *JSONWrapWriter) Write(p []byte) (int, error)

type Output

type Output testkube.ExecutorOutput

func GetLogEntry

func GetLogEntry(b []byte) (out Output, err error)

func NewOutputError

func NewOutputError(err error) Output

func NewOutputEvent

func NewOutputEvent(message string) Output

func NewOutputLine

func NewOutputLine(content []byte) Output

func NewOutputResult

func NewOutputResult(result testkube.ExecutionResult) Output

func (Output) String

func (out Output) String() string

Jump to

Keyboard shortcuts

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