catalog

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package catalog assembles the machine-readable plugin catalog behind `sarde plugins --format json`: every plugin name the engine accepts in plugins.enabled, with metadata and configurable fields.

It lives apart from internal/build so that the CLI can describe plugins without pulling in the builder, and apart from internal/plugin because the subpackage plugins cannot be imported from there (see plugin/registry.go).

Index

Constants

View Source
const (
	KindServer   = "server"
	KindClient   = "client"
	KindExternal = "external"
)

Kind classifies where a plugin is implemented.

View Source
const Version = 1

Version is bumped when the JSON shape changes incompatibly.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	Version int     `json:"version"`
	Plugins []Entry `json:"plugins"`
}

Catalog is the full listing.

func Build

func Build(projectDir string) Catalog

Build lists built-in server and client plugins plus, when projectDir is non-empty, external plugins discovered under {projectDir}/plugins. External plugins are enabled by presence, so they report defaultEnabled.

func (Catalog) IDs

func (c Catalog) IDs() []string

IDs returns every plugin name in the catalog.

type Entry

type Entry struct {
	ID             string          `json:"id"`
	Label          string          `json:"label"`
	Kind           string          `json:"kind"`
	Group          string          `json:"group"`
	Description    string          `json:"description"`
	DefaultEnabled bool            `json:"defaultEnabled"`
	ConfigKey      string          `json:"configKey,omitempty"`
	Fields         []cfgutil.Field `json:"fields"`
}

Entry describes one plugin. Keep field names stable: Sarde Studio decodes them.

Jump to

Keyboard shortcuts

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