Documentation ¶
Overview ¶
Package grpcplugin provides support for serving plugin over gRPC.
This package is internal and meant to be used internally by the SDK and Grafana.
Index ¶
- Constants
- func Serve(opts ServeOpts) error
- type AdmissionClient
- type AdmissionGRPCPlugin
- type AdmissionServer
- type ConversionClient
- type ConversionGRPCPlugin
- type ConversionServer
- type DataClient
- type DataGRPCPlugin
- type DataServer
- type DiagnosticsClient
- type DiagnosticsGRPCPlugin
- type DiagnosticsServer
- type ResourceClient
- type ResourceGRPCPlugin
- type ResourceServer
- type ServeOpts
- type StreamClient
- type StreamGRPCPlugin
- type StreamServer
Constants ¶
const ( // ProtocolVersion is the current (latest) supported protocol version. ProtocolVersion = 2 // MagicCookieKey is the the magic cookie key that will be used for negotiating // between plugin host and client. // Should NEVER be changed. MagicCookieKey = "grafana_plugin_type" // MagicCookieValue is the the magic cookie value that will be used for negotiating // between plugin host and client. // Should NEVER be changed. MagicCookieValue = "datasource" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdmissionClient ¶ added in v0.232.0
type AdmissionClient interface { pluginv2.AdmissionControlClient }
AdmissionClient represents an admission control client.
type AdmissionGRPCPlugin ¶ added in v0.232.0
type AdmissionGRPCPlugin struct { plugin.NetRPCUnsupportedPlugin plugin.GRPCPlugin AdmissionServer AdmissionServer }
AdmissionGRPCPlugin implements the GRPCPlugin interface from github.com/hashicorp/go-plugin.
func (*AdmissionGRPCPlugin) GRPCClient ¶ added in v0.232.0
func (p *AdmissionGRPCPlugin) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*AdmissionGRPCPlugin) GRPCServer ¶ added in v0.232.0
func (p *AdmissionGRPCPlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error
GRPCServer registers p as an admission control gRPC server.
type AdmissionServer ¶ added in v0.232.0
type AdmissionServer interface { pluginv2.AdmissionControlServer }
AdmissionServer represents an admission control server.
type ConversionClient ¶ added in v0.243.0
type ConversionClient interface { pluginv2.ResourceConversionClient }
ConversionClient represents an resource conversion client.
type ConversionGRPCPlugin ¶ added in v0.243.0
type ConversionGRPCPlugin struct { plugin.NetRPCUnsupportedPlugin plugin.GRPCPlugin ConversionServer ConversionServer }
ConversionGRPCPlugin implements the GRPCPlugin interface from github.com/hashicorp/go-plugin.
func (*ConversionGRPCPlugin) GRPCClient ¶ added in v0.243.0
func (p *ConversionGRPCPlugin) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
GRPCClient returns c as an resource conversion gRPC client.
func (*ConversionGRPCPlugin) GRPCServer ¶ added in v0.243.0
func (p *ConversionGRPCPlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error
GRPCServer registers p as an resource conversion gRPC server.
type ConversionServer ¶ added in v0.243.0
type ConversionServer interface { pluginv2.ResourceConversionServer }
ConversionServer represents an admission control server.
type DataClient ¶
type DataClient interface { pluginv2.DataClient }
DataClient represents a data client.
type DataGRPCPlugin ¶
type DataGRPCPlugin struct { plugin.NetRPCUnsupportedPlugin plugin.GRPCPlugin DataServer DataServer }
DataGRPCPlugin implements the GRPCPlugin interface from github.com/hashicorp/go-plugin.
func (*DataGRPCPlugin) GRPCClient ¶
func (p *DataGRPCPlugin) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
GRPCClient returns c as a data gRPC client.
func (*DataGRPCPlugin) GRPCServer ¶
func (p *DataGRPCPlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error
GRPCServer registers p as a data gRPC server.
type DataServer ¶
type DataServer interface { pluginv2.DataServer }
DataServer represents a data server.
type DiagnosticsClient ¶
type DiagnosticsClient interface { pluginv2.DiagnosticsClient }
DiagnosticsClient is the client API for the Diagnostics service.
type DiagnosticsGRPCPlugin ¶
type DiagnosticsGRPCPlugin struct { plugin.NetRPCUnsupportedPlugin plugin.GRPCPlugin DiagnosticsServer DiagnosticsServer }
DiagnosticsGRPCPlugin implements the GRPCPlugin interface from github.com/hashicorp/go-plugin.
func (*DiagnosticsGRPCPlugin) GRPCClient ¶
func (p *DiagnosticsGRPCPlugin) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
GRPCClient returns c as a diagnostics gRPC client.
func (*DiagnosticsGRPCPlugin) GRPCServer ¶
func (p *DiagnosticsGRPCPlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error
GRPCServer registers p as a diagnostics gRPC server.
type DiagnosticsServer ¶
type DiagnosticsServer interface { pluginv2.DiagnosticsServer }
DiagnosticsServer is the server API for the Diagnostics service.
type ResourceClient ¶
type ResourceClient interface { pluginv2.ResourceClient }
ResourceClient is the client API for the Resource service.
type ResourceGRPCPlugin ¶
type ResourceGRPCPlugin struct { plugin.NetRPCUnsupportedPlugin plugin.GRPCPlugin ResourceServer ResourceServer }
ResourceGRPCPlugin implements the GRPCPlugin interface from github.com/hashicorp/go-plugin.
func (*ResourceGRPCPlugin) GRPCClient ¶
func (p *ResourceGRPCPlugin) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
GRPCClient returns c as a resource gRPC client.
func (*ResourceGRPCPlugin) GRPCServer ¶
func (p *ResourceGRPCPlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error
GRPCServer registers p as a resource gRPC server.
type ResourceServer ¶
type ResourceServer interface { pluginv2.ResourceServer }
ResourceServer is the server API for the Resource service.
type ServeOpts ¶
type ServeOpts struct { DiagnosticsServer DiagnosticsServer ResourceServer ResourceServer DataServer DataServer StreamServer StreamServer AdmissionServer AdmissionServer ConversionServer ConversionServer // GRPCServer factory method for creating GRPC server. // If nil, the default one will be used. GRPCServer func(options []grpc.ServerOption) *grpc.Server }
ServeOpts contains options for serving plugins.
type StreamClient ¶ added in v0.89.0
type StreamClient interface { pluginv2.StreamClient }
StreamClient represents a stream client.
type StreamGRPCPlugin ¶ added in v0.89.0
type StreamGRPCPlugin struct { plugin.NetRPCUnsupportedPlugin plugin.GRPCPlugin StreamServer StreamServer }
StreamGRPCPlugin implements the GRPCPlugin interface from github.com/hashicorp/go-plugin.
func (*StreamGRPCPlugin) GRPCClient ¶ added in v0.89.0
func (p *StreamGRPCPlugin) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
GRPCClient returns c as a resource gRPC client.
func (*StreamGRPCPlugin) GRPCServer ¶ added in v0.89.0
func (p *StreamGRPCPlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error
GRPCServer registers p as a resource gRPC server.
type StreamServer ¶ added in v0.89.0
type StreamServer interface { pluginv2.StreamServer }
StreamServer represents a stream server.