Documentation
¶
Index ¶
- Constants
- func ActionUIVisible(signal, name string) bool
- func ApplyRoleContexts(ctx context.Context, bindings map[string]string) error
- func BackupDestinationOwner(name string) (string, bool)
- func BackupDestinations() []string
- func BuilderSignals() map[string]bool
- func CollectStatusContributions(home, role string) []glyph.StatusContribution
- func ContextTools() []string
- func FilterNames() []string
- func Guarded(pluginID string, register func())
- func HasBuilder(signal string) bool
- func HasCapability(signal string, cap Capability) bool
- func HasContextProvider(tool string) bool
- func HasDiagnostics() bool
- func HasFilter(name string) bool
- func HasFilterEngine(name string) bool
- func HasFilterKeywords(name string) bool
- func HasScheduledBuilder(signal string) bool
- func HasStreamBuilder(signal string) bool
- func HasTheme(key string) bool
- func HasView(viewID string) bool
- func IsInternal(id string) bool
- func KnownRefs(kind Kind) map[string]bool
- func KnownSignals() map[string]bool
- func LookupFilterKeywords(name string) (map[string]string, bool)
- func LookupStatusContribution(pluginID, home, role string) (glyph.StatusContribution, bool)
- func NoteDiagnostic(pluginID string, kind Kind, ref, message string)
- func OwnerID(d Descriptor) string
- func ParamSignals() []string
- func Register(d Descriptor)
- func RegisterAction(signal, name string, run ActionFunc, opts ...Option)
- func RegisterBackupDestination(pluginID, name string, open BackupDestinationFunc)
- func RegisterBuilders(signal string, b Builders)
- func RegisterContext(parentID string, p ContextProvider)
- func RegisterContextProvider(p ContextProvider)
- func RegisterFilter(parentID string, f NamedFilter)
- func RegisterFilterEngine(parentID, name string, fn FilterFunc)
- func RegisterFilterKeywords(parentID, name string, fn KeywordsFunc)
- func RegisterLoginProvider(p LoginProvider)
- func RegisterQueryParams(signal string, specs ...ParamSpec)
- func RegisterSeeds(pluginID string, files []FileSeed)
- func RegisterSignal(d Descriptor, b Builders)
- func RegisterStatusContribution(pluginID string, f StatusFactory)
- func RegisterTheme(parentID, key, displayName string, p theme.Palette)
- func RegisterView(parentID, viewID string, ctor func() deck.View, opts ...Option)
- func RegistrationCheckpoint() (pluginID string, seen uint64)
- func ResetBackupDestinations()
- func ResetContextProvidersForTest()
- func ResetDiagnostics()
- func ResetLoginProviders()
- func ResetQueryParams()
- func RunAction(ctx context.Context, signal, name string, params map[string]string) error
- func ScheduledSignals() []string
- func SeedPluginIDs() []string
- func ServiceAttached() bool
- func SetPluginEnabledFunc(fn func(id string) bool)
- func SetServiceAttachedFunc(fn func() bool)
- func SetSignalEnabledFunc(fn func(signal string) bool)
- func Setting(settings map[string]any, key, def string) string
- func SettingBool(settings map[string]any, key string, def bool) bool
- func SettingDuration(settings map[string]any, key string, def time.Duration) time.Duration
- func SettingInt(settings map[string]any, key string, def int) int
- func SettingList(settings map[string]any, key string) []string
- func SettingsOf(bc BuildContext, namespace string) map[string]any
- func SplitActionRef(ref string) (signal, name string, ok bool)
- func StatusContributionIDs() []string
- func SwitchContext(ctx context.Context, tool, name string) error
- func UIVisible(d Descriptor) bool
- func ValidKind(k Kind) bool
- func ViewUIVisible(viewID string) bool
- type Action
- type ActionFunc
- type ActionSpec
- type BackupDestination
- type BackupDestinationFunc
- type BuildContext
- type Builders
- type Capability
- type Chip
- type Context
- type ContextProvider
- type Credential
- type CredentialStore
- type Descriptor
- type DetailSection
- type Detailer
- type Diagnostic
- type Error
- type Event
- type FileSeed
- type FilterFunc
- type FilterRule
- type Host
- type Item
- type ItemDetail
- type KV
- type KeywordsFunc
- type Kind
- type LoginField
- type LoginProvider
- type NamedFilter
- type Option
- type ParamSpec
- type Query
- type QueryFunc
- type Scheduled
- type ScheduledFunc
- type Section
- type StatusEntry
- type StatusFactory
- type Stream
- type StreamFunc
- type TokenSource
Constants ¶
const ( MetaTruncated = "truncated" MetaMore = "more" )
const InternalPrefix = "mino."
Variables ¶
This section is empty.
Functions ¶
func ActionUIVisible ¶
func ApplyRoleContexts ¶
func BackupDestinationOwner ¶
func BackupDestinations ¶
func BackupDestinations() []string
func BuilderSignals ¶
func CollectStatusContributions ¶
func CollectStatusContributions(home, role string) []glyph.StatusContribution
func ContextTools ¶
func ContextTools() []string
func FilterNames ¶
func FilterNames() []string
func Guarded ¶
func Guarded(pluginID string, register func())
Guarded runs one plugin's registration behind its own recover so a panic in that plugin's code becomes a diagnostic instead of truncating every plugin that would have registered after it. Compose a host's RegisterPlugins hook out of Guarded calls to get per-plugin containment.
func HasBuilder ¶
func HasCapability ¶
func HasCapability(signal string, cap Capability) bool
func HasContextProvider ¶
func HasDiagnostics ¶
func HasDiagnostics() bool
func HasFilterEngine ¶
func HasFilterKeywords ¶
func HasScheduledBuilder ¶
func HasStreamBuilder ¶
func IsInternal ¶
func KnownSignals ¶
func LookupStatusContribution ¶
func LookupStatusContribution(pluginID, home, role string) (glyph.StatusContribution, bool)
func NoteDiagnostic ¶
func OwnerID ¶
func OwnerID(d Descriptor) string
func ParamSignals ¶
func ParamSignals() []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 ¶
RegisterBuilders is the standalone route: the caller registered its Descriptor separately, so the owning plugin is resolved from the signal.
func RegisterContext ¶
func RegisterContext(parentID string, p ContextProvider)
func RegisterContextProvider ¶
func RegisterContextProvider(p ContextProvider)
RegisterContextProvider installs a live provider for its tool. Like every other registration site it is first-write-wins: the incumbent keeps the tool and the later provider is skipped with a diagnostic, so a plugin can never take over a tool another plugin already owns.
func RegisterFilter ¶
func RegisterFilter(parentID string, f NamedFilter)
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 RegisterSeeds ¶
func RegisterSignal ¶
func RegisterSignal(d Descriptor, b Builders)
func RegisterStatusContribution ¶
func RegisterStatusContribution(pluginID string, f StatusFactory)
func RegisterTheme ¶
func RegisterView ¶
func RegistrationCheckpoint ¶
RegistrationCheckpoint reports the owner id of the most recent contribution offered to the registry and how many contributions have been offered so far. Compare seen across a registration callback to tell whether the plugin named by pluginID was the one that failed.
func ResetBackupDestinations ¶
func ResetBackupDestinations()
func ResetContextProvidersForTest ¶
func ResetContextProvidersForTest()
func ResetDiagnostics ¶
func ResetDiagnostics()
func ResetLoginProviders ¶
func ResetLoginProviders()
func ResetQueryParams ¶
func ResetQueryParams()
func ScheduledSignals ¶
func ScheduledSignals() []string
func SeedPluginIDs ¶
func SeedPluginIDs() []string
func ServiceAttached ¶
func ServiceAttached() bool
func SetPluginEnabledFunc ¶
func SetServiceAttachedFunc ¶
func SetServiceAttachedFunc(fn func() bool)
func SetSignalEnabledFunc ¶
func SettingDuration ¶
func SettingsOf ¶
func SettingsOf(bc BuildContext, namespace string) map[string]any
func SplitActionRef ¶
func StatusContributionIDs ¶
func StatusContributionIDs() []string
func UIVisible ¶
func UIVisible(d Descriptor) bool
func ViewUIVisible ¶
Types ¶
type ActionSpec ¶
type ActionSpec struct {
Signal string
Name string
Run ActionFunc
}
func ActionsFor ¶
func ActionsFor(signal string) []ActionSpec
func LookupAction ¶
func LookupAction(signal, name string) (ActionSpec, bool)
type BackupDestination ¶
type BackupDestinationFunc ¶
type BackupDestinationFunc func(h Host) (BackupDestination, error)
func LookupBackupDestination ¶
func LookupBackupDestination(name string) (BackupDestinationFunc, bool)
type BuildContext ¶
type Builders ¶
type Builders struct {
Query QueryFunc
Stream StreamFunc
Scheduled ScheduledFunc
}
func LookupBuilders ¶
type Capability ¶
type Capability string
const ( CapQuery Capability = "query" CapAction Capability = "action" CapStream Capability = "stream" CapScheduled Capability = "scheduled" // CapCacheable marks a signal whose Fetch results are worth caching between runs. // Signals reading local state should omit it so writes show up immediately. CapCacheable Capability = "cacheable" CapDetail Capability = "detail" )
type Context ¶
func ListContexts ¶
type ContextProvider ¶
type Credential ¶
type CredentialStore ¶
type CredentialStore interface {
Get(ctx context.Context, service string) (Credential, bool, error)
Put(ctx context.Context, service string, c Credential) error
Delete(ctx context.Context, service string) error
}
func CredentialsOf ¶
func CredentialsOf(bc BuildContext) CredentialStore
type Descriptor ¶
type Descriptor struct {
ID string
Kind Kind
Capabilities []Capability
Signal string
Ref string
Parent string
ServiceOnly bool
Credentials []string
SettingsNamespaces []string
}
func All ¶
func All() []Descriptor
func AllOfKind ¶
func AllOfKind(kind Kind) []Descriptor
func BySignal ¶
func BySignal(signal string) (Descriptor, bool)
func Lookup ¶
func Lookup(id string) (Descriptor, bool)
func Primaries ¶
func Primaries() []Descriptor
type DetailSection ¶
type Diagnostic ¶
func Diagnostics ¶
func Diagnostics() []Diagnostic
func DiagnosticsFor ¶
func DiagnosticsFor(pluginID string) []Diagnostic
func (Diagnostic) String ¶
func (d Diagnostic) String() string
type FilterFunc ¶
func LookupFilterEngine ¶
func LookupFilterEngine(name string) (FilterFunc, bool)
type FilterRule ¶
type Host ¶
type Host interface {
Home() string
Role() string
Settings(namespace string) map[string]any
Credentials() CredentialStore
}
func HostOf ¶
func HostOf(bc BuildContext) (Host, bool)
type ItemDetail ¶
type ItemDetail struct {
Kind string `json:"kind,omitempty"`
Title string `json:"title"`
URL string `json:"url,omitempty"`
Chips []Chip `json:"chips,omitempty"`
Rows [][2]string `json:"rows,omitempty"`
Body string `json:"body,omitempty"`
Sections []DetailSection `json:"sections,omitempty"`
Meta map[string]string `json:"meta,omitempty"`
}
type KeywordsFunc ¶
type Kind ¶
type Kind string
const KindBackup Kind = "backup"
const KindLogin Kind = "login"
func KnownKinds ¶
func KnownKinds() []Kind
type LoginField ¶
type LoginProvider ¶
type LoginProvider struct {
PluginID string
Key string
Label string
Signals []string
Fields []LoginField
Authed func(Host) bool
Login func(ctx context.Context, h Host, creds map[string]string, w io.Writer) error
}
func LoginProviders ¶
func LoginProviders() []LoginProvider
func LookupLoginProvider ¶
func LookupLoginProvider(key string) (LoginProvider, bool)
type NamedFilter ¶
type NamedFilter struct {
Name string `yaml:"name" json:"name"`
Rules []FilterRule `yaml:"rules,omitempty" json:"rules,omitempty"`
Aliases map[string]string `yaml:"aliases,omitempty" json:"aliases,omitempty"`
Keywords map[string]string `yaml:"keywords,omitempty" json:"keywords,omitempty"`
}
func LookupFilter ¶
func LookupFilter(name string) (NamedFilter, bool)
type ParamSpec ¶
func QueryParams ¶
type Query ¶
func BuildQuery ¶
func BuildQuery(signal string, bc BuildContext) (Query, error)
type QueryFunc ¶
type QueryFunc func(ctx BuildContext) (Query, error)
type Scheduled ¶
type Scheduled interface {
Name() string
// Next reports when the job should next run. A zero due means nothing is
// scheduled; a due at or before now runs immediately.
Next(ctx context.Context, now time.Time) (due time.Time, err error)
Fetch(ctx context.Context) ([]Section, error)
}
func BuildScheduled ¶
func BuildScheduled(signal string, bc BuildContext) (Scheduled, error)
type ScheduledFunc ¶
type ScheduledFunc func(ctx BuildContext) (Scheduled, error)
type Section ¶
type Section struct {
Signal string `json:"signal"`
Title string `json:"title"`
Items []Item `json:"items"`
Meta map[string]string `json:"meta,omitempty"`
Err error `json:"-"`
}
func (Section) MarshalJSON ¶
func (*Section) UnmarshalJSON ¶
type StatusEntry ¶
type StatusEntry struct {
PluginID string
Contrib glyph.StatusContribution
}
func CollectStatusEntries ¶
func CollectStatusEntries(home, role string) []StatusEntry
type StatusFactory ¶
type StatusFactory func(home, role string) glyph.StatusContribution
type Stream ¶
type Stream interface {
Name() string
Stream(ctx context.Context) (<-chan Event, error)
LatencyFloor() time.Duration
}
func BuildStream ¶
func BuildStream(signal string, bc BuildContext) (Stream, error)
type StreamFunc ¶
type StreamFunc func(ctx BuildContext) (Stream, error)