mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
code style
This commit is contained in:
parent
55a39dd2ad
commit
48e7f866f6
@ -9,8 +9,6 @@ type GRPCClient struct {
|
||||
proto.TsdbPluginClient
|
||||
}
|
||||
|
||||
//Query(ctx context.Context, ds *models.DataSource, query *TsdbQuery) (*Response, error)
|
||||
|
||||
func (m *GRPCClient) Query(ctx context.Context, req *proto.TsdbQuery) (*proto.Response, error) {
|
||||
return m.TsdbPluginClient.Query(ctx, req)
|
||||
}
|
||||
|
@ -3,22 +3,20 @@ package proxy
|
||||
import (
|
||||
"golang.org/x/net/context"
|
||||
|
||||
//tsdb "github.com/grafana/grafana/pkg/tsdb"
|
||||
|
||||
proto "github.com/grafana/grafana/pkg/tsdb/models"
|
||||
plugin "github.com/hashicorp/go-plugin"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
var PluginMap = map[string]plugin.Plugin{
|
||||
"tsdb_mock": &TsdbPluginImpl{},
|
||||
}
|
||||
// var PluginMap = map[string]plugin.Plugin{
|
||||
// "tsdb_mock": &TsdbPluginImpl{},
|
||||
// }
|
||||
|
||||
type TsdbPlugin interface {
|
||||
Query(ctx context.Context, req *proto.TsdbQuery) (*proto.Response, error)
|
||||
}
|
||||
|
||||
type TsdbPluginImpl struct { //LOL IMPL LOL
|
||||
type TsdbPluginImpl struct {
|
||||
plugin.NetRPCUnsupportedPlugin
|
||||
Plugin TsdbPlugin
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ package plugins;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
// Message represents a simple message sent to the Echo service.
|
||||
message TsdbQuery {
|
||||
Timerange timerange = 1;
|
||||
DatasourceInfo datasource = 2;
|
||||
@ -37,7 +36,8 @@ message QueryResult {
|
||||
string refId = 3;
|
||||
string metaJson = 4;
|
||||
repeated TsdbSeries series = 5;
|
||||
//repeat TsdbTables tables = x;
|
||||
|
||||
//repeat TsdbTables tables = x;
|
||||
}
|
||||
|
||||
message DatasourceInfo {
|
||||
@ -55,7 +55,7 @@ message DatasourceInfo {
|
||||
message TsdbSeries {
|
||||
string name = 1;
|
||||
map<string, string> tags = 2;
|
||||
repeated Point points = 3;
|
||||
repeated Point points = 3;
|
||||
}
|
||||
|
||||
message Point {
|
||||
@ -65,4 +65,4 @@ message Point {
|
||||
|
||||
service TsdbPlugin {
|
||||
rpc Query(TsdbQuery) returns (Response);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user