The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/plugins/backendplugin/pluginextensionv2/renderer_grpc_plugin.go

35 lines
844 B

package pluginextensionv2
import (
"context"
"github.com/hashicorp/go-plugin"
"google.golang.org/grpc"
)
type RendererPlugin interface {
RendererClient
}
type RendererGRPCPlugin struct {
plugin.NetRPCUnsupportedPlugin
}
func (p *RendererGRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error {
return nil
}
func (p *RendererGRPCPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error) {
return &RendererGRPCClient{NewRendererClient(c)}, nil
}
type RendererGRPCClient struct {
RendererClient
}
func (m *RendererGRPCClient) Render(ctx context.Context, req *RenderRequest, opts ...grpc.CallOption) (*RenderResponse, error) {
return m.RendererClient.Render(ctx, req)
}
var _ RendererClient = &RendererGRPCClient{}
var _ plugin.GRPCPlugin = &RendererGRPCPlugin{}