Documentation
¶
Overview ¶
Package actionrpc is the protocol between the workflow runner and its actions. Each action runs in a process of its own, started from the probe binary, and is called over go-plugin's gRPC transport.
Index ¶
- Variables
- func LogOutcome(log hclog.Logger, subject string, ret map[string]any, err error)
- func LogParams(log hclog.Logger, msg string, with map[string]any)
- func Run(name string, with map[string]any, log hclog.Logger) (map[string]any, error)
- func Serve(newAction func(log hclog.Logger) Action)
- type Action
- type Client
- type Plugin
- type Server
Constants ¶
This section is empty.
Variables ¶
var ( // BuiltinCmd is the subcommand of the probe binary that serves an action. BuiltinCmd = "builtin-actions" // Handshake is the go-plugin handshake both sides of an action agree on. Handshake = plugin.HandshakeConfig{ProtocolVersion: 1, MagicCookieKey: "probe", MagicCookieValue: "actions"} // PluginMap is the set of plugins the runner can dispense. PluginMap = map[string]plugin.Plugin{"actions": &Plugin{}} )
Functions ¶
func LogOutcome ¶
LogOutcome records how an action finished. subject names what was attempted, for example "http request", and is used to build the message.
func LogParams ¶
LogParams records the parameters an action received, truncating long values so that a large request body does not flood the log. Actions are separate processes, so their log records reach the workflow runner as JSON on stderr and are re-filtered there by the runner's own level.
func Run ¶
Run starts the action named name from the running probe binary, calls it once with the given parameters, and stops it. The action's own log records reach log, which decides what of them is shown.
Types ¶
type Action ¶
Action is what an action implements: it runs once with the step's `with` parameters and returns its result.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client calls an Action in another process.
type Plugin ¶
Plugin serves an Action over gRPC, and is what the runner dispenses to call one.
func (*Plugin) GRPCClient ¶
func (p *Plugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (any, error)