plugin

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindSignal  = pub.KindSignal
	KindFilter  = pub.KindFilter
	KindAction  = pub.KindAction
	KindView    = pub.KindView
	KindTheme   = pub.KindTheme
	KindContext = pub.KindContext
)
View Source
const (
	CapQuery     = pub.CapQuery
	CapAction    = pub.CapAction
	CapStream    = pub.CapStream
	CapScheduled = pub.CapScheduled
	CapCacheable = pub.CapCacheable
	CapDetail    = pub.CapDetail
)
View Source
const (
	KindLogin  = pub.KindLogin
	KindBackup = pub.KindBackup
)

Variables

This section is empty.

Functions

func ActionUIVisible

func ActionUIVisible(signal, name string) bool

func ApplyRoleContexts

func ApplyRoleContexts(ctx context.Context, bindings map[string]string) error

func BackupDestinationOwner

func BackupDestinationOwner(name string) (string, bool)

func BackupDestinations

func BackupDestinations() []string

func BuilderSignals

func BuilderSignals() map[string]bool

func ClearInstalled

func ClearInstalled(id string) error

func CollectStatusContributions

func CollectStatusContributions(home, role string) []glyph.StatusContribution

func ContextTools

func ContextTools() []string

func DataPaths

func DataPaths(home string) []string

func DiagnosticLines

func DiagnosticLines() []string

DiagnosticLines renders one line per diagnostic, ready to append to a `plugins list` listing.

func Enabled

func Enabled(id string) bool

func FilterNames

func FilterNames() []string

func HasBuilder

func HasBuilder(signal string) bool

func HasCapability

func HasCapability(signal string, cap Capability) bool

func HasContextProvider

func HasContextProvider(tool string) bool

func HasDiagnostics

func HasDiagnostics() bool

func HasFilter

func HasFilter(name string) bool

func HasFilterEngine

func HasFilterEngine(name string) bool

func HasFilterKeywords

func HasFilterKeywords(name string) bool

func HasStreamBuilder

func HasStreamBuilder(signal string) bool

func HasTheme

func HasTheme(key string) bool

func HasView

func HasView(viewID string) bool

func Installed

func Installed(id string) bool

func IsInternal

func IsInternal(id string) bool

func KVNamespacePrefix

func KVNamespacePrefix(ownerID string) string

KVNamespacePrefix is the namespace prefix owned by ownerID. "/" is stripped from the id so no owner's prefix can contain the separator, and therefore no owner can address another owner's namespaces.

func KnownRefs

func KnownRefs(kind Kind) map[string]bool

func KnownSignals

func KnownSignals() map[string]bool

func ListEnabled

func ListEnabled() []struct {
	ID      string
	Enabled bool
}

func ListInstalled

func ListInstalled() []struct {
	ID      string
	Enabled bool
}

func LoadEnabled

func LoadEnabled()

func LookupFilter

func LookupFilter(name string) (filter.Filter, bool)

func LookupFilterKeywords

func LookupFilterKeywords(name string) (map[string]string, bool)

func LookupStatusContribution

func LookupStatusContribution(pluginID, home, role string) (glyph.StatusContribution, bool)

func MarkInstalled

func MarkInstalled(id string) error

func NoteDiagnostic

func NoteDiagnostic(pluginID string, kind Kind, ref, message string)

func OwnerID

func OwnerID(d Descriptor) string

func ParamSignals

func ParamSignals() []string

func PluginsDir

func PluginsDir(home string) string

func Register

func Register(d Descriptor)

func RegisterAction

func RegisterAction(signal, name string, run ActionFunc, opts ...Option)

func RegisterBackupDestination

func RegisterBackupDestination(pluginID, name string, open BackupDestinationFunc)

func RegisterBuilders

func RegisterBuilders(signal string, b Builders)

func RegisterBuiltins

func RegisterBuiltins()

func RegisterContext

func RegisterContext(parentID string, p ContextProvider)

func RegisterContextProvider

func RegisterContextProvider(p ContextProvider)

func RegisterDataPath

func RegisterDataPath(fn func(home string) string)

func RegisterFilter

func RegisterFilter(parentID string, f filter.Filter)

func RegisterFilterEngine

func RegisterFilterEngine(parentID, name string, fn FilterFunc)

func RegisterFilterKeywords

func RegisterFilterKeywords(parentID, name string, fn KeywordsFunc)

func RegisterLoginProvider

func RegisterLoginProvider(p LoginProvider)

func RegisterQueryParams

func RegisterQueryParams(signal string, specs ...ParamSpec)

func RegisterSeeds

func RegisterSeeds(pluginID string, files []FileSeed)

func RegisterSignal

func RegisterSignal(d Descriptor, b Builders)

func RegisterStatusContribution

func RegisterStatusContribution(pluginID string, f StatusFactory)

func RegisterTheme

func RegisterTheme(parentID, key, displayName string, p theme.Palette)

func RegisterView

func RegisterView(parentID, viewID string, ctor func() deck.View, opts ...Option)

func ResetBackupDestinations

func ResetBackupDestinations()

func ResetDiagnostics

func ResetDiagnostics()

func ResetLoginProviders

func ResetLoginProviders()

func ResetQueryParams

func ResetQueryParams()

func RunAction

func RunAction(ctx context.Context, signal, name string, params map[string]string) error

func RunScheduled

func RunScheduled(ctx context.Context, jobs []Scheduled, onFire func(name string, sections []signals.Section) error) error

func ScopeKV

func ScopeKV(raw stream.KV, ownerID string) stream.KV

ScopeKV confines a raw stream.KV handle to one plugin's own namespaces via stream.ScopedKV. Callers that hand a KV to plugin code must scope it first, or the plugin could read or wipe another signal's persisted cursors.

func SeedPluginIDs

func SeedPluginIDs() []string

func ServiceAttached

func ServiceAttached() bool

func ServiceAttachedAt

func ServiceAttachedAt(home string) bool

func SetEnabled

func SetEnabled(id string, on bool) error

func Setting

func Setting(settings map[string]any, key, def string) string

func SettingBool

func SettingBool(settings map[string]any, key string, def bool) bool

func SettingInt

func SettingInt(settings map[string]any, key string, def int) int

func SettingList

func SettingList(settings map[string]any, key string) []string

func SignalEnabled

func SignalEnabled(signal string) bool

func SplitActionRef

func SplitActionRef(ref string) (signal, name string, ok bool)

func StatusContributionIDs

func StatusContributionIDs() []string

func SwitchContext

func SwitchContext(ctx context.Context, tool, name string) error

func UIVisible

func UIVisible(d Descriptor) bool

func ValidKind

func ValidKind(k Kind) bool

func ViewUIVisible

func ViewUIVisible(viewID string) bool

Types

type Action

type Action = pub.Action

type ActionFunc

type ActionFunc = pub.ActionFunc

type ActionSpec

type ActionSpec = pub.ActionSpec

func ActionsFor

func ActionsFor(signal string) []ActionSpec

func LookupAction

func LookupAction(signal, name string) (ActionSpec, bool)

type BackupDestination

type BackupDestination = pub.BackupDestination

type BackupDestinationFunc

type BackupDestinationFunc = pub.BackupDestinationFunc

func LookupBackupDestination

func LookupBackupDestination(name string) (BackupDestinationFunc, bool)

type BuildContext

type BuildContext = pub.BuildContext

type Builders

type Builders = pub.Builders

func LookupBuilders

func LookupBuilders(signal string) (Builders, bool)

type Capability

type Capability = pub.Capability

type Chip

type Chip = pub.Chip

type Context

type Context = pub.Context

func CurrentContext

func CurrentContext(ctx context.Context, tool string) (Context, bool)

func ListContexts

func ListContexts(ctx context.Context) []Context

type ContextProvider

type ContextProvider = pub.ContextProvider

type Credential

type Credential = pub.Credential

type CredentialStore

type CredentialStore = pub.CredentialStore

type Descriptor

type Descriptor = pub.Descriptor

func All

func All() []Descriptor

func AllOfKind

func AllOfKind(kind Kind) []Descriptor

func ByKind

func ByKind(kind Kind, ref string) (Descriptor, bool)

func BySignal

func BySignal(signal string) (Descriptor, bool)

func Lookup

func Lookup(id string) (Descriptor, bool)

func Primaries

func Primaries() []Descriptor

type DetailSection

type DetailSection = pub.DetailSection

type Detailer

type Detailer = pub.Detailer

type Diagnostic

type Diagnostic = pub.Diagnostic

func Diagnostics

func Diagnostics() []Diagnostic

Diagnostics returns every contribution the registry skipped or degraded. A skipped contribution is absent from the registry, so `plugins enable`, `plugins disable` and `plugins install` all answer "unknown plugin" for it: listings are the only place a user can be told it exists at all.

func DiagnosticsFor

func DiagnosticsFor(pluginID string) []Diagnostic

type FileSeed

type FileSeed = pub.FileSeed

func SeedsFor

func SeedsFor(pluginID string) []FileSeed

type FilterFunc

type FilterFunc = pub.FilterFunc

func LookupFilterEngine

func LookupFilterEngine(name string) (FilterFunc, bool)

type FilterRule

type FilterRule = pub.FilterRule

type Host

type Host = pub.Host

func HostOf

func HostOf(bc BuildContext) (Host, bool)

type InstallCandidate

type InstallCandidate struct {
	ID          string
	Label       string
	Desc        string
	Source      string
	LocalDir    string
	Seeds       []FileSeed
	Installable bool
	Reason      string
}

func ListInstallCandidates

func ListInstallCandidates(home string) ([]InstallCandidate, error)

type InstallOptions

type InstallOptions struct {
	Force bool
}

type InstallResult

type InstallResult struct {
	PluginID  string
	Installed bool
	Enabled   bool
	Written   []string
	Skipped   []string
}

func Install

func Install(home, id string, opts InstallOptions) (InstallResult, error)

func InstallCandidateEntry

func InstallCandidateEntry(home string, c InstallCandidate, opts InstallOptions) (InstallResult, error)

type ItemDetail

type ItemDetail = pub.ItemDetail

type KV

type KV = pub.KV

func KVOf

func KVOf(bc BuildContext) KV

type KeywordsFunc

type KeywordsFunc = pub.KeywordsFunc

type Kind

type Kind = pub.Kind

func KnownKinds

func KnownKinds() []Kind

type LocalPlugin

type LocalPlugin struct {
	ID          string
	Name        string
	Dir         string
	Description string
	Seeds       []FileSeed
	Registered  bool
	Installable bool
	Reason      string
}

func DiscoverLocal

func DiscoverLocal(home string) ([]LocalPlugin, error)

type LoginField

type LoginField = pub.LoginField

type LoginProvider

type LoginProvider = pub.LoginProvider

func LoginProviders

func LoginProviders() []LoginProvider

func LookupLoginProvider

func LookupLoginProvider(key string) (LoginProvider, bool)

type NamedFilter

type NamedFilter = pub.NamedFilter

type Option

type Option = pub.Option

func WithServiceOnly

func WithServiceOnly() Option

type ParamSpec

type ParamSpec = pub.ParamSpec

func QueryParams

func QueryParams(signal string) []ParamSpec

type Query

type Query = pub.Query

func BuildQuery

func BuildQuery(signal string, bc BuildContext) (Query, error)

type QueryFunc

type QueryFunc = pub.QueryFunc

type Scheduled

type Scheduled = pub.Scheduled

type ScheduledAck

type ScheduledAck interface {
	Ack(ctx context.Context, sections []signals.Section) error
}

type StatusEntry

type StatusEntry = pub.StatusEntry

func CollectStatusEntries

func CollectStatusEntries(home, role string) []StatusEntry

type StatusFactory

type StatusFactory = pub.StatusFactory

type Stream

type Stream = pub.Stream

func BuildStream

func BuildStream(signal string, bc BuildContext) (Stream, error)

type StreamFunc

type StreamFunc = pub.StreamFunc

type TokenSource

type TokenSource = pub.TokenSource

type UninstallOptions

type UninstallOptions struct {
	KeepSeeds bool
	Force     bool
}

type UninstallResult

type UninstallResult struct {
	PluginID    string
	Uninstalled bool
	Disabled    bool
	Removed     []string
	Kept        []string
}

func Uninstall

func Uninstall(home, id string, opts UninstallOptions) (UninstallResult, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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