plugin

package
v0.1.0-pre Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package plugin defines the plugin aggregate — loadable extensions that provide triggers and actions.

Index

Constants

This section is empty.

Variables

View Source
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

func KnownActionNames(plugins []*Plugin) []string

KnownActionNames returns every action name declared by any plugin, prepended with the built-in action names.

func KnownTriggerNames

func KnownTriggerNames(plugins []*Plugin) []string

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

type TriggerType struct {
	Name     string
	Defaults map[string]any
}

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.

Jump to

Keyboard shortcuts

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