Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manifest ¶
type Manifest struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Repo string `json:"repo"`
DependsOn []string `json:"depends_on,omitempty"`
Capabilities []string `json:"capabilities,omitempty"`
Resources []string `json:"resources,omitempty"`
Steps []Step `json:"steps"`
}
Manifest is the keel-addon.json structure from an addon repo.
func FetchManifest ¶
FetchManifest downloads keel-addon.json from a Go module path. Supports github.com module paths and local addon directories.
func InstallOfficialAlias ¶ added in v1.3.1
InstallOfficialAlias resolves an official addon alias from the registry and installs it.
func InstallRepo ¶ added in v1.3.1
InstallRepo fetches an addon's manifest and executes its installation steps.
func LoadLocalManifest ¶
LoadLocalManifest reads keel-addon.json from the current directory. Used for testing an addon locally before publishing.
type Registry ¶
type Registry struct {
Version string `json:"version"`
Addons []RegistryEntry `json:"addons"`
}
Registry is the full addon registry fetched from ss-keel-addons.
func FetchRegistry ¶
FetchRegistry returns the addon registry, using a local cache when fresh. Pass forceRefresh=true to bypass the cache.
type RegistryEntry ¶
type RegistryEntry struct {
Alias string `json:"alias"`
Repo string `json:"repo"`
Description string `json:"description"`
Official bool `json:"official"`
}
RegistryEntry is a single addon entry in the official registry.
type Step ¶
type Step struct {
// Type is one of: go_get | env | property | main_import | main_code |
// create_provider_file | note
Type string `json:"type"`
// go_get
Package string `json:"package,omitempty"`
// env | property
Key string `json:"key,omitempty"`
Example string `json:"example,omitempty"`
Description string `json:"description,omitempty"`
Required bool `json:"required,omitempty"`
Secret bool `json:"secret,omitempty"`
Message string `json:"message,omitempty"`
// main_import
Path string `json:"path,omitempty"`
// main_code
Anchor string `json:"anchor,omitempty"` // "before_listen" | "before_modules"
Guard string `json:"guard,omitempty"` // skip if already present
// Replace, when set, replaces the first line in cmd/main.go containing this
// substring with Code before falling back to insertion.
Replace string `json:"replace,omitempty"`
Code string `json:"code,omitempty"`
// create_provider_file creates a dedicated setup file with an initializer
// function, keeping cmd/main.go clean. Guard checks the file before creating.
Filename string `json:"filename,omitempty"` // e.g. "cmd/setup_provider.go"
Content string `json:"content,omitempty"` // full Go source for the file
}
Step is a single installation action defined in keel-addon.json.