Documentation
¶
Overview ¶
Package deployment enters the runtime described by a deployed release. Applications opt in only when neither --config nor --env-file was supplied.
Index ¶
- Constants
- type BindingName
- type Bindings
- func (b Bindings) Bundle(name BindingName) (BundleDirectory, error)
- func (b Bindings) DeploymentSHA256() SHA256
- func (b Bindings) Endpoint(name BindingName) (Endpoint, error)
- func (b Bindings) Executable(name BindingName) (Executable, error)
- func (b Bindings) PublicListener(name BindingName) (PublicListener, error)
- func (b Bindings) Unit() Unit
- type BundleDirectory
- type Endpoint
- type EndpointScheme
- type Executable
- type InstanceID
- type ListenerName
- type ListenerTransport
- type PublicListener
- type RoleName
- type Runtime
- type SHA256
- type TLSMode
- type Unit
Constants ¶
const BindingsEnvironment = "FOUNDRY_DEPLOY_RUNTIME_FILE"
BindingsEnvironment selects the root-owned descriptor for this role invocation.
const RuntimeDescriptor = "config/deploy-runtime.json"
RuntimeDescriptor is the release-relative deployment descriptor path.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BindingName ¶ added in v0.31.0
type BindingName string
BindingName identifies a binding declared by the consuming role.
type Bindings ¶ added in v0.31.0
type Bindings struct {
// contains filtered or unexported fields
}
Bindings is an immutable startup snapshot. Pass concrete values to business handlers. Its zero value has no bindings; a missing name returns fault.Missing.
func LoadBindings ¶ added in v0.31.0
LoadBindings reads the descriptor selected by the deployment unit. Absence is reported separately from malformed configuration; an explicit bad path never falls back.
func ReadBindings ¶ added in v0.31.0
ReadBindings loads a bounded, nonsecret descriptor. Host-side executable and artifact verification remains the deployment owner's responsibility.
func (Bindings) Bundle ¶ added in v0.31.0
func (b Bindings) Bundle(name BindingName) (BundleDirectory, error)
Bundle returns the named service-local bundle directory. A missing name returns an error classified as fault.Missing.
func (Bindings) DeploymentSHA256 ¶ added in v0.31.0
DeploymentSHA256 returns the digest of the selected deployment.
func (Bindings) Endpoint ¶ added in v0.31.0
func (b Bindings) Endpoint(name BindingName) (Endpoint, error)
Endpoint returns the named private endpoint. A missing name returns an error classified as fault.Missing.
func (Bindings) Executable ¶ added in v0.31.0
func (b Bindings) Executable(name BindingName) (Executable, error)
Executable returns the named executable. A missing name returns an error classified as fault.Missing.
func (Bindings) PublicListener ¶ added in v0.33.0
func (b Bindings) PublicListener(name BindingName) (PublicListener, error)
PublicListener returns the named public listener with an owned address snapshot. A missing name returns an error classified as fault.Missing.
type BundleDirectory ¶ added in v0.31.0
type BundleDirectory struct {
// Path is the absolute path of the protected directory view.
Path string
// SHA256 identifies the artifact that supplies this bundle.
SHA256 SHA256
}
BundleDirectory is the protected service-local view, not the artifact's host path.
type Endpoint ¶ added in v0.31.0
type Endpoint struct {
// Role identifies the producer of this endpoint.
Role RoleName
// Listener identifies the producer's listener.
Listener ListenerName
// Scheme selects HTTP or TCP addressing.
Scheme EndpointScheme
// Address is the allocated loopback address.
Address netip.Addr
// Port is the allocated private port, not the public edge port.
Port uint16
}
Endpoint is an allocated private endpoint. It is immutable for this invocation.
type EndpointScheme ¶ added in v0.31.0
type EndpointScheme string
EndpointScheme identifies the protocol used to address a private endpoint.
const ( // HTTP addresses a private HTTP listener. HTTP EndpointScheme = "http" // TCP addresses a private TCP listener. TCP EndpointScheme = "tcp" )
type Executable ¶ added in v0.31.0
type Executable struct {
// Path is the absolute path of the host-verified executable.
Path string
// SHA256 identifies the executable source recorded by the host.
SHA256 SHA256
}
Executable is a host-verified absolute file, never a PATH search or shell command.
type InstanceID ¶ added in v0.31.0
type InstanceID string
InstanceID is the UUID of the deployed environment instance.
type ListenerName ¶ added in v0.31.0
type ListenerName string
ListenerName identifies a listener within its producing role.
type ListenerTransport ¶ added in v0.33.0
type ListenerTransport string
ListenerTransport identifies a declared listener's network transport.
const TCPTransport ListenerTransport = "tcp"
TCPTransport carries a public listener over TCP.
type PublicListener ¶ added in v0.33.0
type PublicListener struct {
// Role identifies the role that owns the listener.
Role RoleName
// Listener identifies the declared listener within its role.
Listener ListenerName
// Hostname is the public DNS hostname selected by the profile.
Hostname string
// Port is the public port selected by the profile.
Port uint16
// TLS is the TLS mode declared by the topology.
TLS TLSMode
// Transport is the network transport declared by the topology.
Transport ListenerTransport
// PublicAddresses contains the profile's explicit public addresses, not a DNS lookup.
PublicAddresses []netip.Addr
}
PublicListener is the declared public face of a placed listener. It is immutable for this invocation; it does not attest to current readiness.
type RoleName ¶ added in v0.31.0
type RoleName string
RoleName identifies a builtin or executable role in the topology.
type Runtime ¶
type Runtime struct {
// Release is the absolute path of the selected release.
Release string
// Instance is the deployed instance name.
Instance string
// User is the instance account used to run the application.
User string
// ConfigFile is the selected release's application configuration file.
ConfigFile string
// EnvFile is the selected runtime environment file.
EnvFile string
// WorkDir is the application working directory.
WorkDir string
// PublicDir is the selected release's public asset directory.
PublicDir string
}
Runtime contains the release profile and the instance's runtime paths. Use Detect to obtain it before calling Enter.
func Detect ¶
Detect reads the role descriptor selected by BindingsEnvironment, or the descriptor beside the resolved executable when that variable is absent. An absent legacy descriptor returns ok=false; an invalid or unreadable descriptor returns an error without falling back.
func (Runtime) Enter ¶
Enter replaces a root Linux process with runuser and forwards args unchanged (pass os.Args[1:]). Other users enter WorkDir and default WEB__PUBLIC_DIR to PublicDir only when unset. After Enter, load ConfigFile and EnvFile explicitly. A successful root exec never returns. Root on other platforms is unsupported.
type TLSMode ¶ added in v0.33.0
type TLSMode string
TLSMode identifies where a public listener terminates TLS.
type Unit ¶ added in v0.31.0
type Unit struct {
// Instance identifies the deployed environment instance.
Instance InstanceID
// Role identifies the placed service role.
Role RoleName
// Ordinal is the service copy number; the preview supports only one.
Ordinal uint16
}
Unit identifies a single placed service. Ordinals above one require a later capability.