Documentation
¶
Overview ¶
Package internal implements the workflow-plugin-audit-chain plugin.
Index ¶
- Variables
- func NewPlugin() sdk.PluginProvider
- type AuditChainPlugin
- func (p *AuditChainPlugin) ContractRegistry() *pb.ContractRegistry
- func (p *AuditChainPlugin) CreateModule(typeName, _ string, _ map[string]any) (sdk.ModuleInstance, error)
- func (p *AuditChainPlugin) CreateStep(typeName, _ string, _ map[string]any) (sdk.StepInstance, error)
- func (p *AuditChainPlugin) CreateTrigger(typeName string, config map[string]any, cb sdk.TriggerCallback) (sdk.TriggerInstance, error)
- func (p *AuditChainPlugin) CreateTypedModule(typeName, name string, config *anypb.Any) (sdk.ModuleInstance, error)
- func (p *AuditChainPlugin) CreateTypedStep(typeName, name string, config *anypb.Any) (sdk.StepInstance, error)
- func (p *AuditChainPlugin) Manifest() sdk.PluginManifest
- func (p *AuditChainPlugin) ModuleTypes() []string
- func (p *AuditChainPlugin) StepTypes() []string
- func (p *AuditChainPlugin) TriggerTypes() []string
- func (p *AuditChainPlugin) TypedModuleTypes() []string
- func (p *AuditChainPlugin) TypedStepTypes() []string
Constants ¶
This section is empty.
Variables ¶
var Version = "0.0.0"
Version is set at build time via -ldflags "-X github.com/GoCodeAlone/workflow-plugin-audit-chain/internal.Version=X.Y.Z". Default is a bare semver so plugin loaders that validate semver accept unreleased dev builds; goreleaser overrides with the real release tag.
Functions ¶
func NewPlugin ¶
func NewPlugin() sdk.PluginProvider
NewPlugin returns a new plugin instance. main.go calls sdk.Serve(NewPlugin()).
Types ¶
type AuditChainPlugin ¶
type AuditChainPlugin struct{}
AuditChainPlugin implements sdk.PluginProvider, sdk.TypedModuleProvider, and sdk.TypedStepProvider. Zero map[string]any in plugin code: all module and step boundaries use typed proto messages (anypb.Any).
func (*AuditChainPlugin) ContractRegistry ¶ added in v0.2.1
func (p *AuditChainPlugin) ContractRegistry() *pb.ContractRegistry
ContractRegistry returns the typed contract descriptors for every module and step served by this plugin. The workflow engine calls this via the sdk.ContractProvider interface to decode typed configs from YAML into the correct proto message before dispatching CreateTypedModule / CreateTypedStep.
Without this method the engine has TypedModuleProvider/TypedStepProvider registration but no proto descriptor map, so it passes nil config and the plugin fails validation at module Init / step Execute time (Bug 3).
func (*AuditChainPlugin) CreateModule ¶
func (p *AuditChainPlugin) CreateModule(typeName, _ string, _ map[string]any) (sdk.ModuleInstance, error)
CreateModule satisfies the legacy sdk.ModuleProvider interface. Returns "not yet implemented" for known types (encouraging upgrade to typed path) and "unknown module type" for unrecognised types.
func (*AuditChainPlugin) CreateStep ¶
func (p *AuditChainPlugin) CreateStep(typeName, _ string, _ map[string]any) (sdk.StepInstance, error)
CreateStep satisfies the legacy sdk.StepProvider interface. The gRPC server prefers TypedStepProvider, so this path is only reached by engines that do not support typed steps.
func (*AuditChainPlugin) CreateTrigger ¶
func (p *AuditChainPlugin) CreateTrigger(typeName string, config map[string]any, cb sdk.TriggerCallback) (sdk.TriggerInstance, error)
CreateTrigger creates a trigger instance of the given type.
func (*AuditChainPlugin) CreateTypedModule ¶
func (p *AuditChainPlugin) CreateTypedModule(typeName, name string, config *anypb.Any) (sdk.ModuleInstance, error)
CreateTypedModule creates a module instance from a typed proto config. No map[string]any is used; config is unpacked directly into the target proto.
func (*AuditChainPlugin) CreateTypedStep ¶
func (p *AuditChainPlugin) CreateTypedStep(typeName, name string, config *anypb.Any) (sdk.StepInstance, error)
CreateTypedStep creates a typed step instance. Each factory handles exactly one type; the first match wins. Unknown types return "unknown step type".
func (*AuditChainPlugin) Manifest ¶
func (p *AuditChainPlugin) Manifest() sdk.PluginManifest
Manifest returns the plugin metadata used by the workflow engine for discovery and capability negotiation.
func (*AuditChainPlugin) ModuleTypes ¶
func (p *AuditChainPlugin) ModuleTypes() []string
ModuleTypes satisfies the legacy sdk.ModuleProvider interface. The gRPC server calls TypedModuleProvider first, so this is only reached if the engine does not support typed modules.
func (*AuditChainPlugin) StepTypes ¶
func (p *AuditChainPlugin) StepTypes() []string
StepTypes returns the step type names this plugin provides. Satisfies the legacy sdk.StepProvider interface; TypedStepProvider is preferred by the gRPC server.
func (*AuditChainPlugin) TriggerTypes ¶
func (p *AuditChainPlugin) TriggerTypes() []string
TriggerTypes returns the trigger type names this plugin provides.
func (*AuditChainPlugin) TypedModuleTypes ¶
func (p *AuditChainPlugin) TypedModuleTypes() []string
TypedModuleTypes returns the module type names this plugin provides. The gRPC server prefers TypedModuleProvider over the legacy ModuleProvider.
func (*AuditChainPlugin) TypedStepTypes ¶
func (p *AuditChainPlugin) TypedStepTypes() []string
TypedStepTypes returns the step type names served via the typed gRPC path.