Documentation ¶
Index ¶
Constants ¶
const TypeError = "error"
const TypeLogEvent = "event"
const TypeLogLine = "line"
const TypeResult = "result"
Variables ¶
This section is empty.
Functions ¶
func ParseRunnerOutput ¶
func ParseRunnerOutput(b []byte) (*testkube.ExecutionResult, error)
ParseRunnerOutput goes over the raw logs in b and parses possible runner output The input is a json stream of the form {"type": "line", "message": "runner execution started ------------", "time": "..."} {"type": "line", "message": "GET /results", "time": "..."} {"type": "result", "result": {"id": "2323", "output": "-----"}, "time": "..."}
func PrintEvent ¶
func PrintEvent(message string, obj ...interface{})
PrintEvent - prints event as output json
func PrintResult ¶
func PrintResult(result testkube.ExecutionResult)
PrintResult - prints result as output json
Types ¶
type JSONWrapWriter ¶
type JSONWrapWriter struct {
// contains filtered or unexported fields
}
JSONWrapWriter wraps bytes stream into json Output of type line
func NewJSONWrapWriter ¶
func NewJSONWrapWriter(writer io.Writer, envMngr env.Interface) *JSONWrapWriter
NewJSONWrapWriter returns new NewJSONWrapWriter instance
type Output ¶
type Output testkube.ExecutorOutput
Output generic json based output data structure
func GetLogEntry ¶
func NewOutputError ¶
NewOutputError returns new Output struct of type error
func NewOutputEvent ¶
NewOutputEvent returns new Output struct of type event
func NewOutputLine ¶
NewOutputLine returns new Output struct of type line
func NewOutputResult ¶
func NewOutputResult(result testkube.ExecutionResult) Output
NewOutputResult returns new Output struct of type result - should be last line in stream as it'll stop listening