process

package
v0.0.0-...-e2f5efa Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FirstInstance = "0"
)
View Source
const FirstPhaseName = "init"

Variables

View Source
var (
	ErrNoFreeIP = errors.New("out of ip address to allocate")
)
View Source
var (
	ErrSystemNotFound = errors.New("system not found")
)
View Source
var (
	ErrTestsDontMatchDist = fmt.Errorf("dists does not match the tests")
)

Functions

func MaxServiceCounts

func MaxServiceCounts(test schema.Test) map[string]int64

Types

type Commands

type Commands interface {
	Interpret(spec schema.RootSchema, dists []*entity.ResourceDist) ([]entity.TestCommands, error)
	Env(spec schema.RootSchema, dists []*entity.ResourceDist) ([]map[string]string, error)
}

func NewCommands

func NewCommands(calc TestCalculator) Commands

type Dependency

type Dependency interface {
	AttachNetworks(bucket int, state *entity.State, container string,
		networks []schema.Network) ([]command.Command, error)

	//Container returns create, start, error
	Container(bucket int, state *entity.State,
		service entity.Service, segment *entity.Segment) (command.Command, command.Command, error)

	DetachNetworks(bucket int, container string,
		networks []schema.Network) ([]command.Command, error)

	Emulation(bucket int, container string, networks []schema.Network) ([]command.Command, error)

	Files(bucket int, service entity.Service) ([]command.Command, error)

	RemoveContainer(bucket int, name string) (command.Command, error)

	Sidecars(bucket int, segment *entity.Segment, state *entity.State, service entity.Service,
		sidecars []schema.Sidecar) ([][]command.Command, error)

	SidecarNetwork(bucket int, state *entity.State,
		service entity.Service) (command.Command, error)

	Volumes(bucket int, service entity.Service) ([]command.Command, error)
}

func NewDependency

func NewDependency(
	cmdMaker maker.Command,
	parser maker.Service,
	log logrus.Ext1FieldLogger) Dependency

type Resolve

type Resolve interface {
	CreateNetworks(state *entity.State,
		networks []schema.Network, meta map[string]string) ([]command.Command, error)
	CreateSystemNetworks(state *entity.State, systems []schema.SystemComponent) ([]command.Command,
		error)

	CreateServices(state *entity.State, spec schema.RootSchema, dist entity.PhaseDist,
		services []entity.Service) ([][]command.Command, error)

	RemoveServices(dist entity.PhaseDist, services []entity.Service) ([][]command.Command, error)

	UpdateServices(state *entity.State, dist entity.PhaseDist,
		services []entity.ServiceDiff) ([][]command.Command, error)

	PhaseTransition(state *entity.State, dist entity.PhaseDist, phase schema.Phase) ([][]command.Command, error)
}

func NewResolve

func NewResolve(
	cmdMaker maker.Command,
	deps Dependency,
	log logrus.Ext1FieldLogger) Resolve

type System

type System interface {
	GetAlreadyExists(state *entity.State, systems []schema.SystemComponent) (
		[]schema.SystemComponent, []schema.SystemComponent, bool)

	UpdateChanged(state *entity.State, spec schema.RootSchema,
		systems []schema.SystemComponent) (*entity.SystemDiff, error)

	// Add modifies State
	Add(state *entity.State, spec schema.RootSchema, systems []schema.SystemComponent) ([]entity.Service, error)

	// Remove modifies state
	Remove(state *entity.State, spec schema.RootSchema, systems []string) ([]entity.Service, error)

	Tasks(state *entity.State, spec schema.RootSchema, tasks []schema.Task) ([]entity.Service, error)
}

System is for diff calculations

func NewSystem

func NewSystem(
	maker maker.Service,
	log logrus.Ext1FieldLogger) System

type TestCalculator

type TestCalculator interface {
	Commands(spec schema.RootSchema, dist *entity.ResourceDist, index int) (entity.TestCommands, error)
	Env(spec schema.RootSchema, dist *entity.ResourceDist, index int) (map[string]string, error)
}

func NewTestCalculator

func NewTestCalculator(
	conf config.Config,
	sys System,
	resolver Resolve,
	log logrus.Ext1FieldLogger) TestCalculator

Jump to

Keyboard shortcuts

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