deployment

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package deployment provides functionality for planning and running deployment jobs.

Index

Constants

View Source
const (
	// DefaultDeploymentTimeout is the default time to wait for a deployment to complete
	DefaultDeploymentTimeout = time.Second * 60 * 20
)

Variables

View Source
var HTTPClient = &http.Client{Timeout: time.Second * 10}

HTTPClient is the default http client - used for s3

Functions

This section is empty.

Types

type AbortedError

type AbortedError struct {
	EvaluationID  string
	CorrelationID string
}

AbortedError is an error implementation that includes the ids of the aborted evaluation and message correlation.

func (*AbortedError) Error

func (e *AbortedError) Error() string

type ClientResponseError

type ClientResponseError struct {
	Body       string
	StatusCode int
	URL        string
}

ClientResponseError is an error implementation that includes the body and status code of the response.

func (*ClientResponseError) Error

func (e *ClientResponseError) Error() string

type Config

type Config struct {
	// DeploymentRoot is the path to root of deployments.
	DeploymentRoot string
	// NomadEndpoint is the Nomad client endpoint.
	NomadEndpoint string
	// NomadToken is the ACL token used to authorise HTTP requests.
	NomadToken string
	// NomadCACert is the path to the root nomad CA cert.
	NomadCACert string
	// NomadTLSSkipVerify disables TLS verification for nomad api calls.
	NomadTLSSkipVerify bool
	// Region is the region in which the deployment artifacts bucket resides.
	Region string
	// Timeout is the timeout configuration for the deployments.
	Timeout *TimeoutConfig
}

Config represents the configuration for a deployment.

type Deployment

type Deployment struct {
	// contains filtered or unexported fields
}

Deployment represents a deployment.

func New

func New(ctx context.Context, c *Config) (*Deployment, error)

New returns a new deployment.

func (*Deployment) Handler

func (d *Deployment) Handler(ctx context.Context, msg *engine.Message) error

Handler handles deployment messages that are delegated by the engine.

type EvaluationAbortedError

type EvaluationAbortedError struct {
	ID string
}

EvaluationAbortedError is an error implementation that includes the id of the evaluation.

func (*EvaluationAbortedError) Error

func (e *EvaluationAbortedError) Error() string

type EvaluationError

type EvaluationError struct {
	ID string
}

EvaluationError is an error implementation that includes the evaluation id of the allocations.

func (*EvaluationError) Error

func (e *EvaluationError) Error() string

type PlanError

type PlanError struct {
	Errors   string
	Service  string
	Warnings string
}

PlanError is an error implementation that includes the errors or warnings

func (*PlanError) Error

func (e *PlanError) Error() string

type TimeoutConfig

type TimeoutConfig struct {
	// Deployment is the max time to wait for a deployment to complete
	Deployment time.Duration
}

TimeoutConfig represents the configuration for deployment timeouts.

type TimeoutError

type TimeoutError struct {
	Action string
}

TimeoutError is an error implementation that includes the action that timed out.

func (*TimeoutError) Error

func (e *TimeoutError) Error() string

Jump to

Keyboard shortcuts

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