store

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package store persists generated plugin projects on disk: one directory per project under plugins/src, a project.json metadata file, the synthesized capability manifest sidecar, and stdlib zip archives for download and manual installs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is the filesystem ProjectStore: root holds one directory per project under plugins/src, and artifactsDir is the host's plugins/ directory receiving the built .wasm plus the synthesized manifest.

func NewStore

func NewStore(root, artifactsDir string) *Store

NewStore builds the filesystem store rooted at root (plugins/src). artifactsDir is the host's plugins/ directory receiving built artifacts; Delete cascades into it. An empty artifactsDir disables the cascade (tests, minimal embeddings).

func (*Store) Delete

func (s *Store) Delete(_ context.Context, name string) error

Delete removes an installed project and, when the store knows the host's plugins directory, the compiled artifacts a previous build installed: without the cascade the .wasm would keep executing with its capabilities after its source is gone.

func (*Store) Get

Get reads one installed project back into a Project value.

func (*Store) Install

func (s *Store) Install(_ context.Context, project plugingendomain.Project) error

Install persists a validated project. It validates the name and files again (defense in depth), claims the project directory exclusively — a concurrent generation resolving the same name gets ErrProjectExists instead of interleaving files — enforces zip-slip protection via the allowlist, and writes project.json last.

func (*Store) List

List returns every installed project.

func (*Store) Zip

func (s *Store) Zip(_ context.Context, name string) ([]byte, error)

Zip builds the download archive: the project dir at the archive root plus the capability manifest sidecar and a generated README with the build install steps. Projects installed before the sidecar shipped synthesize it from stored metadata instead.

Jump to

Keyboard shortcuts

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