executor

package
v0.3.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package executor provides the ability for Vela to integrate with different supported operating systems.

Usage:

import "github.com/go-vela/worker/executor"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(c context.Context) map[int]Engine

FromContext returns the executor Engine associated with this context.

func ToContext

func ToContext(c Setter, e map[int]Engine)

ToContext adds the executor Engine to this context if it supports the Setter interface.

Types

type Engine

type Engine interface {

	// GetBuild defines a function for the API
	// that gets the current build in execution.
	GetBuild() (*library.Build, error)
	// GetRepo defines a function for the API
	// that gets the current repo in execution.
	GetRepo() (*library.Repo, error)
	// GetPipeline defines a function for the API
	// that gets the current pipeline in execution.
	GetPipeline() (*pipeline.Build, error)
	// KillBuild defines a function for the API
	// that kills the current build in execution.
	KillBuild() (*library.Build, error)

	// PullSecret defines a function that pulls
	// the secrets for a given pipeline.
	PullSecret(context.Context) error

	// CreateService defines a function that
	// configures the service for execution.
	CreateService(context.Context, *pipeline.Container) error
	// PlanService defines a function that
	// prepares the service for execution.
	PlanService(context.Context, *pipeline.Container) error
	// ExecService defines a function that
	// runs a service.
	ExecService(context.Context, *pipeline.Container) error
	// DestroyService defines a function that
	// cleans up the service after execution.
	DestroyService(context.Context, *pipeline.Container) error

	// CreateStep defines a function that
	// configures the step for execution.
	CreateStep(context.Context, *pipeline.Container) error
	// PlanStep defines a function that
	// prepares the step for execution.
	PlanStep(context.Context, *pipeline.Container) error
	// ExecStep defines a function that
	// runs a step.
	ExecStep(context.Context, *pipeline.Container) error
	// DestroyStep defines a function that
	// cleans up the step after execution.
	DestroyStep(context.Context, *pipeline.Container) error

	// CreateStage defines a function that
	// configures the stage for execution.
	CreateStage(context.Context, *pipeline.Stage) error
	// PlanStage defines a function that
	// prepares the stage for execution.
	PlanStage(context.Context, *pipeline.Stage) error
	// ExecStage defines a function that
	// runs a stage.
	ExecStage(context.Context, *pipeline.Stage, map[string]chan error) error
	// DestroyStage defines a function that
	// cleans up the stage after execution.
	DestroyStage(context.Context, *pipeline.Stage) error

	// CreateBuild defines a function that
	// configures the build for execution.
	CreateBuild(context.Context) error
	// ExecBuild defines a function that
	// runs a pipeline for a build.
	ExecBuild(context.Context) error
	// DestroyBuild defines a function that
	// cleans up the build after execution.
	DestroyBuild(context.Context) error

	// WithBuild defines a function that sets
	// the library Build type in the Engine.
	WithBuild(*library.Build) Engine
	// WithPipeline defines a function that sets
	// the pipeline Build type in the Engine.
	WithPipeline(*pipeline.Build) Engine
	// WithRepo defines a function that sets
	// the library Repo type in the Engine.
	WithRepo(*library.Repo) Engine
	// WithUser defines a function that sets
	// the library User type in the Engine.
	WithUser(*library.User) Engine
}

Engine represents the interface for Vela integrating with the different supported operating systems.

type Setter

type Setter interface {
	Set(string, interface{})
}

Setter defines a context that enables setting values.

Directories

Path Synopsis
Package linux provides the ability for Vela to integrate with a Linux as an operating system.
Package linux provides the ability for Vela to integrate with a Linux as an operating system.

Jump to

Keyboard shortcuts

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