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 ¶
- type Store
- func (s *Store) Delete(_ context.Context, name string) error
- func (s *Store) Get(_ context.Context, name string) (plugingendomain.Project, error)
- func (s *Store) Install(_ context.Context, project plugingendomain.Project) error
- func (s *Store) List(_ context.Context) ([]plugingendomain.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 plugins/src, and artifactsDir is the host's plugins/ directory receiving the built .wasm plus the synthesized manifest.
func NewStore ¶
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 ¶
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) 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) ([]plugingendomain.InstalledProject, error)
List returns every installed project.