assets

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package assets distributes immutable plugin files through Foundry's shared guarded publisher. Publication is explicit and never part of application boot.

Index

Constants

Variables

This section is empty.

Functions

func Register

func Register(r *foundation.Registrar, bundle *Bundle) error

Register contributes an already snapshotted bundle under the captured plugin owner/release. It performs no publication or filesystem reads.

func Snapshot

func Snapshot(files []File) (map[string][]byte, error)

Snapshot validates all paths before any publication. Nil data means an empty file, never deletion. Omitted files are removed only when the publisher proves that they belong to this exact distribution and have not been manually edited.

Types

type Bundle

type Bundle struct {
	// contains filtered or unexported fields
}

Bundle snapshots every source file. It is safe to share across applications; inspection returns copies and publication does not modify the bundle.

func Bundles

func Bundles(resolver foundation.Resolver) ([]*Bundle, error)

Bundles returns immutable bundles registered in dependency order. Calling it on App.Services needs no boot or runtime infrastructure.

func New

func New(declaration manifest.Manifest, id ID, files ...File) (*Bundle, error)

func (*Bundle) Files

func (b *Bundle) Files() []FileInfo

func (*Bundle) Info

func (b *Bundle) Info() manifest.Distribution

func (*Bundle) Publish

func (b *Bundle) Publish(ctx context.Context, dir string, check bool) (Report, error)

Publish confines files to one existing selected output root. Different bundle owners, older releases, unowned files and edited owned files are refused. Check is read-only, including when recovery is pending. Failed publication can leave newly created empty directories; it never recursively deletes directories.

type File

type File struct {
	Path string
	Data []byte
}

type FileInfo

type FileInfo struct {
	Path  string `json:"path"`
	Bytes int    `json:"bytes"`
}

type ID

type ID string

type Recovery

type Recovery = generate.Recovery

func Recover

func Recover(ctx context.Context, dir string) (Recovery, error)

Recover is the shared publisher recovery entry point; the same operation is available through foundry generate --recover --dir <selected output root>.

type Report

type Report = generate.Report

Jump to

Keyboard shortcuts

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