events

package
v1.16.25-beta003 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// v1 - old log format based on shell output of executors {"line":"...", "time":"..."}
	LogVersionV1 LogVersion = "v1"
	// v2 - raw binary format, timestamps are based on Kubernetes logs, line is raw log line
	LogVersionV2 LogVersion = "v2"

	SourceJobPod            = "job-pod"
	SourceScheduler         = "test-scheduler"
	SourceContainerExecutor = "container-executor"
	SourceJobExecutor       = "job-executor"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	Time     time.Time         `json:"ts,omitempty"`
	Content  string            `json:"content,omitempty"`
	Type     string            `json:"type,omitempty"`
	Source   string            `json:"source,omitempty"`
	Metadata map[string]string `json:"metadata,omitempty"`
	Error    bool              `json:"error,omitempty"`
	Version  LogVersion        `json:"version,omitempty"`

	// Old output - for backwards compatibility - will be removed for non-structured logs
	V1 *LogOutputV1 `json:"v1,omitempty"`
}

func NewErrorLog added in v1.16.26

func NewErrorLog(err error) *Log

func NewLog added in v1.16.25

func NewLog(content ...string) *Log

func NewLogFromBytes added in v1.16.26

func NewLogFromBytes(b []byte) *Log

NewLogFromBytes creates new LogResponse from bytes it's aware of new and old log formats default log format will be based on raw bytes with timestamp on the beginning

func (*Log) WithContent added in v1.16.26

func (l *Log) WithContent(s string) *Log

func (*Log) WithError added in v1.16.26

func (l *Log) WithError(err error) *Log

func (*Log) WithMetadataEntry

func (l *Log) WithMetadataEntry(key, value string) *Log

func (*Log) WithSource added in v1.16.25

func (l *Log) WithSource(s string) *Log

func (*Log) WithType added in v1.16.25

func (l *Log) WithType(t string) *Log

func (*Log) WithV1Result

func (l *Log) WithV1Result(result *testkube.ExecutionResult) *Log

func (*Log) WithVersion

func (l *Log) WithVersion(version LogVersion) *Log

type LogOutputV1

type LogOutputV1 struct {
	Result *testkube.ExecutionResult
}

type LogResponse

type LogResponse struct {
	Log   Log
	Error error
}

type LogVersion

type LogVersion string

type Trigger

type Trigger struct {
	ResourceId string `json:"resourceId,omitempty"`
}

Generic event like log-start log-end with resource id

func NewTrigger added in v1.16.26

func NewTrigger(id string) Trigger

NewTrigger returns Trigger instance

func (Trigger) GetResourceId added in v1.16.26

func (t Trigger) GetResourceId() string

GetResourceId implements testkube.Trigger interface

Jump to

Keyboard shortcuts

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