rpc

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GarbageCollectArgs

type GarbageCollectArgs struct {
	AnalysisRun *v1alpha1.AnalysisRun
	Metric      v1alpha1.Metric
	Limit       int
}

type GetMetadataArgs

type GetMetadataArgs struct {
	Metric v1alpha1.Metric
}

type MetricProviderPlugin

type MetricProviderPlugin interface {
	InitPlugin() types.RpcError
	types.RpcMetricProvider
}

MetricProviderPlugin 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 MetricsPluginRPC

type MetricsPluginRPC struct {
	// contains filtered or unexported fields
}

MetricsPluginRPC Here is an implementation that talks over RPC

func (*MetricsPluginRPC) GarbageCollect

func (g *MetricsPluginRPC) GarbageCollect(analysisRun *v1alpha1.AnalysisRun, metric v1alpha1.Metric, limit int) types.RpcError

GarbageCollect is the client side function that is wrapped by a local provider this makes an rpc call to the server side function.

func (*MetricsPluginRPC) GetMetadata

func (g *MetricsPluginRPC) GetMetadata(metric v1alpha1.Metric) map[string]string

GetMetadata is the client side function that is wrapped by a local provider this makes an rpc call to the server side function.

func (*MetricsPluginRPC) InitPlugin

func (g *MetricsPluginRPC) InitPlugin() types.RpcError

InitPlugin is the client side function that is wrapped by a local provider this makes a rpc call to the server side function.

func (*MetricsPluginRPC) Resume

func (g *MetricsPluginRPC) Resume(analysisRun *v1alpha1.AnalysisRun, metric v1alpha1.Metric, measurement v1alpha1.Measurement) v1alpha1.Measurement

Resume is the client side function that is wrapped by a local provider this makes an rpc call to the server side function.

func (*MetricsPluginRPC) Run

Run is the client side function that is wrapped by a local provider this makes an rpc call to the server side function.

func (*MetricsPluginRPC) Terminate

func (g *MetricsPluginRPC) Terminate(analysisRun *v1alpha1.AnalysisRun, metric v1alpha1.Metric, measurement v1alpha1.Measurement) v1alpha1.Measurement

Terminate is the client side function that is wrapped by a local provider this makes an rpc call to the server side function.

func (*MetricsPluginRPC) Type

func (g *MetricsPluginRPC) Type() string

Type is the client side function that is wrapped by a local provider this makes an rpc call to the server side function.

type MetricsRPCServer

type MetricsRPCServer struct {
	// This is the real implementation
	Impl MetricProviderPlugin
}

MetricsRPCServer Here is the RPC server that MetricsPluginRPC talks to, conforming to the requirements of net/rpc

func (*MetricsRPCServer) GarbageCollect

func (s *MetricsRPCServer) GarbageCollect(args interface{}, resp *types.RpcError) error

GarbageCollect is the receiving end of the RPC call running in the plugin executable process (the server), and it calls the implementation of the plugin.

func (*MetricsRPCServer) GetMetadata

func (s *MetricsRPCServer) GetMetadata(args interface{}, resp *map[string]string) error

GetMetadata is the receiving end of the RPC call running in the plugin executable process (the server), and it calls the implementation of the plugin.

func (*MetricsRPCServer) InitPlugin

func (s *MetricsRPCServer) InitPlugin(args interface{}, resp *types.RpcError) error

InitPlugin is the receiving end of the RPC call running in the plugin executable process (the server), and it calls the implementation of the plugin.

func (*MetricsRPCServer) Resume

func (s *MetricsRPCServer) Resume(args interface{}, resp *v1alpha1.Measurement) error

Resume is the receiving end of the RPC call running in the plugin executable process (the server), and it calls the implementation of the plugin.

func (*MetricsRPCServer) Run

func (s *MetricsRPCServer) Run(args interface{}, resp *v1alpha1.Measurement) error

Run is the receiving end of the RPC call running in the plugin executable process (the server), and it calls the implementation of the plugin.

func (*MetricsRPCServer) Terminate

func (s *MetricsRPCServer) Terminate(args interface{}, resp *v1alpha1.Measurement) error

Terminate is the receiving end of the RPC call running in the plugin executable process (the server), and it calls the implementation of the plugin.

func (*MetricsRPCServer) Type

func (s *MetricsRPCServer) Type(args interface{}, resp *string) error

Type is the receiving end of the RPC call running in the plugin executable process (the server), and it calls the implementation of the plugin.

type RpcMetricProviderPlugin

type RpcMetricProviderPlugin struct {
	// Impl Injection
	Impl MetricProviderPlugin
}

RpcMetricProviderPlugin 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 MetricsRPCServer for this.

Client must return an implementation of our interface that communicates over an RPC client. We return MetricsPluginRPC for this.

Ignore MuxBroker. That is used to create more multiplexed streams on our plugin connection and is a more advanced use case.

func (RpcMetricProviderPlugin) Client

func (RpcMetricProviderPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*RpcMetricProviderPlugin) Server

func (p *RpcMetricProviderPlugin) Server(*plugin.MuxBroker) (interface{}, error)

type RunArgs

type RunArgs struct {
	AnalysisRun *v1alpha1.AnalysisRun
	Metric      v1alpha1.Metric
}

type TerminateAndResumeArgs

type TerminateAndResumeArgs struct {
	AnalysisRun *v1alpha1.AnalysisRun
	Metric      v1alpha1.Metric
	Measurement v1alpha1.Measurement
}

Jump to

Keyboard shortcuts

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