Documentation
¶
Overview ¶
Package pluginrepo manages external plugin repositories (the plugin store). Repositories are JSON indexes listing plugin file names; the luaplugin service owns installation from downloaded bytes.
Index ¶
- Variables
- type BuiltinRepo
- type IndexDoc
- type RepoFile
- type RepoRecord
- type RepoRef
- type Service
- func (s *Service) AddRepo(ctx context.Context, rawURL string) (*RepoRecord, error)
- func (s *Service) EnsureBuiltinRepos() error
- func (s *Service) FetchFile(ctx context.Context, id, path string) ([]byte, error)
- func (s *Service) Get(id string) (*RepoRecord, error)
- func (s *Service) GetIndex(ctx context.Context, id string) (IndexDoc, error)
- func (s *Service) License(ctx context.Context, id string) (string, bool, error)
- func (s *Service) List() ([]*RepoRecord, error)
- func (s *Service) ListPluginFiles(ctx context.Context, id string) ([]RepoFile, error)
- func (s *Service) ReadMe(ctx context.Context, id string) (string, bool, error)
- func (s *Service) Remove(id string) error
- func (s *Service) SetLogger(logger *slog.Logger)
Constants ¶
This section is empty.
Variables ¶
var BuiltinRepos = []BuiltinRepo{
{
Source: "https://github.com/TheSlopMachine/llm-router-store",
Index: "https://raw.githubusercontent.com/TheSlopMachine/llm-router-store/main/llm-router-plugins/index.json",
},
}
BuiltinRepos lists repositories seeded in code on every startup.
var ErrBuiltinRepoProtected = errors.New("built-in repository cannot be removed")
ErrBuiltinRepoProtected is returned when removing a built-in repository.
Functions ¶
This section is empty.
Types ¶
type BuiltinRepo ¶
BuiltinRepo is one code-defined repository: the source URL shown in the UI and the resolved index.json URL used for downloads.
type RepoRecord ¶
type RepoRecord struct {
ID string `json:"id"`
Kind string `json:"kind"`
IndexURL string `json:"index_url"`
SourceURL string `json:"source_url"`
Title string `json:"title"`
Description string `json:"description"`
Builtin bool `json:"builtin"`
AddedAt time.Time `json:"added_at"`
}
RepoRecord is the stored repository row.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service owns repository records in the plugin_repositories table.
func (*Service) AddRepo ¶
AddRepo validates a repository or index URL and stores the repo. The first candidate index that parses with a non-empty plugin list wins.
func (*Service) EnsureBuiltinRepos ¶
EnsureBuiltinRepos seeds the code-defined repositories without network validation, so startup never depends on store availability. Existing rows with the same ID are marked built-in.
func (*Service) Get ¶
func (s *Service) Get(id string) (*RepoRecord, error)
Get returns one repository by ID.
func (*Service) List ¶
func (s *Service) List() ([]*RepoRecord, error)
List returns all added repositories sorted by ID.
func (*Service) ListPluginFiles ¶
ListPluginFiles lists plugin files for one repository.