diff --git a/riemann_encoder.go b/riemann_encoder.go index 6c35b0c..78af31c 100644 --- a/riemann_encoder.go +++ b/riemann_encoder.go @@ -22,7 +22,7 @@ import ( "sync/atomic" "time" - "github.com/golang/protobuf/proto" + "github.com/gogo/protobuf/proto" "github.com/mozilla-services/heka/message" "github.com/mozilla-services/heka/pipeline" "github.com/cspenceiv/heka-riemann-encoder/riemenc" diff --git a/riemenc/proto/proto.pb.go b/riemenc/proto/proto.pb.go index 42eea68..253830c 100644 --- a/riemenc/proto/proto.pb.go +++ b/riemenc/proto/proto.pb.go @@ -1,18 +1,33 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-gogo. // source: proto.proto // DO NOT EDIT! +/* +Package proto is a generated protocol buffer package. + +It is generated from these files: + proto.proto + +It has these top-level messages: + State + Event + Query + Msg + Attribute +*/ package proto -import proto1 "github.com/golang/protobuf/proto" -import json "encoding/json" +import proto1 "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// Reference proto, json, and math imports to suppress error if they are not otherwise used. +// Reference imports to suppress errors if they are not otherwise used. var _ = proto1.Marshal -var _ = &json.SyntaxError{} +var _ = fmt.Errorf var _ = math.Inf +// Deprecated; state was used by early versions of the protocol, but not any +// more. type State struct { Time *int64 `protobuf:"varint,1,opt,name=time" json:"time,omitempty"` State *string `protobuf:"bytes,2,opt,name=state" json:"state,omitempty"` @@ -25,62 +40,62 @@ type State struct { XXX_unrecognized []byte `json:"-"` } -func (this *State) Reset() { *this = State{} } -func (this *State) String() string { return proto1.CompactTextString(this) } -func (*State) ProtoMessage() {} +func (m *State) Reset() { *m = State{} } +func (m *State) String() string { return proto1.CompactTextString(m) } +func (*State) ProtoMessage() {} -func (this *State) GetTime() int64 { - if this != nil && this.Time != nil { - return *this.Time +func (m *State) GetTime() int64 { + if m != nil && m.Time != nil { + return *m.Time } return 0 } -func (this *State) GetState() string { - if this != nil && this.State != nil { - return *this.State +func (m *State) GetState() string { + if m != nil && m.State != nil { + return *m.State } return "" } -func (this *State) GetService() string { - if this != nil && this.Service != nil { - return *this.Service +func (m *State) GetService() string { + if m != nil && m.Service != nil { + return *m.Service } return "" } -func (this *State) GetHost() string { - if this != nil && this.Host != nil { - return *this.Host +func (m *State) GetHost() string { + if m != nil && m.Host != nil { + return *m.Host } return "" } -func (this *State) GetDescription() string { - if this != nil && this.Description != nil { - return *this.Description +func (m *State) GetDescription() string { + if m != nil && m.Description != nil { + return *m.Description } return "" } -func (this *State) GetOnce() bool { - if this != nil && this.Once != nil { - return *this.Once +func (m *State) GetOnce() bool { + if m != nil && m.Once != nil { + return *m.Once } return false } -func (this *State) GetTags() []string { - if this != nil { - return this.Tags +func (m *State) GetTags() []string { + if m != nil { + return m.Tags } return nil } -func (this *State) GetTtl() float32 { - if this != nil && this.Ttl != nil { - return *this.Ttl +func (m *State) GetTtl() float32 { + if m != nil && m.Ttl != nil { + return *m.Ttl } return 0 } @@ -100,83 +115,83 @@ type Event struct { XXX_unrecognized []byte `json:"-"` } -func (this *Event) Reset() { *this = Event{} } -func (this *Event) String() string { return proto1.CompactTextString(this) } -func (*Event) ProtoMessage() {} +func (m *Event) Reset() { *m = Event{} } +func (m *Event) String() string { return proto1.CompactTextString(m) } +func (*Event) ProtoMessage() {} -func (this *Event) GetTime() int64 { - if this != nil && this.Time != nil { - return *this.Time +func (m *Event) GetTime() int64 { + if m != nil && m.Time != nil { + return *m.Time } return 0 } -func (this *Event) GetState() string { - if this != nil && this.State != nil { - return *this.State +func (m *Event) GetState() string { + if m != nil && m.State != nil { + return *m.State } return "" } -func (this *Event) GetService() string { - if this != nil && this.Service != nil { - return *this.Service +func (m *Event) GetService() string { + if m != nil && m.Service != nil { + return *m.Service } return "" } -func (this *Event) GetHost() string { - if this != nil && this.Host != nil { - return *this.Host +func (m *Event) GetHost() string { + if m != nil && m.Host != nil { + return *m.Host } return "" } -func (this *Event) GetDescription() string { - if this != nil && this.Description != nil { - return *this.Description +func (m *Event) GetDescription() string { + if m != nil && m.Description != nil { + return *m.Description } return "" } -func (this *Event) GetTags() []string { - if this != nil { - return this.Tags +func (m *Event) GetTags() []string { + if m != nil { + return m.Tags } return nil } -func (this *Event) GetTtl() float32 { - if this != nil && this.Ttl != nil { - return *this.Ttl +func (m *Event) GetTtl() float32 { + if m != nil && m.Ttl != nil { + return *m.Ttl } return 0 } -func (this *Event) GetAttributes() []*Attribute { - if this != nil { - return this.Attributes +func (m *Event) GetAttributes() []*Attribute { + if m != nil { + return m.Attributes } return nil } -func (this *Event) GetMetricSint64() int64 { - if this != nil && this.MetricSint64 != nil { - return *this.MetricSint64 +func (m *Event) GetMetricSint64() int64 { + if m != nil && m.MetricSint64 != nil { + return *m.MetricSint64 } return 0 } -func (this *Event) GetMetricD() float64 { - if this != nil && this.MetricD != nil { - return *this.MetricD +func (m *Event) GetMetricD() float64 { + if m != nil && m.MetricD != nil { + return *m.MetricD } return 0 } -func (this *Event) GetMetricF() float32 { - if this != nil && this.MetricF != nil { - return *this.MetricF +func (m *Event) GetMetricF() float32 { + if m != nil && m.MetricF != nil { + return *m.MetricF } return 0 } @@ -186,13 +201,13 @@ type Query struct { XXX_unrecognized []byte `json:"-"` } -func (this *Query) Reset() { *this = Query{} } -func (this *Query) String() string { return proto1.CompactTextString(this) } -func (*Query) ProtoMessage() {} +func (m *Query) Reset() { *m = Query{} } +func (m *Query) String() string { return proto1.CompactTextString(m) } +func (*Query) ProtoMessage() {} -func (this *Query) GetString_() string { - if this != nil && this.String_ != nil { - return *this.String_ +func (m *Query) GetString_() string { + if m != nil && m.String_ != nil { + return *m.String_ } return "" } @@ -206,41 +221,41 @@ type Msg struct { XXX_unrecognized []byte `json:"-"` } -func (this *Msg) Reset() { *this = Msg{} } -func (this *Msg) String() string { return proto1.CompactTextString(this) } -func (*Msg) ProtoMessage() {} +func (m *Msg) Reset() { *m = Msg{} } +func (m *Msg) String() string { return proto1.CompactTextString(m) } +func (*Msg) ProtoMessage() {} -func (this *Msg) GetOk() bool { - if this != nil && this.Ok != nil { - return *this.Ok +func (m *Msg) GetOk() bool { + if m != nil && m.Ok != nil { + return *m.Ok } return false } -func (this *Msg) GetError() string { - if this != nil && this.Error != nil { - return *this.Error +func (m *Msg) GetError() string { + if m != nil && m.Error != nil { + return *m.Error } return "" } -func (this *Msg) GetStates() []*State { - if this != nil { - return this.States +func (m *Msg) GetStates() []*State { + if m != nil { + return m.States } return nil } -func (this *Msg) GetQuery() *Query { - if this != nil { - return this.Query +func (m *Msg) GetQuery() *Query { + if m != nil { + return m.Query } return nil } -func (this *Msg) GetEvents() []*Event { - if this != nil { - return this.Events +func (m *Msg) GetEvents() []*Event { + if m != nil { + return m.Events } return nil } @@ -251,23 +266,28 @@ type Attribute struct { XXX_unrecognized []byte `json:"-"` } -func (this *Attribute) Reset() { *this = Attribute{} } -func (this *Attribute) String() string { return proto1.CompactTextString(this) } -func (*Attribute) ProtoMessage() {} +func (m *Attribute) Reset() { *m = Attribute{} } +func (m *Attribute) String() string { return proto1.CompactTextString(m) } +func (*Attribute) ProtoMessage() {} -func (this *Attribute) GetKey() string { - if this != nil && this.Key != nil { - return *this.Key +func (m *Attribute) GetKey() string { + if m != nil && m.Key != nil { + return *m.Key } return "" } -func (this *Attribute) GetValue() string { - if this != nil && this.Value != nil { - return *this.Value +func (m *Attribute) GetValue() string { + if m != nil && m.Value != nil { + return *m.Value } return "" } func init() { + proto1.RegisterType((*State)(nil), "State") + proto1.RegisterType((*Event)(nil), "Event") + proto1.RegisterType((*Query)(nil), "Query") + proto1.RegisterType((*Msg)(nil), "Msg") + proto1.RegisterType((*Attribute)(nil), "Attribute") } diff --git a/riemenc/riemenc.go b/riemenc/riemenc.go index 96cfba8..522cd3b 100644 --- a/riemenc/riemenc.go +++ b/riemenc/riemenc.go @@ -4,7 +4,7 @@ import ( "fmt" "reflect" - pb "github.com/golang/protobuf/proto" + pb "github.com/gogo/protobuf/proto" "github.com/cspenceiv/heka-riemann-encoder/riemenc/proto" )