tasklog

package
v0.0.0-...-267b159 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustCreateRegex

func MustCreateRegex(varName string) *regexp.Regexp

Types

type Input

type Input struct {
	HostName                  string
	PodName                   string
	Namespace                 string
	ContainerName             string
	ContainerID               string
	LogName                   string
	PodRFC3339StartTime       string
	PodRFC3339FinishTime      string
	PodUnixStartTime          int64
	PodUnixFinishTime         int64
	PodUID                    string
	TaskExecutionID           pluginsCore.TaskExecutionID
	ExtraTemplateVarsByScheme *TemplateVarsByScheme
}

Input contains all available information about task's execution that a log plugin can use to construct task's log links.

type Output

type Output struct {
	TaskLogs []*core.TaskLog
}

Output contains all task logs a plugin generates for a given Input.

type Plugin

type Plugin interface {
	// Generates a TaskLog object given necessary computation information
	GetTaskLogs(i Input) (logs Output, err error)
}

Plugin represents an interface for task log plugins to implement to plug generated task log links into task events.

type TemplateLogPlugin

type TemplateLogPlugin struct {
	DisplayName   string                     `json:"displayName" pflag:",Display name for the generated log when displayed in the console."`
	TemplateURIs  []TemplateURI              `json:"templateUris" pflag:",URI Templates for generating task log links."`
	MessageFormat core.TaskLog_MessageFormat `json:"messageFormat" pflag:",Log Message Format."`
	Scheme        TemplateScheme             `json:"scheme" pflag:",Templating scheme to use. Supported values are Pod and TaskExecution."`
}

func (TemplateLogPlugin) GetTaskLogs

func (p TemplateLogPlugin) GetTaskLogs(input Input) (Output, error)

type TemplateScheme

type TemplateScheme int
const (
	TemplateSchemePod TemplateScheme = iota
	TemplateSchemeTaskExecution
)

func TemplateSchemeString

func TemplateSchemeString(s string) (TemplateScheme, error)

TemplateSchemeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func TemplateSchemeValues

func TemplateSchemeValues() []TemplateScheme

TemplateSchemeValues returns all values of the enum

func (TemplateScheme) IsATemplateScheme

func (i TemplateScheme) IsATemplateScheme() bool

IsATemplateScheme returns "true" if the value is listed in the enum definition. "false" otherwise

func (TemplateScheme) MarshalJSON

func (i TemplateScheme) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for TemplateScheme

func (TemplateScheme) MarshalYAML

func (i TemplateScheme) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for TemplateScheme

func (TemplateScheme) String

func (i TemplateScheme) String() string

func (*TemplateScheme) UnmarshalJSON

func (i *TemplateScheme) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for TemplateScheme

func (*TemplateScheme) UnmarshalYAML

func (i *TemplateScheme) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler for TemplateScheme

type TemplateURI

type TemplateURI = string

TemplateURI is a URI that accepts templates. See: go/tasks/pluginmachinery/tasklog/template.go for available templates.

type TemplateVar

type TemplateVar struct {
	Regex *regexp.Regexp
	Value string
}

type TemplateVars

type TemplateVars []TemplateVar

type TemplateVarsByScheme

type TemplateVarsByScheme struct {
	Common        TemplateVars
	Pod           TemplateVars
	TaskExecution TemplateVars
}

Jump to

Keyboard shortcuts

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