Help us shape the future of Go! Take the 2026 Go Developer Survey

plugins

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIVersion   = 7
	ManifestName = "attn-plugin.toml"
)

Variables

This section is empty.

Functions

func Discover

func Discover(pluginDir string) ([]Manifest, []ManifestIssue)

func ReapRuntimeProcesses added in v0.12.0

func ReapRuntimeProcesses(dataDir string) []procreap.ReapResult

func Remove

func Remove(pluginDir, name string) error

func RuntimeRegistryDir added in v0.12.0

func RuntimeRegistryDir(dataDir string) string

func SourceName added in v0.12.0

func SourceName(sourceDir string) (string, error)

Types

type EntrypointKind added in v0.12.0

type EntrypointKind string
const (
	EntrypointBun        EntrypointKind = "bun"
	EntrypointExecutable EntrypointKind = "executable"
)

type InstallOptions

type InstallOptions struct {
	Env      []string
	CloneGit func(context.Context, string, string, []string) ([]byte, error)
}

type Manifest

type Manifest struct {
	Name           string `toml:"name" json:"name"`
	Version        string `toml:"version" json:"version"`
	AttnAPIVersion int    `toml:"attn_api_version" json:"attn_api_version"`
	Description    string `toml:"description" json:"description,omitempty"`
	Plugin         struct {
		Entrypoint string         `toml:"entrypoint" json:"entrypoint,omitempty"`
		Kind       EntrypointKind `toml:"kind" json:"kind"`
		Path       string         `toml:"path" json:"path"`
	} `toml:"plugin" json:"plugin"`

	Dir        string `toml:"-" json:"dir"`
	LinkTarget string `toml:"-" json:"link_target,omitempty"`
}

func InstallPath

func InstallPath(sourceDir, pluginDir string) (Manifest, error)

func InstallPathWithOptions

func InstallPathWithOptions(sourceDir, pluginDir string, opts InstallOptions) (Manifest, error)

func InstallSourceWithOptions

func InstallSourceWithOptions(source, pluginDir string, opts InstallOptions) (Manifest, error)

func InstallSourceWithOptionsContext added in v0.12.0

func InstallSourceWithOptionsContext(ctx context.Context, source, pluginDir string, opts InstallOptions) (Manifest, error)

func LinkPath added in v0.12.0

func LinkPath(sourceDir, pluginDir string, opts InstallOptions) (Manifest, error)

func LoadManifest

func LoadManifest(path string) (Manifest, error)

type ManifestIssue

type ManifestIssue struct {
	Path string `json:"path"`
	Err  error  `json:"-"`
}

func (ManifestIssue) Error

func (i ManifestIssue) Error() string

Jump to

Keyboard shortcuts

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