types

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package types contains all the types used by the runner.

Package types contains all the types used by the runner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	*BaseAction[variables.ExtraVariableInfo] `json:",inline"`
	TaskReference                            string            `json:"task,omitempty" jsonschema:"description=The task to run, mutually exclusive with cmd and wait"`
	With                                     map[string]string `json:"with,omitempty" jsonschema:"description=Input parameters to pass to the task,type=object"`
	If                                       string            `json:"if,omitempty" jsonschema:"description=Conditional to determine if the action should run"`
}

Action is a wrapped BaseAction action inside a Task to provide additional functionality

type ActionDefaults added in v0.2.0

type ActionDefaults struct {
	Env             []string             `json:"env,omitempty" jsonschema:"description=Additional environment variables for commands"`
	Mute            bool                 `json:"mute,omitempty" jsonschema:"description=Hide the output of commands during execution (default false)"`
	MaxTotalSeconds int                  `json:"maxTotalSeconds,omitempty" jsonschema:"description=Default timeout in seconds for commands (default to 0, no timeout)"`
	MaxRetries      int                  `json:"maxRetries,omitempty" jsonschema:"description=Retry commands given number of times if they fail (default 0)"`
	Dir             string               `json:"dir,omitempty" jsonschema:"description=Working directory for commands (default CWD)"`
	Shell           exec.ShellPreference `` /* 163-byte string literal not displayed */
}

ActionDefaults sets the default configs for actions and represents an interface shared with Zarf

type ActionWait added in v0.2.0

type ActionWait struct {
	Cluster *ActionWaitCluster `` /* 163-byte string literal not displayed */
	Network *ActionWaitNetwork `` /* 163-byte string literal not displayed */
}

ActionWait specifies a condition to wait for before continuing

type ActionWaitCluster added in v0.2.0

type ActionWaitCluster struct {
	Kind       string `json:"kind" jsonschema:"description=The kind of resource to wait for,example=Pod,example=Deployment)"`
	Identifier string `json:"name" jsonschema:"description=The name of the resource or selector to wait for,example=podinfo,example=app=podinfo"`
	Namespace  string `json:"namespace,omitempty" jsonschema:"description=The namespace of the resource to wait for"`
	Condition  string `` /* 241-byte string literal not displayed */
}

ActionWaitCluster specifies a condition to wait for before continuing

type ActionWaitNetwork added in v0.2.0

type ActionWaitNetwork struct {
	Protocol string `json:"protocol" jsonschema:"description=The protocol to wait for,enum=tcp,enum=http,enum=https"`
	Address  string `json:"address" jsonschema:"description=The address to wait for,example=localhost:8080,example=1.1.1.1"`
	Code     int    `` /* 126-byte string literal not displayed */
}

ActionWaitNetwork specifies a condition to wait for before continuing

type BaseAction added in v0.2.0

type BaseAction[T any] struct {
	Description     string                  `` /* 143-byte string literal not displayed */
	Cmd             string                  `` /* 128-byte string literal not displayed */
	Wait            *ActionWait             `` /* 144-byte string literal not displayed */
	Env             []string                `json:"env,omitempty" jsonschema:"description=Additional environment variables to set for the command"`
	Mute            *bool                   `json:"mute,omitempty" jsonschema:"description=Hide the output of the command during package deployment (default false)"`
	MaxTotalSeconds *int                    `` /* 171-byte string literal not displayed */
	MaxRetries      *int                    `json:"maxRetries,omitempty" jsonschema:"description=Retry the command if it fails up to given number of times (default 0)"`
	Dir             *string                 `json:"dir,omitempty" jsonschema:"description=The working directory to run the command in (default is CWD)"`
	Shell           *exec.ShellPreference   `` /* 163-byte string literal not displayed */
	SetVariables    []variables.Variable[T] `` /* 228-byte string literal not displayed */
}

BaseAction represents a single action to run and represents an interface shared with Zarf

type InputParameter

type InputParameter struct {
	Description       string `json:"description" jsonschema:"description=Description of the parameter,required"`
	DeprecatedMessage string `json:"deprecatedMessage,omitempty" jsonschema:"description=Message to display when the parameter is deprecated"`
	Required          bool   `json:"required,omitempty" jsonschema:"description=Whether the parameter is required,default=true"`
	Default           string `json:"default,omitempty" jsonschema:"description=Default value for the parameter"`
}

InputParameter represents a single input parameter for a task, to be used w/ `with`

type Task

type Task struct {
	Name        string                    `json:"name" jsonschema:"description=Name of the task"`
	Description string                    `json:"description,omitempty" jsonschema:"description=Description of the task"`
	Actions     []Action                  `json:"actions,omitempty" jsonschema:"description=Actions to take when running the task"`
	Inputs      map[string]InputParameter `json:"inputs,omitempty" jsonschema:"description=Input parameters for the task"`
	EnvPath     string                    `json:"envPath,omitempty" jsonschema:"description=Path to file containing environment variables"`
}

Task represents a single task

type TaskReference

type TaskReference struct {
	Name string `json:"name" jsonschema:"description=Name of the task to run"`
}

TaskReference references the name of a task

type TasksFile

type TasksFile struct {
	Includes  []map[string]string                                          `json:"includes,omitempty" jsonschema:"description=List of local task files to include"`
	Variables []variables.InteractiveVariable[variables.ExtraVariableInfo] `json:"variables,omitempty" jsonschema:"description=Definitions and default values for variables used in run.yaml"`
	Tasks     []Task                                                       `json:"tasks" jsonschema:"description=The list of tasks that can be run"`
}

TasksFile represents the contents of a tasks file

Jump to

Keyboard shortcuts

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