Documentation
¶
Overview ¶
Package sdk provides the public API for building external workflow plugins. Plugin authors implement the interfaces defined here and call Serve() to run.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Serve ¶
func Serve(provider PluginProvider)
Serve is the entry point for plugin authors. It starts the gRPC plugin server and blocks until the host process terminates the connection.
Usage:
func main() {
sdk.Serve(&myPlugin{})
}
Types ¶
type ModuleInstance ¶
type ModuleInstance interface {
Init() error
Start(ctx context.Context) error
Stop(ctx context.Context) error
}
ModuleInstance is a remote module's lifecycle.
type ModuleProvider ¶
type ModuleProvider interface {
// ModuleTypes returns the module type names this plugin provides.
ModuleTypes() []string
// CreateModule creates a module instance of the given type.
CreateModule(typeName, name string, config map[string]any) (ModuleInstance, error)
}
ModuleProvider is optionally implemented to provide module types.
type PluginManifest ¶
PluginManifest describes the plugin.
type PluginProvider ¶
type PluginProvider interface {
// Manifest returns the plugin's metadata.
Manifest() PluginManifest
}
PluginProvider is the main interface plugin authors implement.
type StepInstance ¶
type StepInstance interface {
Execute(ctx context.Context, triggerData map[string]any, stepOutputs map[string]map[string]any, current map[string]any, metadata map[string]any) (*StepResult, error)
}
StepInstance is a remote pipeline step.
type StepProvider ¶
type StepProvider interface {
// StepTypes returns the step type names this plugin provides.
StepTypes() []string
// CreateStep creates a step instance of the given type.
CreateStep(typeName, name string, config map[string]any) (StepInstance, error)
}
StepProvider is optionally implemented to provide step types.
type StepResult ¶
StepResult is the output of a step execution.