Documentation
¶
Overview ¶
Package layout computes the normative target runtime layout (docs/spec/runtime-layout.md §1) and proves every path stays inside its root. It contains no I/O; the deployment engine consumes the resolved paths.
<deployRoot>/ current -> releases/<realizationID> releases/<realizationID>/resources/ releases/<realizationID>/runtime/fxvcs.cfg releases/<realizationID>/runtime/config/ materialized/<aa>/<sha256> shared/cache/ shared/persistent/<repositoryID>/<resource-path>/ state/
Index ¶
- Constants
- Variables
- func Current(deployRoot string) string
- func DistinctDeployRoots(roots ...string) error
- func HookDestination(realizationDir, allowedRoot, destination string) (string, error)
- func MaterializedPath(deployRoot, digest string) (string, error)
- func PersistentPath(deployRoot, repositoryID, resourcePath, declared string) (string, error)
- func Realization(deployRoot, realizationID string) (string, error)
- func RealizationTarget(realizationID string) (string, error)
- func Releases(deployRoot string) string
- func ResourceFile(realizationDir, mount, relPath string) (string, error)
- func RuntimeFile(realizationDir, relPath string) (string, error)
- func ServerDataLinks(r Roots) map[string]string
- type Roots
Constants ¶
const ( CurrentLink = "current" ReleasesDir = "releases" MaterializedDir = "materialized" StateDir = "state" ResourcesDir = "resources" RuntimeDir = "runtime" RuntimeCfg = "fxvcs.cfg" RuntimeConfig = "config" )
Deploy-root relative segments (OS-independent names).
Variables ¶
var ( ErrInvalidRoot = errors.New("layout: root must be absolute and clean") ErrInvalidRealizationID = errors.New("layout: invalid realization ID") ErrOverlap = errors.New("layout: roots overlap") ErrEscape = errors.New("layout: path escapes its root") ErrInvalidDigest = errors.New("layout: invalid digest") )
Errors.
Functions ¶
func DistinctDeployRoots ¶
DistinctDeployRoots rejects duplicate or nested deploy roots across targets.
func HookDestination ¶
HookDestination validates a hook's requested destination against the allowlisted destination root (both realization-relative) and resolves it. A destination inside resources/ is refused: secret-bearing output must stay outside the FTP/SFTP-exposed resource tree.
func MaterializedPath ¶
MaterializedPath returns <deployRoot>/materialized/<aa>/<hex> for a digest.
func PersistentPath ¶
PersistentPath resolves <deployRoot>/shared/persistent/<repositoryID>/<resourcePath>/<declared>. The declared path must be relative, normalized, and is validated for containment; overlap between declared paths is the catalog validator's job.
func Realization ¶
Realization returns <deployRoot>/releases/<realizationID> after validating the ID.
func RealizationTarget ¶
RealizationTarget is the relative symlink/junction target for `current`.
func ResourceFile ¶
ResourceFile resolves a component-mounted file inside a realization: <realization>/<mount>/<relPath>. mount must be a normalized path under "resources/"; relPath must be normalized. Containment is proven.
func RuntimeFile ¶
RuntimeFile resolves <realization>/runtime/<relPath> (fxvcs.cfg, config/...).
func ServerDataLinks ¶
ServerDataLinks lists the indirections installed under <serverData>: each entry maps a serverData-relative name to its target under deployRoot.