Documentation
¶
Overview ¶
Package plugin defines the plugin aggregate — loadable extensions that provide triggers and actions.
Index ¶
- Variables
- func KnownActionNames(plugins []*Plugin) []string
- func KnownTriggerNames(plugins []*Plugin) []string
- func TriggerDefaultsFor(plugins []*Plugin, triggerType string) (namespace string, defaults map[string]any)
- func UnknownTypes(plugins []*Plugin, triggers, actions []string) (unknownTriggers, unknownActions []string)
- type ActionType
- type Option
- type OptionType
- type Plugin
- type TriggerType
Constants ¶
This section is empty.
Variables ¶
var BuiltinActionNames = []string{"shell"}
BuiltinActionNames lists action types the daemon provides out of the box, without any installed plugin. Currently just the shell action.
Functions ¶
func KnownActionNames ¶
KnownActionNames returns every action name declared by any plugin, prepended with the built-in action names.
func KnownTriggerNames ¶
KnownTriggerNames returns every trigger name declared by any plugin. Order matches the input plugin order; within a plugin, manifest order.
func TriggerDefaultsFor ¶
func TriggerDefaultsFor(plugins []*Plugin, triggerType string) (namespace string, defaults map[string]any)
TriggerDefaultsFor returns the namespace of the plugin that owns the given trigger type and that trigger's manifest-declared engine-level defaults. The namespace is returned even when defaults is empty so callers can still look up daemon-level overrides keyed by that namespace (eg. plugins.<namespace>.trigger_defaults in the daemon config).
Returns ("", nil) if no plugin owns the type.
The first match wins, so if two plugins declare the same trigger name (a conflict that infra/plugin.CheckConflicts flags at startup), the earlier plugin in the slice provides the defaults.
func UnknownTypes ¶
func UnknownTypes(plugins []*Plugin, triggers, actions []string) (unknownTriggers, unknownActions []string)
UnknownTypes returns the subset of trigger/action names not declared by any plugin (or by the built-in action list). Comparison is case-insensitive. The result preserves input order so the caller can emit error messages in the order the user provided.
Types ¶
type ActionType ¶
type ActionType struct {
Name string
}
ActionType is the domain projection of one action declared by a plugin.
type Option ¶
type Option struct {
Name string
Type OptionType
Default any
Description string
Shorthand bool
}
Option defines a configurable option exposed by a trigger or action.
type OptionType ¶
type OptionType string
OptionType represents the type of a plugin option value.
const ( TypeString OptionType = "string" TypeBool OptionType = "bool" TypeNumber OptionType = "number" TypeList OptionType = "list" TypeMap OptionType = "map" )
type Plugin ¶
type Plugin struct {
ID string
Name string
Namespace string
Version string
Description string
Triggers []TriggerType
Actions []ActionType
}
Plugin is the domain projection of a discovered plugin's manifest. It carries the metadata fields plus the trigger and action types the plugin declares. Lookup helpers (UnknownTypes, TriggerDefaultsFor, …) operate on slices of *Plugin.
type TriggerType ¶
TriggerType is the domain projection of one trigger declared by a plugin. Defaults carries the manifest's per-trigger engine-level defaults (concurrency_mode, max_queue_size, debounce, error_threshold, action_error_threshold) that feed the precedence chain inside domain/recurfile.BuildTriggerSettings.