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