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 ¶
- type Store
- func (s *Store) Delete(_ context.Context, name string) error
- func (s *Store) Get(_ context.Context, name string) (modgendomain.Project, error)
- func (s *Store) Install(_ context.Context, project modgendomain.Project) error
- func (s *Store) List(_ context.Context) ([]modgendomain.InstalledProject, error)
- func (s *Store) Zip(_ context.Context, name string) ([]byte, error)
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 ¶
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 ¶
Delete removes an installed project. Staged projects are inert source, so no artifact cascade applies: nothing executes from modules-gen/.
func (*Store) Install ¶
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 ¶
func (s *Store) List(_ context.Context) ([]modgendomain.InstalledProject, error)
List returns every installed project.