This repository has been archived on 2026-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
ollie-9p/internal/p9/pluginstore.go

31 lines
695 B
Go

package p9
import (
"os"
"ollie/pkg/tools/execute"
)
// PluginStore is a read-only FlatDirStore backed by the scripts/x/ directory.
// Plugins are executables invoked by the server (e.g. elevation backends), not
// by the agent or user directly.
type PluginStore struct {
*FlatDirStore
}
func NewPluginStore() *PluginStore {
return &PluginStore{FlatDirStore: NewFlatDirStore(execute.PluginsPath(), 0555)}
}
func (s *PluginStore) Stat(name string) (os.FileInfo, error) {
return s.FlatDirStore.Stat(name)
}
func (s *PluginStore) List() ([]os.DirEntry, error) {
return s.FlatDirStore.List()
}
func (s *PluginStore) Get(name string) ([]byte, error) {
return s.FlatDirStore.Get(name)
}