tasklog

package
v1.13.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustCreateDynamicLogRegex added in v1.10.7

func MustCreateDynamicLogRegex(varName string) *regexp.Regexp

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
	ExtraTemplateVars    []TemplateVar
	TaskTemplate         *core.TaskTemplate
}

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 {
	Name                string                     `json:"name" pflag:",Name of the plugin."`
	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."`
	DynamicTemplateURIs []TemplateURI              `json:"dynamicTemplateUris" pflag:",URI Templates for generating dynamic task log links."`
	MessageFormat       core.TaskLog_MessageFormat `json:"messageFormat" pflag:"-,Log Message Format."`
	// Deprecated: Please, do not use
	DeprecatedScheme TemplateScheme `json:"scheme" pflag:",Templating scheme to use. Supported values are Pod and TaskExecution."`
	ShowWhilePending bool           `json:"showWhilePending" pflag:",If true, the log link will be shown even if the task is in a pending state."`
	HideOnceFinished bool           `json:"hideOnceFinished" pflag:",If true, the log link will be hidden once the task has finished."`
}

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 added in v1.10.6

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
}

Jump to

Keyboard shortcuts

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