compose

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package compose merges several resolved sources into one canonical tree.

Composition is closed-world: every final path has exactly one source owner, collisions fail rather than resolve, and the order sources appear in a manifest is not an input to the result (DP-011). There is no overlay, no precedence, and no last-one-wins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Owner

type Owner struct {
	// Source is the logical source name.
	Source string
	// SourcePath is the path within that source, before mounting.
	SourcePath canonical.Path
}

Owner records which source a final path came from.

type Result

type Result struct {
	// Records is the canonical inventory, sorted by final path.
	Records []canonical.FileRecord
	// Owners maps every final path to its single owner.
	Owners map[canonical.Path]Owner
	// contains filtered or unexported fields
}

Result is a composed tree.

func Compose

func Compose(sources []Source, limits bundle.Limits) (*Result, error)

Compose merges sources into one canonical tree.

Sources are sorted by name before anything else happens, so that the result — including which collision is reported when there are several — does not depend on the order they were resolved in. Resolution is concurrent, and concurrency must not be observable in the output (DP-012).

func (*Result) Open

func (r *Result) Open(ctx context.Context, path canonical.Path) (io.ReadCloser, error)

Open returns the content behind a composed path.

It routes through the owning snapshot rather than holding content itself, so composition never copies bytes. The path must be one Compose produced; anything else is refused before a snapshot is consulted.

type Source

type Source struct {
	// Name is the logical source name.
	Name string
	// MountPath places the source below a prefix. Empty mounts at the root.
	MountPath string
	// Snapshot holds the resolved, filtered material.
	Snapshot source.Snapshot
}

Source is one resolved source awaiting placement.

Jump to

Keyboard shortcuts

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