initialize

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package initialize contains methods and structs needed to initialize jobs and services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobProps

type JobProps struct {
	WorkloadProps
	Schedule string
	Timeout  string
	Retries  int
}

JobProps contains the information needed to represent a Job.

type Prog

type Prog interface {
	Start(label string)
	Stop(label string)
}

Prog contains the methods needed to render multi-stage operations.

type ServiceProps

type ServiceProps struct {
	WorkloadProps
	Port        uint16
	HealthCheck *manifest.ContainerHealthCheck
}

ServiceProps contains the information needed to represent a Service (port, HealthCheck, and workload common props).

type Store

type Store interface {
	GetApplication(appName string) (*config.Application, error)
	CreateService(service *config.Workload) error
	CreateJob(job *config.Workload) error
	ListServices(appName string) ([]*config.Workload, error)
	ListJobs(appName string) ([]*config.Workload, error)
}

Store represents the methods needed to add workloads to the SSM parameter store.

type WorkloadAdder

type WorkloadAdder interface {
	AddJobToApp(app *config.Application, jobName string) error
	AddServiceToApp(app *config.Application, serviceName string) error
}

WorkloadAdder contains the methods needed to add jobs and services to an existing application.

type WorkloadInitializer

type WorkloadInitializer struct {
	Store    Store
	Deployer WorkloadAdder
	Ws       Workspace
	Prog     Prog
}

WorkloadInitializer holds the clients necessary to initialize either a service or job in an existing application.

func (*WorkloadInitializer) Job

func (w *WorkloadInitializer) Job(i *JobProps) (string, error)

Job writes the job manifest, creates an ECR repository, and adds the job to SSM.

func (*WorkloadInitializer) Service

func (w *WorkloadInitializer) Service(i *ServiceProps) (string, error)

Service writes the service manifest, creates an ECR repository, and adds the service to SSM.

type WorkloadProps

type WorkloadProps struct {
	App            string
	Type           string
	Name           string
	DockerfilePath string
	Image          string
}

WorkloadProps contains the information needed to represent a Workload (job or service).

type Workspace

type Workspace interface {
	CopilotDirPath() (string, error)
	WriteJobManifest(marshaler encoding.BinaryMarshaler, jobName string) (string, error)
	WriteServiceManifest(marshaler encoding.BinaryMarshaler, serviceName string) (string, error)
}

Workspace contains the methods needed to manipulate a Copilot workspace.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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