Documentation ¶
Index ¶
- type AbortArgs
- type Response
- type RpcStepPlugin
- type RunArgs
- type StepPlugin
- type StepPluginRPC
- func (g *StepPluginRPC) Abort(rollout *v1alpha1.Rollout, context *types.RpcStepContext) (types.RpcStepResult, types.RpcError)
- func (g *StepPluginRPC) InitPlugin() types.RpcError
- func (g *StepPluginRPC) Run(rollout *v1alpha1.Rollout, context *types.RpcStepContext) (types.RpcStepResult, types.RpcError)
- func (g *StepPluginRPC) Terminate(rollout *v1alpha1.Rollout, context *types.RpcStepContext) (types.RpcStepResult, types.RpcError)
- func (g *StepPluginRPC) Type() string
- type StepRPCServer
- func (s *StepRPCServer) Abort(args any, resp *Response) error
- func (s *StepRPCServer) InitPlugin(args any, resp *types.RpcError) error
- func (s *StepRPCServer) Run(args any, resp *Response) error
- func (s *StepRPCServer) Terminate(args any, resp *Response) error
- func (s *StepRPCServer) Type(args any, resp *string) error
- type TerminateArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RpcStepPlugin ¶
type RpcStepPlugin struct { // Impl Injection Impl StepPlugin }
RpcStepPlugin This is the implementation of plugin.Plugin so we can serve/consume
This has two methods: Server must return an RPC server for this plugin type. We construct a StepRPCServer for this.
Client must return an implementation of our interface that communicates over an RPC client. We return StepPluginRPC for this.
Ignore MuxBroker. That is used to create more multiplexed streams on our plugin connection and is a more advanced use case.
func (RpcStepPlugin) Client ¶
func (RpcStepPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (any, error)
func (*RpcStepPlugin) Server ¶
func (p *RpcStepPlugin) Server(*plugin.MuxBroker) (any, error)
type StepPlugin ¶
StepPlugin is the interface that we're exposing as a plugin. It needs to match metricproviders.Providers but we can not import that package because it would create a circular dependency.
type StepPluginRPC ¶
type StepPluginRPC struct {
// contains filtered or unexported fields
}
StepPluginRPC Here is an implementation that talks over RPC
func (*StepPluginRPC) Abort ¶
func (g *StepPluginRPC) Abort(rollout *v1alpha1.Rollout, context *types.RpcStepContext) (types.RpcStepResult, types.RpcError)
Abort reverts previous operation executed by the step if necessary
func (*StepPluginRPC) InitPlugin ¶
func (g *StepPluginRPC) InitPlugin() types.RpcError
InitPlugin is the client aka the controller side function that calls the server side rpc (plugin) this gets called once during startup of the plugin and can be used to set up informers, k8s clients, etc.
func (*StepPluginRPC) Run ¶
func (g *StepPluginRPC) Run(rollout *v1alpha1.Rollout, context *types.RpcStepContext) (types.RpcStepResult, types.RpcError)
Run executes the step
func (*StepPluginRPC) Terminate ¶
func (g *StepPluginRPC) Terminate(rollout *v1alpha1.Rollout, context *types.RpcStepContext) (types.RpcStepResult, types.RpcError)
Terminate stops the execution of a running step and exits early
func (*StepPluginRPC) Type ¶
func (g *StepPluginRPC) Type() string
Type returns the type of the traffic routing reconciler
type StepRPCServer ¶
type StepRPCServer struct { // This is the real implementation Impl StepPlugin }
StepRPCServer Here is the RPC server that MetricsPluginRPC talks to, conforming to the requirements of net/rpc
func (*StepRPCServer) Abort ¶
func (s *StepRPCServer) Abort(args any, resp *Response) error
Abort reverts previous operation executed by the step if necessary
func (*StepRPCServer) InitPlugin ¶
func (s *StepRPCServer) InitPlugin(args any, resp *types.RpcError) error
InitPlugin this is the server aka the controller side function that receives calls from the client side rpc (controller) this gets called once during startup of the plugin and can be used to set up informers or k8s clients etc.
func (*StepRPCServer) Run ¶
func (s *StepRPCServer) Run(args any, resp *Response) error
Run executes the step
type TerminateArgs ¶
type TerminateArgs struct { Rollout *v1alpha1.Rollout Context *types.RpcStepContext }