planning

package
v0.0.396 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeEndpoints

func ComputeEndpoints(planner runtime.Planner, srv Server, merged *schema.ServerFragment, serverPorts []*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.

func ServiceSpecToEndpoint

func ServiceSpecToEndpoint(planner runtime.Planner, srv *schema.Server, spec *schema.Server_ServiceSpec, t schema.Endpoint_Type) (*schema.Endpoint, error)

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
	ServerFragments []*schema.ServerFragment
	Startup         pkggraph.PreStartup
	ComputePlanWith []*schema.Invocation
	Allocations     []pkggraph.ValueWithPath
	PrepareProps    planninghooks.ProvisionResult
}

func EvalProvision

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

type PlannedServer

type PlannedServer struct {
	Server

	// Transitive set of servers this server depends on.
	DeclaredStack schema.PackageList
	// Post-processed set of `node` dependencies.
	ParsedDeps     []*ParsedNode
	Resources      []pkggraph.ResourceInstance
	MergedFragment *schema.ServerFragment

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

type Planner added in v0.0.115

type Planner struct {
	Context  cfg.Context
	Runtime  runtime.Planner
	Registry registry.Manager
	Secrets  secrets.SecretsSource
}

func NewPlanner added in v0.0.115

func NewPlanner(ctx context.Context, env cfg.Context) (Planner, error)

func NewPlannerFromExisting added in v0.0.115

func NewPlannerFromExisting(env cfg.Context, planner runtime.Planner) (Planner, error)

type ProvisionOpts

type ProvisionOpts struct {
	Planner   runtime.Planner
	Secrets   is.SecretsSource
	PortRange eval.PortRange
}

type Server

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

	ComputePlanWith []*schema.Invocation
	EvalStartup     func(context.Context, pkggraph.Context, pkggraph.StartupInputs, []pkggraph.ValueWithPath) (*schema.StartupPlan, error)
	// 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) RelPath added in v0.0.115

func (t Server) RelPath() string

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
	ComputedResources map[string][]pkggraph.ResourceInstance // Key is resource ID.
}

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) GetComputedResources added in v0.0.111

func (stack *Stack) GetComputedResources(resourceID string) []pkggraph.ResourceInstance

func (*Stack) GetEndpoints added in v0.0.82

func (stack *Stack) GetEndpoints(srv schema.PackageName) ([]*schema.Endpoint, bool)

func (*Stack) GetStackEntry added in v0.0.157

func (stack *Stack) GetStackEntry(srv schema.PackageName) (*schema.Stack_Entry, bool)

func (*Stack) Proto

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

type StackWithIngress added in v0.0.115

type StackWithIngress struct {
	Stack
	IngressFragments []*schema.IngressFragment
}

func (*StackWithIngress) GetIngressesForService added in v0.0.115

func (s *StackWithIngress) GetIngressesForService(endpointOwner string, serviceName string) []*schema.IngressFragment

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