extensions

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CurrentSchemaVersion is the latest manifest schema version supported by this build.
	CurrentSchemaVersion = 1

	// DefaultSchemaVersion is used when the schema_version field is omitted (backward compat).
	DefaultSchemaVersion = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtensionManifest

type ExtensionManifest struct {
	SchemaVersion int      `yaml:"schema_version,omitempty"`
	Name          string   `yaml:"name"`
	Version       string   `yaml:"version"`
	Description   string   `yaml:"description"`
	Author        string   `yaml:"author"`
	Repository    string   `yaml:"repository"`
	Entry         string   `yaml:"entry"`
	Hooks         []string `yaml:"hooks,omitempty"`
}

ExtensionManifest defines the metadata and entry point for a sley extension. This structure is expected to be defined in a extension's `extension.yaml` file.

All fields except Hooks are required: - Name: A unique extension identifier (e.g. "changelog-generator") - Version: The extension's version (e.g. "0.1.0") - Description: A brief explanation of what the extension does - Author: Name or handle of the extension author - Repository: URL of the extension's source repository - Entry: Path to the executable script or binary (relative to extension directory) - Hooks: List of hook points this extension supports (optional)

func LoadExtensionManifest added in v0.12.1

func LoadExtensionManifest(dir string) (*ExtensionManifest, error)

LoadExtensionManifest loads and validates a extension.yaml file from the given directory. Returns context-aware errors for common failure scenarios.

func (*ExtensionManifest) ValidateManifest

func (m *ExtensionManifest) ValidateManifest() error

ValidateManifest ensures all required fields are present and the manifest version is supported. Returns an error listing all missing fields if validation fails.

type ManifestNotFoundError added in v0.10.0

type ManifestNotFoundError struct {
	Path string
	Dir  string
}

ManifestNotFoundError indicates that an extension.yaml file is missing

func (*ManifestNotFoundError) Error added in v0.10.0

func (e *ManifestNotFoundError) Error() string

func (*ManifestNotFoundError) Suggestion added in v0.10.0

func (e *ManifestNotFoundError) Suggestion() string

Suggestion returns a helpful message with a manifest template

type ManifestParseError added in v0.10.0

type ManifestParseError struct {
	Path string
	Err  error
}

ManifestParseError indicates that a manifest file has invalid YAML or structure

func (*ManifestParseError) Error added in v0.10.0

func (e *ManifestParseError) Error() string

func (*ManifestParseError) Unwrap added in v0.10.0

func (e *ManifestParseError) Unwrap() error

Unwrap returns the underlying error

type ManifestValidationError added in v0.10.0

type ManifestValidationError struct {
	Path          string
	MissingFields []string
}

ManifestValidationError indicates that required fields are missing

func (*ManifestValidationError) Error added in v0.10.0

func (e *ManifestValidationError) Error() string

func (*ManifestValidationError) Suggestion added in v0.10.0

func (e *ManifestValidationError) Suggestion() string

Suggestion returns guidance on fixing validation errors

type SchemaVersionError added in v0.12.0

type SchemaVersionError struct {
	Path         string
	Found        int
	MaxSupported int
}

SchemaVersionError indicates the manifest requires a newer schema version than supported.

func (*SchemaVersionError) Error added in v0.12.0

func (e *SchemaVersionError) Error() string

func (*SchemaVersionError) Suggestion added in v0.12.0

func (e *SchemaVersionError) Suggestion() string

Suggestion returns guidance on resolving the version mismatch

Jump to

Keyboard shortcuts

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