sdk: update to latest (#20182)

which removes an unused field from the Transform api
This commit is contained in:
Kyle Brandt 2019-11-05 14:12:54 -05:00 committed by GitHub
parent dca84145f6
commit 17f36d0492
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 228 additions and 159 deletions

2
go.mod
View File

@ -31,7 +31,7 @@ require (
github.com/gorilla/websocket v1.4.0 github.com/gorilla/websocket v1.4.0
github.com/gosimple/slug v1.4.2 github.com/gosimple/slug v1.4.2
github.com/grafana/grafana-plugin-model v0.0.0-20190930120109-1fc953a61fb4 github.com/grafana/grafana-plugin-model v0.0.0-20190930120109-1fc953a61fb4
github.com/grafana/grafana-plugin-sdk-go v0.0.0-20191029155514-4d93894a3f7a github.com/grafana/grafana-plugin-sdk-go v0.0.0-20191105165811-c4e9ecfec89f
github.com/hashicorp/go-hclog v0.8.0 github.com/hashicorp/go-hclog v0.8.0
github.com/hashicorp/go-plugin v1.0.1 github.com/hashicorp/go-plugin v1.0.1
github.com/hashicorp/go-version v1.1.0 github.com/hashicorp/go-version v1.1.0

2
go.sum
View File

@ -112,6 +112,8 @@ github.com/grafana/grafana-plugin-model v0.0.0-20190930120109-1fc953a61fb4 h1:SP
github.com/grafana/grafana-plugin-model v0.0.0-20190930120109-1fc953a61fb4/go.mod h1:nc0XxBzjeGcrMltCDw269LoWF9S8ibhgxolCdA1R8To= github.com/grafana/grafana-plugin-model v0.0.0-20190930120109-1fc953a61fb4/go.mod h1:nc0XxBzjeGcrMltCDw269LoWF9S8ibhgxolCdA1R8To=
github.com/grafana/grafana-plugin-sdk-go v0.0.0-20191029155514-4d93894a3f7a h1:4xgIDiu73n83pb5z835OL/33+DGPGs4M94UBdm7lbJc= github.com/grafana/grafana-plugin-sdk-go v0.0.0-20191029155514-4d93894a3f7a h1:4xgIDiu73n83pb5z835OL/33+DGPGs4M94UBdm7lbJc=
github.com/grafana/grafana-plugin-sdk-go v0.0.0-20191029155514-4d93894a3f7a/go.mod h1:cq0Q7VKEJhlo81CrNexlOZ3VuqmaP/z2rq6lQAydtBo= github.com/grafana/grafana-plugin-sdk-go v0.0.0-20191029155514-4d93894a3f7a/go.mod h1:cq0Q7VKEJhlo81CrNexlOZ3VuqmaP/z2rq6lQAydtBo=
github.com/grafana/grafana-plugin-sdk-go v0.0.0-20191105165811-c4e9ecfec89f h1:x4B65juB5agGJCQpLVlMVdrscdpb1WcraRPNn6O7p/s=
github.com/grafana/grafana-plugin-sdk-go v0.0.0-20191105165811-c4e9ecfec89f/go.mod h1:cq0Q7VKEJhlo81CrNexlOZ3VuqmaP/z2rq6lQAydtBo=
github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI=
github.com/hashicorp/go-hclog v0.8.0 h1:z3ollgGRg8RjfJH6UVBaG54R70GFd++QOkvnJH3VSBY= github.com/hashicorp/go-hclog v0.8.0 h1:z3ollgGRg8RjfJH6UVBaG54R70GFd++QOkvnJH3VSBY=
github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=

View File

@ -137,8 +137,6 @@ type TransformWrapper struct {
func (tw *TransformWrapper) Transform(ctx context.Context, query *tsdb.TsdbQuery) (*tsdb.Response, error) { func (tw *TransformWrapper) Transform(ctx context.Context, query *tsdb.TsdbQuery) (*tsdb.Response, error) {
pbQuery := &pluginv2.TransformRequest{ pbQuery := &pluginv2.TransformRequest{
// TODO Not sure Datasource property needs be on this?
Datasource: &pluginv2.DatasourceInfo{},
TimeRange: &pluginv2.TimeRange{ TimeRange: &pluginv2.TimeRange{
FromRaw: query.TimeRange.From, FromRaw: query.TimeRange.From,
ToRaw: query.TimeRange.To, ToRaw: query.TimeRange.To,

View File

@ -241,15 +241,13 @@ func UnMarshalArrow(b []byte) (*Frame, error) {
v := array.NewFloat64Data(col.Data()) v := array.NewFloat64Data(col.Data())
for _, f := range v.Float64Values() { for _, f := range v.Float64Values() {
vF := f vF := f
vec := append(*frame.Fields[i].Vector.(*floatVector), &vF) frame.Fields[i].Vector.Append(&vF)
frame.Fields[i].Vector = &vec
} }
case arrow.TIMESTAMP: case arrow.TIMESTAMP:
v := array.NewTimestampData(col.Data()) v := array.NewTimestampData(col.Data())
for _, ts := range v.TimestampValues() { for _, ts := range v.TimestampValues() {
t := time.Unix(0, int64(ts)) // nanosecond assumption t := time.Unix(0, int64(ts)) // nanosecond assumption
vec := append(*frame.Fields[i].Vector.(*timeVector), &t) frame.Fields[i].Vector.Append(&t)
frame.Fields[i].Vector = &vec
} }
default: default:
return nil, fmt.Errorf("unsupported arrow type %s for conversion", col.DataType().ID()) return nil, fmt.Errorf("unsupported arrow type %s for conversion", col.DataType().ID())

View File

@ -7,6 +7,18 @@ func newBoolVector(l int) *boolVector {
return &v return &v
} }
func (v *boolVector) Set(i int, val interface{}) { (*v)[i] = val.(*bool) } func (v *boolVector) Set(i int, val interface{}) {
func (v *boolVector) At(i int) interface{} { return (*v)[i] } (*v)[i] = val.(*bool)
func (v *boolVector) Len() int { return len(*v) } }
func (v *boolVector) Append(val interface{}) {
*v = append(*v, val.(*bool))
}
func (v *boolVector) At(i int) interface{} {
return (*v)[i]
}
func (v *boolVector) Len() int {
return len(*v)
}

View File

@ -6,6 +6,15 @@ func newFloatVector(l int) *floatVector {
v := make(floatVector, l) v := make(floatVector, l)
return &v return &v
} }
func (v *floatVector) Set(i int, val interface{}) { (*v)[i] = val.(*float64) }
func (v *floatVector) At(i int) interface{} { return (*v)[i] } func (v *floatVector) Set(i int, val interface{}) {
func (v *floatVector) Len() int { return len(*v) } (*v)[i] = val.(*float64)
}
func (v *floatVector) Append(val interface{}) {
*v = append(*v, val.(*float64))
}
func (v *floatVector) At(i int) interface{} { return (*v)[i] }
func (v *floatVector) Len() int { return len(*v) }

View File

@ -7,6 +7,18 @@ func newStringVector(l int) *stringVector {
return &v return &v
} }
func (v *stringVector) Set(i int, val interface{}) { (*v)[i] = val.(*string) } func (v *stringVector) Set(i int, val interface{}) {
func (v *stringVector) At(i int) interface{} { return (*v)[i] } (*v)[i] = val.(*string)
func (v *stringVector) Len() int { return len(*v) } }
func (v *stringVector) Append(val interface{}) {
*v = append(*v, val.(*string))
}
func (v *stringVector) At(i int) interface{} {
return (*v)[i]
}
func (v *stringVector) Len() int {
return len(*v)
}

View File

@ -1,6 +1,8 @@
package dataframe package dataframe
import "time" import (
"time"
)
type timeVector []*time.Time type timeVector []*time.Time
@ -9,6 +11,18 @@ func newTimeVector(l int) *timeVector {
return &v return &v
} }
func (v *timeVector) Set(i int, val interface{}) { (*v)[i] = val.(*time.Time) } func (v *timeVector) Set(i int, val interface{}) {
func (v *timeVector) At(i int) interface{} { return (*v)[i] } (*v)[i] = val.(*time.Time)
func (v *timeVector) Len() int { return len(*v) } }
func (v *timeVector) Append(val interface{}) {
*v = append(*v, val.(*time.Time))
}
func (v *timeVector) At(i int) interface{} {
return (*v)[i]
}
func (v *timeVector) Len() int {
return len(*v)
}

View File

@ -3,6 +3,7 @@ package dataframe
// Vector represents a collection of Elements. // Vector represents a collection of Elements.
type Vector interface { type Vector interface {
Set(idx int, i interface{}) Set(idx int, i interface{})
Append(i interface{})
At(i int) interface{} At(i int) interface{}
Len() int Len() int
} }

View File

@ -3,9 +3,11 @@
package pluginv2 package pluginv2
import proto "github.com/golang/protobuf/proto" import (
import fmt "fmt" fmt "fmt"
import math "math" proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var _ = proto.Marshal
@ -16,7 +18,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type TimeRange struct { type TimeRange struct {
FromRaw string `protobuf:"bytes,1,opt,name=fromRaw,proto3" json:"fromRaw,omitempty"` FromRaw string `protobuf:"bytes,1,opt,name=fromRaw,proto3" json:"fromRaw,omitempty"`
@ -32,16 +34,17 @@ func (m *TimeRange) Reset() { *m = TimeRange{} }
func (m *TimeRange) String() string { return proto.CompactTextString(m) } func (m *TimeRange) String() string { return proto.CompactTextString(m) }
func (*TimeRange) ProtoMessage() {} func (*TimeRange) ProtoMessage() {}
func (*TimeRange) Descriptor() ([]byte, []int) { func (*TimeRange) Descriptor() ([]byte, []int) {
return fileDescriptor_common_efe63640b8634961, []int{0} return fileDescriptor_555bd8c177793206, []int{0}
} }
func (m *TimeRange) XXX_Unmarshal(b []byte) error { func (m *TimeRange) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TimeRange.Unmarshal(m, b) return xxx_messageInfo_TimeRange.Unmarshal(m, b)
} }
func (m *TimeRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *TimeRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TimeRange.Marshal(b, m, deterministic) return xxx_messageInfo_TimeRange.Marshal(b, m, deterministic)
} }
func (dst *TimeRange) XXX_Merge(src proto.Message) { func (m *TimeRange) XXX_Merge(src proto.Message) {
xxx_messageInfo_TimeRange.Merge(dst, src) xxx_messageInfo_TimeRange.Merge(m, src)
} }
func (m *TimeRange) XXX_Size() int { func (m *TimeRange) XXX_Size() int {
return xxx_messageInfo_TimeRange.Size(m) return xxx_messageInfo_TimeRange.Size(m)
@ -97,16 +100,17 @@ func (m *DatasourceInfo) Reset() { *m = DatasourceInfo{} }
func (m *DatasourceInfo) String() string { return proto.CompactTextString(m) } func (m *DatasourceInfo) String() string { return proto.CompactTextString(m) }
func (*DatasourceInfo) ProtoMessage() {} func (*DatasourceInfo) ProtoMessage() {}
func (*DatasourceInfo) Descriptor() ([]byte, []int) { func (*DatasourceInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_common_efe63640b8634961, []int{1} return fileDescriptor_555bd8c177793206, []int{1}
} }
func (m *DatasourceInfo) XXX_Unmarshal(b []byte) error { func (m *DatasourceInfo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DatasourceInfo.Unmarshal(m, b) return xxx_messageInfo_DatasourceInfo.Unmarshal(m, b)
} }
func (m *DatasourceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *DatasourceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DatasourceInfo.Marshal(b, m, deterministic) return xxx_messageInfo_DatasourceInfo.Marshal(b, m, deterministic)
} }
func (dst *DatasourceInfo) XXX_Merge(src proto.Message) { func (m *DatasourceInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_DatasourceInfo.Merge(dst, src) xxx_messageInfo_DatasourceInfo.Merge(m, src)
} }
func (m *DatasourceInfo) XXX_Size() int { func (m *DatasourceInfo) XXX_Size() int {
return xxx_messageInfo_DatasourceInfo.Size(m) return xxx_messageInfo_DatasourceInfo.Size(m)
@ -172,9 +176,9 @@ func init() {
proto.RegisterMapType((map[string]string)(nil), "pluginv2.DatasourceInfo.DecryptedSecureJsonDataEntry") proto.RegisterMapType((map[string]string)(nil), "pluginv2.DatasourceInfo.DecryptedSecureJsonDataEntry")
} }
func init() { proto.RegisterFile("common.proto", fileDescriptor_common_efe63640b8634961) } func init() { proto.RegisterFile("common.proto", fileDescriptor_555bd8c177793206) }
var fileDescriptor_common_efe63640b8634961 = []byte{ var fileDescriptor_555bd8c177793206 = []byte{
// 296 bytes of a gzipped FileDescriptorProto // 296 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xcf, 0x4a, 0xc3, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xcf, 0x4a, 0xc3, 0x40,
0x10, 0xc6, 0x49, 0xb6, 0xff, 0x32, 0x95, 0x22, 0x8b, 0x60, 0x28, 0x3d, 0x84, 0x9e, 0x72, 0xca, 0x10, 0xc6, 0x49, 0xb6, 0xff, 0x32, 0x95, 0x22, 0x8b, 0x60, 0x28, 0x3d, 0x84, 0x9e, 0x72, 0xca,

View File

@ -3,13 +3,14 @@
package pluginv2 package pluginv2
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import ( import (
context "golang.org/x/net/context" context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -21,7 +22,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type DatasourceRequest struct { type DatasourceRequest struct {
TimeRange *TimeRange `protobuf:"bytes,1,opt,name=timeRange,proto3" json:"timeRange,omitempty"` TimeRange *TimeRange `protobuf:"bytes,1,opt,name=timeRange,proto3" json:"timeRange,omitempty"`
@ -36,16 +37,17 @@ func (m *DatasourceRequest) Reset() { *m = DatasourceRequest{} }
func (m *DatasourceRequest) String() string { return proto.CompactTextString(m) } func (m *DatasourceRequest) String() string { return proto.CompactTextString(m) }
func (*DatasourceRequest) ProtoMessage() {} func (*DatasourceRequest) ProtoMessage() {}
func (*DatasourceRequest) Descriptor() ([]byte, []int) { func (*DatasourceRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_datasource_13efbd1765cf7284, []int{0} return fileDescriptor_bb096a9d85d590d2, []int{0}
} }
func (m *DatasourceRequest) XXX_Unmarshal(b []byte) error { func (m *DatasourceRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DatasourceRequest.Unmarshal(m, b) return xxx_messageInfo_DatasourceRequest.Unmarshal(m, b)
} }
func (m *DatasourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *DatasourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DatasourceRequest.Marshal(b, m, deterministic) return xxx_messageInfo_DatasourceRequest.Marshal(b, m, deterministic)
} }
func (dst *DatasourceRequest) XXX_Merge(src proto.Message) { func (m *DatasourceRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_DatasourceRequest.Merge(dst, src) xxx_messageInfo_DatasourceRequest.Merge(m, src)
} }
func (m *DatasourceRequest) XXX_Size() int { func (m *DatasourceRequest) XXX_Size() int {
return xxx_messageInfo_DatasourceRequest.Size(m) return xxx_messageInfo_DatasourceRequest.Size(m)
@ -91,16 +93,17 @@ func (m *DatasourceQuery) Reset() { *m = DatasourceQuery{} }
func (m *DatasourceQuery) String() string { return proto.CompactTextString(m) } func (m *DatasourceQuery) String() string { return proto.CompactTextString(m) }
func (*DatasourceQuery) ProtoMessage() {} func (*DatasourceQuery) ProtoMessage() {}
func (*DatasourceQuery) Descriptor() ([]byte, []int) { func (*DatasourceQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_datasource_13efbd1765cf7284, []int{1} return fileDescriptor_bb096a9d85d590d2, []int{1}
} }
func (m *DatasourceQuery) XXX_Unmarshal(b []byte) error { func (m *DatasourceQuery) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DatasourceQuery.Unmarshal(m, b) return xxx_messageInfo_DatasourceQuery.Unmarshal(m, b)
} }
func (m *DatasourceQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *DatasourceQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DatasourceQuery.Marshal(b, m, deterministic) return xxx_messageInfo_DatasourceQuery.Marshal(b, m, deterministic)
} }
func (dst *DatasourceQuery) XXX_Merge(src proto.Message) { func (m *DatasourceQuery) XXX_Merge(src proto.Message) {
xxx_messageInfo_DatasourceQuery.Merge(dst, src) xxx_messageInfo_DatasourceQuery.Merge(m, src)
} }
func (m *DatasourceQuery) XXX_Size() int { func (m *DatasourceQuery) XXX_Size() int {
return xxx_messageInfo_DatasourceQuery.Size(m) return xxx_messageInfo_DatasourceQuery.Size(m)
@ -150,16 +153,17 @@ func (m *DatasourceResponse) Reset() { *m = DatasourceResponse{} }
func (m *DatasourceResponse) String() string { return proto.CompactTextString(m) } func (m *DatasourceResponse) String() string { return proto.CompactTextString(m) }
func (*DatasourceResponse) ProtoMessage() {} func (*DatasourceResponse) ProtoMessage() {}
func (*DatasourceResponse) Descriptor() ([]byte, []int) { func (*DatasourceResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_datasource_13efbd1765cf7284, []int{2} return fileDescriptor_bb096a9d85d590d2, []int{2}
} }
func (m *DatasourceResponse) XXX_Unmarshal(b []byte) error { func (m *DatasourceResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DatasourceResponse.Unmarshal(m, b) return xxx_messageInfo_DatasourceResponse.Unmarshal(m, b)
} }
func (m *DatasourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *DatasourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DatasourceResponse.Marshal(b, m, deterministic) return xxx_messageInfo_DatasourceResponse.Marshal(b, m, deterministic)
} }
func (dst *DatasourceResponse) XXX_Merge(src proto.Message) { func (m *DatasourceResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_DatasourceResponse.Merge(dst, src) xxx_messageInfo_DatasourceResponse.Merge(m, src)
} }
func (m *DatasourceResponse) XXX_Size() int { func (m *DatasourceResponse) XXX_Size() int {
return xxx_messageInfo_DatasourceResponse.Size(m) return xxx_messageInfo_DatasourceResponse.Size(m)
@ -191,16 +195,17 @@ func (m *DatasourceQueryResult) Reset() { *m = DatasourceQueryResult{} }
func (m *DatasourceQueryResult) String() string { return proto.CompactTextString(m) } func (m *DatasourceQueryResult) String() string { return proto.CompactTextString(m) }
func (*DatasourceQueryResult) ProtoMessage() {} func (*DatasourceQueryResult) ProtoMessage() {}
func (*DatasourceQueryResult) Descriptor() ([]byte, []int) { func (*DatasourceQueryResult) Descriptor() ([]byte, []int) {
return fileDescriptor_datasource_13efbd1765cf7284, []int{3} return fileDescriptor_bb096a9d85d590d2, []int{3}
} }
func (m *DatasourceQueryResult) XXX_Unmarshal(b []byte) error { func (m *DatasourceQueryResult) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DatasourceQueryResult.Unmarshal(m, b) return xxx_messageInfo_DatasourceQueryResult.Unmarshal(m, b)
} }
func (m *DatasourceQueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *DatasourceQueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DatasourceQueryResult.Marshal(b, m, deterministic) return xxx_messageInfo_DatasourceQueryResult.Marshal(b, m, deterministic)
} }
func (dst *DatasourceQueryResult) XXX_Merge(src proto.Message) { func (m *DatasourceQueryResult) XXX_Merge(src proto.Message) {
xxx_messageInfo_DatasourceQueryResult.Merge(dst, src) xxx_messageInfo_DatasourceQueryResult.Merge(m, src)
} }
func (m *DatasourceQueryResult) XXX_Size() int { func (m *DatasourceQueryResult) XXX_Size() int {
return xxx_messageInfo_DatasourceQueryResult.Size(m) return xxx_messageInfo_DatasourceQueryResult.Size(m)
@ -246,6 +251,34 @@ func init() {
proto.RegisterType((*DatasourceQueryResult)(nil), "pluginv2.DatasourceQueryResult") proto.RegisterType((*DatasourceQueryResult)(nil), "pluginv2.DatasourceQueryResult")
} }
func init() { proto.RegisterFile("datasource.proto", fileDescriptor_bb096a9d85d590d2) }
var fileDescriptor_bb096a9d85d590d2 = []byte{
// 346 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x41, 0x4f, 0xc2, 0x30,
0x14, 0xc7, 0x33, 0x06, 0x02, 0x0f, 0x8c, 0x58, 0x35, 0x99, 0x48, 0x94, 0x2c, 0x1e, 0x38, 0x91,
0x38, 0x2e, 0x7a, 0x35, 0x5e, 0x30, 0x31, 0x62, 0x63, 0xbc, 0x57, 0x78, 0x90, 0x25, 0x6b, 0x0b,
0x6d, 0x47, 0xf4, 0xe4, 0x07, 0xf0, 0xf3, 0xf8, 0xfd, 0xcc, 0x3a, 0x47, 0xa7, 0x99, 0xc7, 0xf7,
0x7f, 0xbf, 0xd7, 0xfe, 0xff, 0xaf, 0x85, 0xde, 0x82, 0x19, 0xa6, 0x65, 0xaa, 0xe6, 0x38, 0x5e,
0x2b, 0x69, 0x24, 0x69, 0xad, 0x93, 0x74, 0x15, 0x8b, 0x6d, 0xd4, 0xef, 0xce, 0x25, 0xe7, 0x52,
0xe4, 0x7a, 0xf8, 0xe5, 0xc1, 0xe1, 0xdd, 0x0e, 0xa6, 0xb8, 0x49, 0x51, 0x1b, 0x72, 0x05, 0x6d,
0x13, 0x73, 0xa4, 0x4c, 0xac, 0x30, 0xf0, 0x86, 0xde, 0xa8, 0x13, 0x1d, 0x8d, 0x8b, 0x13, 0xc6,
0xcf, 0x45, 0x8b, 0x3a, 0x8a, 0x5c, 0x03, 0xb8, 0x4b, 0x83, 0x9a, 0x9d, 0x09, 0xdc, 0x8c, 0xbb,
0x63, 0x2a, 0x96, 0x92, 0x96, 0x58, 0x32, 0x81, 0xe6, 0x26, 0x45, 0x15, 0xa3, 0x0e, 0xfc, 0xa1,
0x3f, 0xea, 0x44, 0xa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ports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ context.Context var _ context.Context
var _ grpc.ClientConn var _ grpc.ClientConn
@ -283,6 +316,14 @@ type DatasourcePluginServer interface {
Query(context.Context, *DatasourceRequest) (*DatasourceResponse, error) Query(context.Context, *DatasourceRequest) (*DatasourceResponse, error)
} }
// UnimplementedDatasourcePluginServer can be embedded to have forward compatible implementations.
type UnimplementedDatasourcePluginServer struct {
}
func (*UnimplementedDatasourcePluginServer) Query(ctx context.Context, req *DatasourceRequest) (*DatasourceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Query not implemented")
}
func RegisterDatasourcePluginServer(s *grpc.Server, srv DatasourcePluginServer) { func RegisterDatasourcePluginServer(s *grpc.Server, srv DatasourcePluginServer) {
s.RegisterService(&_DatasourcePlugin_serviceDesc, srv) s.RegisterService(&_DatasourcePlugin_serviceDesc, srv)
} }
@ -317,31 +358,3 @@ var _DatasourcePlugin_serviceDesc = grpc.ServiceDesc{
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
Metadata: "datasource.proto", Metadata: "datasource.proto",
} }
func init() { proto.RegisterFile("datasource.proto", fileDescriptor_datasource_13efbd1765cf7284) }
var fileDescriptor_datasource_13efbd1765cf7284 = []byte{
// 346 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x41, 0x4f, 0xc2, 0x30,
0x14, 0xc7, 0x33, 0x06, 0x02, 0x0f, 0x8c, 0x58, 0x35, 0x99, 0x48, 0x94, 0x2c, 0x1e, 0x38, 0x91,
0x38, 0x2e, 0x7a, 0x35, 0x5e, 0x30, 0x31, 0x62, 0x63, 0xbc, 0x57, 0x78, 0x90, 0x25, 0x6b, 0x0b,
0x6d, 0x47, 0xf4, 0xe4, 0x07, 0xf0, 0xf3, 0xf8, 0xfd, 0xcc, 0x3a, 0x47, 0xa7, 0x99, 0xc7, 0xf7,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, 0xd1, 0x81, 0x67, 0x83, 0x5d, 0xfc, 0x1f,
0xcc, 0x72, 0xb4, 0xe0, 0xc3, 0x0f, 0x38, 0xa9, 0x24, 0xb2, 0x8c, 0xa8, 0x94, 0x54, 0x45, 0x46,
0x5b, 0xb8, 0xe4, 0xb5, 0x72, 0xf2, 0x3e, 0xb4, 0x38, 0x1a, 0x66, 0x2d, 0xfb, 0xb6, 0xb1, 0xab,
0xb3, 0xbc, 0xd9, 0x13, 0x2c, 0x15, 0xe3, 0xa8, 0x83, 0xfa, 0xd0, 0x1f, 0x75, 0x69, 0x49, 0x89,
0x5e, 0xa0, 0xe7, 0x0c, 0xcc, 0xac, 0x6b, 0x72, 0x0b, 0x8d, 0x7c, 0xd1, 0x67, 0x55, 0x39, 0x7e,
0xfe, 0x4e, 0x7f, 0x50, 0xdd, 0xcc, 0x77, 0xf2, 0xba, 0x67, 0xbf, 0xdd, 0xe4, 0x3b, 0x00, 0x00,
0xff, 0xff, 0x64, 0x89, 0x5d, 0xe6, 0xa2, 0x02, 0x00, 0x00,
}

View File

@ -3,13 +3,14 @@
package pluginv2 package pluginv2
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import ( import (
context "golang.org/x/net/context" context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -21,7 +22,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type TransformQuery struct { type TransformQuery struct {
RefId string `protobuf:"bytes,1,opt,name=refId,proto3" json:"refId,omitempty"` RefId string `protobuf:"bytes,1,opt,name=refId,proto3" json:"refId,omitempty"`
@ -37,16 +38,17 @@ func (m *TransformQuery) Reset() { *m = TransformQuery{} }
func (m *TransformQuery) String() string { return proto.CompactTextString(m) } func (m *TransformQuery) String() string { return proto.CompactTextString(m) }
func (*TransformQuery) ProtoMessage() {} func (*TransformQuery) ProtoMessage() {}
func (*TransformQuery) Descriptor() ([]byte, []int) { func (*TransformQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_transform_40c78b0d7c77dad0, []int{0} return fileDescriptor_cb4a498eeb2ba07d, []int{0}
} }
func (m *TransformQuery) XXX_Unmarshal(b []byte) error { func (m *TransformQuery) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TransformQuery.Unmarshal(m, b) return xxx_messageInfo_TransformQuery.Unmarshal(m, b)
} }
func (m *TransformQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *TransformQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TransformQuery.Marshal(b, m, deterministic) return xxx_messageInfo_TransformQuery.Marshal(b, m, deterministic)
} }
func (dst *TransformQuery) XXX_Merge(src proto.Message) { func (m *TransformQuery) XXX_Merge(src proto.Message) {
xxx_messageInfo_TransformQuery.Merge(dst, src) xxx_messageInfo_TransformQuery.Merge(m, src)
} }
func (m *TransformQuery) XXX_Size() int { func (m *TransformQuery) XXX_Size() int {
return xxx_messageInfo_TransformQuery.Size(m) return xxx_messageInfo_TransformQuery.Size(m)
@ -87,9 +89,8 @@ func (m *TransformQuery) GetModelJson() string {
type TransformRequest struct { type TransformRequest struct {
TimeRange *TimeRange `protobuf:"bytes,1,opt,name=timeRange,proto3" json:"timeRange,omitempty"` TimeRange *TimeRange `protobuf:"bytes,1,opt,name=timeRange,proto3" json:"timeRange,omitempty"`
Datasource *DatasourceInfo `protobuf:"bytes,2,opt,name=datasource,proto3" json:"datasource,omitempty"` Queries []*TransformQuery `protobuf:"bytes,2,rep,name=queries,proto3" json:"queries,omitempty"`
Queries []*TransformQuery `protobuf:"bytes,3,rep,name=queries,proto3" json:"queries,omitempty"` RequestId uint32 `protobuf:"varint,3,opt,name=requestId,proto3" json:"requestId,omitempty"`
RequestId uint32 `protobuf:"varint,4,opt,name=requestId,proto3" json:"requestId,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
@ -99,16 +100,17 @@ func (m *TransformRequest) Reset() { *m = TransformRequest{} }
func (m *TransformRequest) String() string { return proto.CompactTextString(m) } func (m *TransformRequest) String() string { return proto.CompactTextString(m) }
func (*TransformRequest) ProtoMessage() {} func (*TransformRequest) ProtoMessage() {}
func (*TransformRequest) Descriptor() ([]byte, []int) { func (*TransformRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_transform_40c78b0d7c77dad0, []int{1} return fileDescriptor_cb4a498eeb2ba07d, []int{1}
} }
func (m *TransformRequest) XXX_Unmarshal(b []byte) error { func (m *TransformRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TransformRequest.Unmarshal(m, b) return xxx_messageInfo_TransformRequest.Unmarshal(m, b)
} }
func (m *TransformRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *TransformRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TransformRequest.Marshal(b, m, deterministic) return xxx_messageInfo_TransformRequest.Marshal(b, m, deterministic)
} }
func (dst *TransformRequest) XXX_Merge(src proto.Message) { func (m *TransformRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_TransformRequest.Merge(dst, src) xxx_messageInfo_TransformRequest.Merge(m, src)
} }
func (m *TransformRequest) XXX_Size() int { func (m *TransformRequest) XXX_Size() int {
return xxx_messageInfo_TransformRequest.Size(m) return xxx_messageInfo_TransformRequest.Size(m)
@ -126,13 +128,6 @@ func (m *TransformRequest) GetTimeRange() *TimeRange {
return nil return nil
} }
func (m *TransformRequest) GetDatasource() *DatasourceInfo {
if m != nil {
return m.Datasource
}
return nil
}
func (m *TransformRequest) GetQueries() []*TransformQuery { func (m *TransformRequest) GetQueries() []*TransformQuery {
if m != nil { if m != nil {
return m.Queries return m.Queries
@ -158,16 +153,17 @@ func (m *TransformResponse) Reset() { *m = TransformResponse{} }
func (m *TransformResponse) String() string { return proto.CompactTextString(m) } func (m *TransformResponse) String() string { return proto.CompactTextString(m) }
func (*TransformResponse) ProtoMessage() {} func (*TransformResponse) ProtoMessage() {}
func (*TransformResponse) Descriptor() ([]byte, []int) { func (*TransformResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_transform_40c78b0d7c77dad0, []int{2} return fileDescriptor_cb4a498eeb2ba07d, []int{2}
} }
func (m *TransformResponse) XXX_Unmarshal(b []byte) error { func (m *TransformResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TransformResponse.Unmarshal(m, b) return xxx_messageInfo_TransformResponse.Unmarshal(m, b)
} }
func (m *TransformResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *TransformResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TransformResponse.Marshal(b, m, deterministic) return xxx_messageInfo_TransformResponse.Marshal(b, m, deterministic)
} }
func (dst *TransformResponse) XXX_Merge(src proto.Message) { func (m *TransformResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_TransformResponse.Merge(dst, src) xxx_messageInfo_TransformResponse.Merge(m, src)
} }
func (m *TransformResponse) XXX_Size() int { func (m *TransformResponse) XXX_Size() int {
return xxx_messageInfo_TransformResponse.Size(m) return xxx_messageInfo_TransformResponse.Size(m)
@ -199,16 +195,17 @@ func (m *TransformResult) Reset() { *m = TransformResult{} }
func (m *TransformResult) String() string { return proto.CompactTextString(m) } func (m *TransformResult) String() string { return proto.CompactTextString(m) }
func (*TransformResult) ProtoMessage() {} func (*TransformResult) ProtoMessage() {}
func (*TransformResult) Descriptor() ([]byte, []int) { func (*TransformResult) Descriptor() ([]byte, []int) {
return fileDescriptor_transform_40c78b0d7c77dad0, []int{3} return fileDescriptor_cb4a498eeb2ba07d, []int{3}
} }
func (m *TransformResult) XXX_Unmarshal(b []byte) error { func (m *TransformResult) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TransformResult.Unmarshal(m, b) return xxx_messageInfo_TransformResult.Unmarshal(m, b)
} }
func (m *TransformResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *TransformResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TransformResult.Marshal(b, m, deterministic) return xxx_messageInfo_TransformResult.Marshal(b, m, deterministic)
} }
func (dst *TransformResult) XXX_Merge(src proto.Message) { func (m *TransformResult) XXX_Merge(src proto.Message) {
xxx_messageInfo_TransformResult.Merge(dst, src) xxx_messageInfo_TransformResult.Merge(m, src)
} }
func (m *TransformResult) XXX_Size() int { func (m *TransformResult) XXX_Size() int {
return xxx_messageInfo_TransformResult.Size(m) return xxx_messageInfo_TransformResult.Size(m)
@ -261,16 +258,17 @@ func (m *QueryDatasourceRequest) Reset() { *m = QueryDatasourceRequest{}
func (m *QueryDatasourceRequest) String() string { return proto.CompactTextString(m) } func (m *QueryDatasourceRequest) String() string { return proto.CompactTextString(m) }
func (*QueryDatasourceRequest) ProtoMessage() {} func (*QueryDatasourceRequest) ProtoMessage() {}
func (*QueryDatasourceRequest) Descriptor() ([]byte, []int) { func (*QueryDatasourceRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_transform_40c78b0d7c77dad0, []int{4} return fileDescriptor_cb4a498eeb2ba07d, []int{4}
} }
func (m *QueryDatasourceRequest) XXX_Unmarshal(b []byte) error { func (m *QueryDatasourceRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryDatasourceRequest.Unmarshal(m, b) return xxx_messageInfo_QueryDatasourceRequest.Unmarshal(m, b)
} }
func (m *QueryDatasourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *QueryDatasourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QueryDatasourceRequest.Marshal(b, m, deterministic) return xxx_messageInfo_QueryDatasourceRequest.Marshal(b, m, deterministic)
} }
func (dst *QueryDatasourceRequest) XXX_Merge(src proto.Message) { func (m *QueryDatasourceRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryDatasourceRequest.Merge(dst, src) xxx_messageInfo_QueryDatasourceRequest.Merge(m, src)
} }
func (m *QueryDatasourceRequest) XXX_Size() int { func (m *QueryDatasourceRequest) XXX_Size() int {
return xxx_messageInfo_QueryDatasourceRequest.Size(m) return xxx_messageInfo_QueryDatasourceRequest.Size(m)
@ -320,16 +318,17 @@ func (m *QueryDatasourceResponse) Reset() { *m = QueryDatasourceResponse
func (m *QueryDatasourceResponse) String() string { return proto.CompactTextString(m) } func (m *QueryDatasourceResponse) String() string { return proto.CompactTextString(m) }
func (*QueryDatasourceResponse) ProtoMessage() {} func (*QueryDatasourceResponse) ProtoMessage() {}
func (*QueryDatasourceResponse) Descriptor() ([]byte, []int) { func (*QueryDatasourceResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_transform_40c78b0d7c77dad0, []int{5} return fileDescriptor_cb4a498eeb2ba07d, []int{5}
} }
func (m *QueryDatasourceResponse) XXX_Unmarshal(b []byte) error { func (m *QueryDatasourceResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryDatasourceResponse.Unmarshal(m, b) return xxx_messageInfo_QueryDatasourceResponse.Unmarshal(m, b)
} }
func (m *QueryDatasourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *QueryDatasourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QueryDatasourceResponse.Marshal(b, m, deterministic) return xxx_messageInfo_QueryDatasourceResponse.Marshal(b, m, deterministic)
} }
func (dst *QueryDatasourceResponse) XXX_Merge(src proto.Message) { func (m *QueryDatasourceResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryDatasourceResponse.Merge(dst, src) xxx_messageInfo_QueryDatasourceResponse.Merge(m, src)
} }
func (m *QueryDatasourceResponse) XXX_Size() int { func (m *QueryDatasourceResponse) XXX_Size() int {
return xxx_messageInfo_QueryDatasourceResponse.Size(m) return xxx_messageInfo_QueryDatasourceResponse.Size(m)
@ -356,6 +355,41 @@ func init() {
proto.RegisterType((*QueryDatasourceResponse)(nil), "pluginv2.QueryDatasourceResponse") proto.RegisterType((*QueryDatasourceResponse)(nil), "pluginv2.QueryDatasourceResponse")
} }
func init() { proto.RegisterFile("transform.proto", fileDescriptor_cb4a498eeb2ba07d) }
var fileDescriptor_cb4a498eeb2ba07d = []byte{
// 449 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xcf, 0x6e, 0xd3, 0x40,
0x10, 0xc6, 0xe5, 0x6e, 0x4b, 0x9b, 0x69, 0x4a, 0xca, 0x52, 0x81, 0x31, 0x08, 0x82, 0xc5, 0x21,
0xa7, 0x48, 0xb8, 0x27, 0x8e, 0x48, 0x91, 0x20, 0x48, 0x48, 0x61, 0x15, 0xc1, 0x79, 0xa9, 0x27,
0x91, 0xa5, 0xec, 0x6e, 0x3a, 0xbb, 0xae, 0xe8, 0x2b, 0xf0, 0x02, 0xbc, 0x0b, 0x4f, 0x87, 0xbc,
0xae, 0xff, 0x62, 0xb8, 0xf4, 0x38, 0xdf, 0xce, 0x78, 0xbe, 0xfd, 0x7e, 0x6b, 0x98, 0x38, 0x92,
0xda, 0x6e, 0x0c, 0xa9, 0xf9, 0x9e, 0x8c, 0x33, 0xfc, 0x64, 0xbf, 0xcb, 0xb7, 0x99, 0xbe, 0x49,
0xa2, 0xf1, 0x95, 0x51, 0xca, 0xe8, 0x52, 0x8f, 0xce, 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, 0x83, 0xe1, 0xa0, 0x8d, 0x21, 0x82, 0x13, 0x85, 0x4e, 0xfa, 0xfc, 0x98, 0x3f,
0xa8, 0xeb, 0x22, 0xfc, 0x82, 0xef, 0x86, 0xa4, 0x42, 0x1b, 0x1e, 0x4e, 0xd9, 0x6c, 0x2c, 0x5a,
0x4a, 0xfc, 0x3b, 0x80, 0x27, 0xfe, 0xd6, 0x8b, 0xfa, 0x15, 0xdc, 0x23, 0xe4, 0x18, 0xc6, 0xcd,
0x6b, 0xba, 0xb3, 0xc9, 0x44, 0x47, 0x2b, 0x12, 0xaa, 0x40, 0xb0, 0x7e, 0x42, 0x8d, 0x89, 0x1e,
0x89, 0x0b, 0x38, 0x32, 0xb4, 0x5d, 0xa6, 0xfe, 0x7d, 0x30, 0x51, 0x16, 0xf1, 0x1a, 0x9e, 0xfe,
0xe5, 0xfd, 0x8e, 0xc3, 0xbb, 0x3e, 0x87, 0x57, 0xff, 0xde, 0xd2, 0xa5, 0x91, 0x7c, 0x6b, 0xd1,
0x58, 0xf9, 0x19, 0xbe, 0x80, 0x51, 0x2d, 0xf1, 0x68, 0x90, 0xa8, 0xcf, 0x2c, 0x7a, 0x3e, 0x4c,
0xdb, 0x7b, 0x4a, 0x52, 0x80, 0x0f, 0x24, 0x37, 0x52, 0xcb, 0xf7, 0xab, 0x25, 0xff, 0x0a, 0x93,
0x9e, 0x79, 0x3e, 0x6d, 0xa6, 0x87, 0x99, 0x44, 0xaf, 0xff, 0xd3, 0x51, 0x6e, 0xf9, 0xfe, 0xc0,
0xff, 0xc4, 0x97, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x62, 0x3f, 0x42, 0xf9, 0x01, 0x04, 0x00,
0x00,
}
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ context.Context var _ context.Context
var _ grpc.ClientConn var _ grpc.ClientConn
@ -393,6 +427,14 @@ type TransformPluginServer interface {
Transform(context.Context, *TransformRequest) (*TransformResponse, error) Transform(context.Context, *TransformRequest) (*TransformResponse, error)
} }
// UnimplementedTransformPluginServer can be embedded to have forward compatible implementations.
type UnimplementedTransformPluginServer struct {
}
func (*UnimplementedTransformPluginServer) Transform(ctx context.Context, req *TransformRequest) (*TransformResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Transform not implemented")
}
func RegisterTransformPluginServer(s *grpc.Server, srv TransformPluginServer) { func RegisterTransformPluginServer(s *grpc.Server, srv TransformPluginServer) {
s.RegisterService(&_TransformPlugin_serviceDesc, srv) s.RegisterService(&_TransformPlugin_serviceDesc, srv)
} }
@ -457,6 +499,14 @@ type GrafanaAPIServer interface {
QueryDatasource(context.Context, *QueryDatasourceRequest) (*QueryDatasourceResponse, error) QueryDatasource(context.Context, *QueryDatasourceRequest) (*QueryDatasourceResponse, error)
} }
// UnimplementedGrafanaAPIServer can be embedded to have forward compatible implementations.
type UnimplementedGrafanaAPIServer struct {
}
func (*UnimplementedGrafanaAPIServer) QueryDatasource(ctx context.Context, req *QueryDatasourceRequest) (*QueryDatasourceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method QueryDatasource not implemented")
}
func RegisterGrafanaAPIServer(s *grpc.Server, srv GrafanaAPIServer) { func RegisterGrafanaAPIServer(s *grpc.Server, srv GrafanaAPIServer) {
s.RegisterService(&_GrafanaAPI_serviceDesc, srv) s.RegisterService(&_GrafanaAPI_serviceDesc, srv)
} }
@ -491,38 +541,3 @@ var _GrafanaAPI_serviceDesc = grpc.ServiceDesc{
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
Metadata: "transform.proto", Metadata: "transform.proto",
} }
func init() { proto.RegisterFile("transform.proto", fileDescriptor_transform_40c78b0d7c77dad0) }
var fileDescriptor_transform_40c78b0d7c77dad0 = []byte{
// 460 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xc1, 0x6e, 0xd3, 0x40,
0x10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 0xc3, 0xcb, 0x7f, 0x6f, 0xe9, 0xd2, 0x48, 0xbf, 0xb5, 0x68, 0x2c, 0xdc, 0x0c, 0x9b, 0xc1,
0x60, 0x27, 0xb1, 0xb8, 0x97, 0xa8, 0xcb, 0x2c, 0x7e, 0xd6, 0x4f, 0xdb, 0x79, 0x4a, 0x33, 0x80,
0x0f, 0x24, 0x72, 0xa1, 0xc4, 0xfb, 0xc5, 0x9c, 0x7d, 0x85, 0xd1, 0x9e, 0x79, 0x36, 0xf6, 0xd3,
0xfd, 0x4c, 0xe2, 0x57, 0xff, 0xe9, 0xa8, 0xb7, 0x7c, 0x7f, 0xe0, 0x7e, 0xff, 0xab, 0x3f, 0x01,
0x00, 0x00, 0xff, 0xff, 0x7d, 0xdb, 0x86, 0x7a, 0x3b, 0x04, 0x00, 0x00,
}

View File

@ -31,7 +31,7 @@ type QueryResult struct {
// TransformHandler handles data source queries. // TransformHandler handles data source queries.
// Note: Arguments are sdk.Datasource objects // Note: Arguments are sdk.Datasource objects
type TransformHandler interface { type TransformHandler interface {
Transform(ctx context.Context, tr datasource.TimeRange, ds datasource.DataSourceInfo, queries []Query, api GrafanaAPIHandler) ([]QueryResult, error) Transform(ctx context.Context, tr datasource.TimeRange, queries []Query, api GrafanaAPIHandler) ([]QueryResult, error)
} }
// transformPluginWrapper converts protobuf types to sdk go types. // transformPluginWrapper converts protobuf types to sdk go types.
@ -52,15 +52,6 @@ func (p *transformPluginWrapper) Transform(ctx context.Context, req *pluginv2.Tr
To: time.Unix(0, req.TimeRange.ToEpochMs*int64(time.Millisecond)), To: time.Unix(0, req.TimeRange.ToEpochMs*int64(time.Millisecond)),
} }
dsi := datasource.DataSourceInfo{
ID: req.Datasource.Id,
OrgID: req.Datasource.OrgId,
Name: req.Datasource.Name,
Type: req.Datasource.Type,
URL: req.Datasource.Url,
JSONData: json.RawMessage(req.Datasource.JsonData),
}
var queries []Query var queries []Query
for _, q := range req.Queries { for _, q := range req.Queries {
queries = append(queries, Query{ queries = append(queries, Query{
@ -72,7 +63,7 @@ func (p *transformPluginWrapper) Transform(ctx context.Context, req *pluginv2.Tr
} }
// Makes SDK request, get SDK response // Makes SDK request, get SDK response
results, err := p.handler.Transform(ctx, tr, dsi, queries, &grafanaAPIWrapper{api: api}) results, err := p.handler.Transform(ctx, tr, queries, &grafanaAPIWrapper{api: api})
if err != nil { if err != nil {
return nil, err return nil, err
} }

2
vendor/modules.txt vendored
View File

@ -131,7 +131,7 @@ github.com/gosimple/slug
# github.com/grafana/grafana-plugin-model v0.0.0-20190930120109-1fc953a61fb4 # github.com/grafana/grafana-plugin-model v0.0.0-20190930120109-1fc953a61fb4
github.com/grafana/grafana-plugin-model/go/datasource github.com/grafana/grafana-plugin-model/go/datasource
github.com/grafana/grafana-plugin-model/go/renderer github.com/grafana/grafana-plugin-model/go/renderer
# github.com/grafana/grafana-plugin-sdk-go v0.0.0-20191029155514-4d93894a3f7a # github.com/grafana/grafana-plugin-sdk-go v0.0.0-20191105165811-c4e9ecfec89f
github.com/grafana/grafana-plugin-sdk-go/common github.com/grafana/grafana-plugin-sdk-go/common
github.com/grafana/grafana-plugin-sdk-go/dataframe github.com/grafana/grafana-plugin-sdk-go/dataframe
github.com/grafana/grafana-plugin-sdk-go/datasource github.com/grafana/grafana-plugin-sdk-go/datasource