Help us shape the future of Go! Take the 2026 Go Developer Survey

project

package
v2.219.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package project places bundle content at harness load points. The harness names and paths come from the layouts table, so this package holds none.

Index

Constants

View Source
const (
	ScopeRepo = "repo"
	ScopeHome = "home"
)

Variables

This section is empty.

Functions

func Registries

func Registries() (repo, home map[string]Layout, err error)

Registries splits the layouts table into its repo- and home-scoped views.

func Validate

func Validate(targetDir string) error

Validate reports whether the target holds a complete previous projection, so a failed refresh can fall back to it as last-known-good.

Types

type Layout

type Layout = layouts.Layout

type LoadPoints

type LoadPoints = layouts.LoadPoints

type Projection

type Projection struct {
	Layout string   `json:"layout"`
	Bundle string   `json:"bundle"`
	Files  []string `json:"files"`
}

Projection records the immutable bundle and files owned at one target.

func FindProjection

func FindProjection(start string) (Projection, string)

FindProjection walks from start toward the filesystem root and returns the nearest recorded projection plus the target directory that owns it.

func ReadProjection

func ReadProjection(targetDir string) Projection

ReadProjection loads the ownership sidecar at targetDir. An absent or malformed sidecar returns an empty projection for existing callers.

type Result

type Result struct {
	Layout string
	Files  []string
}

func ApplyOwned

func ApplyOwned(targetDir string, files map[string][]byte, label, origin string) (*Result, error)

ApplyOwned writes a file set under target with the projection ownership rules: sidecar-tracked, never clobbering foreign files, replacing stale.

func Project

func Project(bundleDir, layoutName, targetDir string) (*Result, error)

func ProjectScoped

func ProjectScoped(bundleDir, layoutName, targetDir, scope string) (*Result, error)

ProjectScoped selects repo-relative or home-relative load points; home scope treats targetDir as the home root.

Jump to

Keyboard shortcuts

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