code style

This commit is contained in:
bergquist
2017-12-11 11:26:36 +01:00
parent 55a39dd2ad
commit 48e7f866f6
3 changed files with 8 additions and 12 deletions

View File

@@ -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)
} }

View File

@@ -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
} }

View File

@@ -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;
} }