executor

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaskTypeCreateAccount = TaskType("CreateAccount")
	TaskTypeCreateRelease = TaskType("CreateRelease")
)
View Source
const AccountTypeToken = "Token"
View Source
const AccountTypeUsernamePassword = "Username/Password"

account type values match the UI

Variables

This section is empty.

Functions

func ProcessTasks

func ProcessTasks(octopus *client.Client, space *spaces.Space, tasks []*Task) error

ProcessTasks iterates over the list of tasks and attempts to run them all. If everything goes well, a nil error will be returned. On the first failure, the error will be returned. TODO some kind of progress/results callback? A Goroutine with channels?

Types

type Task

type Task struct {
	// which type of task this is.
	Type TaskType

	// task-specific payload (usually a struct containing the data required for this task)
	// rememmber pass this as a pointer
	Options any
}

func NewTask

func NewTask(taskType TaskType, options any) *Task

type TaskOptionsCreateAccount

type TaskOptionsCreateAccount struct {
	Type           string   // REQUIRED. refer to AccountType constant strings
	Name           string   // REQUIRED.
	Description    string   // optional
	EnvironmentIds []string // optional. // TODO the user may have specified environment string names; the outer code should resolve them before building the TaskInput
	Options        any      // subtype-specific payload
}

type TaskOptionsCreateAccountToken

type TaskOptionsCreateAccountToken struct {
	Token *core.SensitiveValue
}

type TaskOptionsCreateAccountUsernamePassword

type TaskOptionsCreateAccountUsernamePassword struct {
	Username string
	Password *core.SensitiveValue
}

type TaskOptionsCreateRelease

type TaskOptionsCreateRelease struct {
	ProjectName             string   // Required
	DefaultPackageVersion   string   // Optional
	GitCommit               string   // Optional
	GitReference            string   // Required for version controlled projects
	Version                 string   // optional
	ChannelName             string   // optional
	ReleaseNotes            string   // optional
	IgnoreIfAlreadyExists   bool     // optional
	IgnoreChannelRules      bool     // optional
	PackageVersionOverrides []string // optional
	// if the task succeeds, the resulting output will be stored here
	Response *releases.CreateReleaseResponseV1
}

the command processor is responsible for accepting related entity names from the end user and looking them up for their ID's; we should only deal with strong references at this level

type TaskResultCreateRelease

type TaskResultCreateRelease struct {
	Version string
}

type TaskType

type TaskType string

task type definitions

Jump to

Keyboard shortcuts

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