store

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 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 module projects on disk: one directory per project under modules-gen, a project.json metadata file, and stdlib zip archives for download. Staged projects are inert source: nothing executes until an operator copies the tree into a checkout and rebuilds.

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 modules-gen. kernelVersion is the host kernel version recorded in each manifest and rendered into the download's INSTALL.md.

func NewStore

func NewStore(root, kernelVersion string) *Store

NewStore builds the filesystem store rooted at root (modules-gen). kernelVersion is recorded in each manifest and rendered into INSTALL.md; empty disables the pin line.

func (*Store) Delete

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

Delete removes an installed project. Staged projects are inert source, so no artifact cascade applies: nothing executes from modules-gen/.

func (*Store) Get

func (s *Store) Get(_ context.Context, name string) (modgendomain.Project, error)

Get reads one installed project back into a Project value.

func (*Store) Install

func (s *Store) Install(_ context.Context, project modgendomain.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 generated INSTALL.md with the compile-time install steps.

Jump to

Keyboard shortcuts

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