Documentation ¶
Overview ¶
TODO will be moved to testkube lib when completed
Index ¶
- Constants
- func GetExecutionResult(b []byte) (is bool, result testkube.ExecutionResult)
- func ParseRunnerOutput(b []byte) (result testkube.ExecutionResult, logs []string, err error)
- func PrintError(err error)
- func PrintEvent(message string, obj ...interface{})
- func PrintLog(message string)
- func PrintResult(result testkube.ExecutionResult)
- type JSONWrapWriter
- type Output
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", "content": "runner execution started ------------"} {"type": "line", "content": "GET /results"} {"type": "result", "content": {"id": "2323", "output": "-----"}}
func PrintError ¶
func PrintError(err error)
func PrintEvent ¶
func PrintEvent(message string, obj ...interface{})
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
type Output ¶
type Output struct { Type string `json:"type,omitempty"` Message string `json:"message,omitempty"` Content interface{} `json:"content,omitempty"` Result *testkube.ExecutionResult `json:"result,omitempty"` }
func GetLogEntry ¶
func NewOutputError ¶
func NewOutputEvent ¶
func NewOutputLine ¶
func NewOutputResult ¶
func NewOutputResult(result testkube.ExecutionResult) Output
Click to show internal directories.
Click to hide internal directories.