planning

package
v0.0.76 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeEndpoints

func ComputeEndpoints(srv Server, allocatedPorts []*schema.Endpoint_Port) ([]*schema.Endpoint, []*schema.InternalEndpoint, error)

func RegisterEndpointProvider

func RegisterEndpointProvider(fmwk schema.Framework, f EndpointProvider)

XXX this is not the right place for protocol handling.

Types

type EndpointProvider

type EndpointProvider interface {
	InternalEndpoints(*schema.Environment, *schema.Server, []*schema.Endpoint_Port) ([]*schema.InternalEndpoint, error)
}

type ParsedNode

type ParsedNode struct {
	Package       *pkggraph.Package
	ProvisionPlan pkggraph.ProvisionPlan
	Allocations   []pkggraph.ValueWithPath
	PrepareProps  planninghooks.ProvisionResult
}

func EvalProvision

func EvalProvision(ctx context.Context, server Server, n *pkggraph.Package) (*ParsedNode, error)

type PlannedServer

type PlannedServer struct {
	Server

	DeclaredStack schema.PackageList
	ParsedDeps    []*ParsedNode
	Resources     []pkggraph.ResourceInstance

	Endpoints         []*schema.Endpoint
	InternalEndpoints []*schema.InternalEndpoint
}

func (PlannedServer) SidecarsAndInits

func (p PlannedServer) SidecarsAndInits() ([]*schema.SidecarContainer, []*schema.SidecarContainer)

type ProvisionOpts

type ProvisionOpts struct {
	PortRange eval.PortRange
}

type Server

type Server struct {
	Location pkggraph.Location
	Package  *pkggraph.Package

	Provisioning pkggraph.PreparedProvisionPlan // A provisioning plan that is attached to the server itself.
	Startup      pkggraph.PreStartup
	// contains filtered or unexported fields
}

Represents a server bound to an environment.

func RequireLoadedServer

func RequireLoadedServer(ctx context.Context, e pkggraph.SealedContext, pkgname schema.PackageName) (Server, error)

func RequireServer

func RequireServer(ctx context.Context, env cfg.Context, pkgname schema.PackageName) (Server, error)

func RequireServerWith

func RequireServerWith(ctx context.Context, env cfg.Context, pl *parsing.PackageLoader, pkgname schema.PackageName) (Server, error)

func (Server) Deps

func (t Server) Deps() []*pkggraph.Package

func (Server) Framework

func (t Server) Framework() schema.Framework

func (Server) GetDep

func (t Server) GetDep(pkg schema.PackageName) *pkggraph.Package

func (Server) Module

func (t Server) Module() *pkggraph.Module

func (Server) Name

func (t Server) Name() string

func (Server) PackageName

func (t Server) PackageName() schema.PackageName

func (Server) PackageRef

func (t Server) PackageRef() *schema.PackageRef

func (Server) Proto

func (t Server) Proto() *schema.Server

func (Server) SealedContext

func (t Server) SealedContext() pkggraph.SealedContext

func (Server) StackEntry

func (t Server) StackEntry() *schema.Stack_Entry

type Servers

type Servers []Server

func (Servers) Packages

func (stack Servers) Packages() schema.PackageList

type Stack

type Stack struct {
	Focus             schema.PackageList
	Servers           []PlannedServer
	Endpoints         []*schema.Endpoint
	InternalEndpoints []*schema.InternalEndpoint
}

func ComputeStack

func ComputeStack(ctx context.Context, servers Servers, opts ProvisionOpts) (*Stack, error)

func (*Stack) AllPackageList

func (stack *Stack) AllPackageList() schema.PackageList

func (*Stack) Get

func (stack *Stack) Get(srv schema.PackageName) (PlannedServer, bool)

func (*Stack) Proto

func (stack *Stack) Proto() *schema.Stack

Directories

Path Synopsis
storage
nolint directives: stylecheck:sa1019
nolint directives: stylecheck:sa1019

Jump to

Keyboard shortcuts

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