diff --git a/Gopkg.lock b/Gopkg.lock index b392091c..0cd0a9cc 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -217,18 +217,6 @@ revision = "b32fa301c9fe55953584134cb6853a13c87ec0a1" version = "v0.16.0" -[[projects]] - digest = "1:bfc758d5a03d57d97226fac6934551c01bd76612adb119c177395b057a0a46db" - name = "github.com/gogo/protobuf" - packages = [ - "gogoproto", - "proto", - "protoc-gen-gogo/descriptor", - ] - pruneopts = "UT" - revision = "636bf0302bc95575d69441b25a2603156ffdddf1" - version = "v1.1.1" - [[projects]] branch = "master" digest = "1:3fb07f8e222402962fa190eb060608b34eddfb64562a18e2167df2de0ece85d8" @@ -246,7 +234,7 @@ version = "v1.1.1" [[projects]] - digest = "1:a900f61eec53062419a966d0cf0f4afdce2eefdf39d976fe2fc7b7289b99c038" + digest = "1:4fbf68bee2a60f6af6414572936edb295f6f26b73c6fb25ab0e7b03b013854f5" name = "github.com/golang/protobuf" packages = [ "jsonpb", @@ -261,8 +249,8 @@ "ptypes/wrappers", ] pruneopts = "UT" - revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" - version = "v1.1.0" + revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5" + version = "v1.2.0" [[projects]] branch = "master" @@ -769,7 +757,6 @@ "github.com/coreos/etcd/clientv3/namespace", "github.com/coreos/etcd/integration", "github.com/coreos/etcd/mvcc/mvccpb", - "github.com/gogo/protobuf/proto", "github.com/golang/mock/gomock", "github.com/golang/protobuf/proto", "github.com/golang/protobuf/protoc-gen-go/descriptor", diff --git a/Gopkg.toml b/Gopkg.toml index bb2e7611..f9c721a2 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -26,8 +26,8 @@ [[constraint]] - name = "github.com/gogo/protobuf" - version = "1.1.1" + name = "github.com/golang/protobuf" + version = "=1.2.0" [[constraint]] name = "github.com/gorilla/websocket" diff --git a/Makefile b/Makefile index f8ef7d58..dfa14256 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ setup-ci: setup-protobuf-macos: @brew install protobuf - @go get -u github.com/gogo/protobuf/protoc-gen-gogofaster + @go get github.com/golang/protobuf/protoc-gen-go run-chat-example: @cd examples/testing && docker-compose up -d etcd nats && cd ../demo/chat/ && go run main.go @@ -51,8 +51,8 @@ run-custom-metrics-example: protos-compile: @cd benchmark/testdata && ./gen_proto.sh - @protoc -I pitaya-protos/ pitaya-protos/*.proto --gogofaster_out=plugins=grpc:protos - @protoc -I pitaya-protos/test pitaya-protos/test/*.proto --gogofaster_out=protos/test + @protoc -I pitaya-protos/ pitaya-protos/*.proto --go_out=plugins=grpc:protos + @protoc -I pitaya-protos/test pitaya-protos/test/*.proto --go_out=protos/test rm-test-temp-files: @rm -f cluster/127.0.0.1* 127.0.0.1* diff --git a/agent/agent_remote.go b/agent/agent_remote.go index d9c32675..db714421 100644 --- a/agent/agent_remote.go +++ b/agent/agent_remote.go @@ -25,7 +25,7 @@ import ( "net" "reflect" - "github.com/gogo/protobuf/proto" + "github.com/golang/protobuf/proto" "github.com/topfreegames/pitaya/cluster" "github.com/topfreegames/pitaya/conn/codec" "github.com/topfreegames/pitaya/conn/message" diff --git a/benchmark/testdata/gen_proto.sh b/benchmark/testdata/gen_proto.sh index 5541a7d7..a64567fa 100755 --- a/benchmark/testdata/gen_proto.sh +++ b/benchmark/testdata/gen_proto.sh @@ -1 +1 @@ -protoc --gogofaster_out=. *.proto +protoc --go_out . *.proto diff --git a/benchmark/testdata/test.pb.go b/benchmark/testdata/test.pb.go index c6947643..f661f62f 100644 --- a/benchmark/testdata/test.pb.go +++ b/benchmark/testdata/test.pb.go @@ -1,14 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: test.proto package testdata -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -18,38 +16,32 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type Ping struct { - Content string `protobuf:"bytes,1,opt,name=Content,proto3" json:"Content,omitempty"` + Content string `protobuf:"bytes,1,opt,name=Content,proto3" json:"Content,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Ping) Reset() { *m = Ping{} } func (m *Ping) String() string { return proto.CompactTextString(m) } func (*Ping) ProtoMessage() {} func (*Ping) Descriptor() ([]byte, []int) { - return fileDescriptor_test_8c7810998b5d6d3a, []int{0} + return fileDescriptor_test_d5fedb75cd53f8a3, []int{0} } func (m *Ping) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_Ping.Unmarshal(m, b) } func (m *Ping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Ping.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_Ping.Marshal(b, m, deterministic) } func (dst *Ping) XXX_Merge(src proto.Message) { xxx_messageInfo_Ping.Merge(dst, src) } func (m *Ping) XXX_Size() int { - return m.Size() + return xxx_messageInfo_Ping.Size(m) } func (m *Ping) XXX_DiscardUnknown() { xxx_messageInfo_Ping.DiscardUnknown(m) @@ -65,35 +57,29 @@ func (m *Ping) GetContent() string { } type Pong struct { - Content string `protobuf:"bytes,2,opt,name=Content,proto3" json:"Content,omitempty"` + Content string `protobuf:"bytes,2,opt,name=Content,proto3" json:"Content,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Pong) Reset() { *m = Pong{} } func (m *Pong) String() string { return proto.CompactTextString(m) } func (*Pong) ProtoMessage() {} func (*Pong) Descriptor() ([]byte, []int) { - return fileDescriptor_test_8c7810998b5d6d3a, []int{1} + return fileDescriptor_test_d5fedb75cd53f8a3, []int{1} } func (m *Pong) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_Pong.Unmarshal(m, b) } func (m *Pong) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Pong.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_Pong.Marshal(b, m, deterministic) } func (dst *Pong) XXX_Merge(src proto.Message) { xxx_messageInfo_Pong.Merge(dst, src) } func (m *Pong) XXX_Size() int { - return m.Size() + return xxx_messageInfo_Pong.Size(m) } func (m *Pong) XXX_DiscardUnknown() { xxx_messageInfo_Pong.DiscardUnknown(m) @@ -112,374 +98,15 @@ func init() { proto.RegisterType((*Ping)(nil), "testdata.Ping") proto.RegisterType((*Pong)(nil), "testdata.Pong") } -func (m *Ping) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Ping) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Content) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTest(dAtA, i, uint64(len(m.Content))) - i += copy(dAtA[i:], m.Content) - } - return i, nil -} - -func (m *Pong) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Pong) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Content) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTest(dAtA, i, uint64(len(m.Content))) - i += copy(dAtA[i:], m.Content) - } - return i, nil -} - -func encodeVarintTest(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *Ping) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Content) - if l > 0 { - n += 1 + l + sovTest(uint64(l)) - } - return n -} - -func (m *Pong) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Content) - if l > 0 { - n += 1 + l + sovTest(uint64(l)) - } - return n -} - -func sovTest(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozTest(x uint64) (n int) { - return sovTest(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Ping) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTest - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Ping: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Ping: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTest - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTest - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Content = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTest(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTest - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Pong) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTest - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Pong: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Pong: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTest - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTest - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Content = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTest(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTest - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTest(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTest - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTest - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTest - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthTest - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTest - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipTest(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthTest = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTest = fmt.Errorf("proto: integer overflow") -) -func init() { proto.RegisterFile("test.proto", fileDescriptor_test_8c7810998b5d6d3a) } +func init() { proto.RegisterFile("test.proto", fileDescriptor_test_d5fedb75cd53f8a3) } -var fileDescriptor_test_8c7810998b5d6d3a = []byte{ - // 112 bytes of a gzipped FileDescriptorProto +var fileDescriptor_test_d5fedb75cd53f8a3 = []byte{ + // 85 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0x49, 0x2d, 0x2e, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x00, 0xb1, 0x53, 0x12, 0x4b, 0x12, 0x95, 0x14, 0xb8, 0x58, 0x02, 0x32, 0xf3, 0xd2, 0x85, 0x24, 0xb8, 0xd8, 0x9d, 0xf3, 0xf3, 0x4a, 0x52, 0xf3, 0x4a, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x60, 0x5c, 0xb0, 0x8a, 0x7c, 0x54, 0x15, 0x4c, - 0x28, 0x2a, 0x9c, 0x24, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, - 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x89, 0x0d, - 0x6c, 0x9d, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x62, 0x74, 0xd7, 0x0b, 0x7c, 0x00, 0x00, 0x00, + 0x28, 0x2a, 0x92, 0xd8, 0xc0, 0x86, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x01, 0xcd, 0x56, + 0xda, 0x62, 0x00, 0x00, 0x00, } diff --git a/client/protoclient.go b/client/protoclient.go index b6a27fd3..4a04c454 100644 --- a/client/protoclient.go +++ b/client/protoclient.go @@ -29,7 +29,7 @@ import ( "strings" "time" - "github.com/gogo/protobuf/proto" + "github.com/golang/protobuf/proto" protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor" "github.com/jhump/protoreflect/desc" "github.com/jhump/protoreflect/dynamic" diff --git a/cluster/nats_rpc_client.go b/cluster/nats_rpc_client.go index 22da8039..5888650b 100644 --- a/cluster/nats_rpc_client.go +++ b/cluster/nats_rpc_client.go @@ -25,7 +25,7 @@ import ( "fmt" "time" - "github.com/gogo/protobuf/proto" + "github.com/golang/protobuf/proto" nats "github.com/nats-io/go-nats" opentracing "github.com/opentracing/opentracing-go" "github.com/topfreegames/pitaya/config" diff --git a/cluster/nats_rpc_client_test.go b/cluster/nats_rpc_client_test.go index fc6cb3d1..0852592f 100644 --- a/cluster/nats_rpc_client_test.go +++ b/cluster/nats_rpc_client_test.go @@ -27,8 +27,8 @@ import ( "testing" "time" - "github.com/gogo/protobuf/proto" "github.com/golang/mock/gomock" + "github.com/golang/protobuf/proto" "github.com/google/uuid" nats "github.com/nats-io/go-nats" "github.com/spf13/viper" diff --git a/cluster/nats_rpc_server.go b/cluster/nats_rpc_server.go index a1b692b6..706b8003 100644 --- a/cluster/nats_rpc_server.go +++ b/cluster/nats_rpc_server.go @@ -26,7 +26,7 @@ import ( "fmt" "math" - "github.com/gogo/protobuf/proto" + "github.com/golang/protobuf/proto" nats "github.com/nats-io/go-nats" "github.com/topfreegames/pitaya/config" "github.com/topfreegames/pitaya/constants" diff --git a/cluster/nats_rpc_server_test.go b/cluster/nats_rpc_server_test.go index ea2a42c3..5497d557 100644 --- a/cluster/nats_rpc_server_test.go +++ b/cluster/nats_rpc_server_test.go @@ -26,8 +26,8 @@ import ( "testing" "time" - "github.com/gogo/protobuf/proto" "github.com/golang/mock/gomock" + "github.com/golang/protobuf/proto" nats "github.com/nats-io/go-nats" "github.com/spf13/viper" "github.com/stretchr/testify/assert" diff --git a/component/method.go b/component/method.go index 3fa9845e..9d50e67e 100644 --- a/component/method.go +++ b/component/method.go @@ -26,7 +26,7 @@ import ( "unicode" "unicode/utf8" - "github.com/gogo/protobuf/proto" + "github.com/golang/protobuf/proto" "github.com/topfreegames/pitaya/conn/message" ) diff --git a/docgenerator/descriptors.go b/docgenerator/descriptors.go index 136d6ad4..cde6f324 100644 --- a/docgenerator/descriptors.go +++ b/docgenerator/descriptors.go @@ -4,7 +4,7 @@ import ( "reflect" "strings" - "github.com/gogo/protobuf/proto" + "github.com/golang/protobuf/proto" "github.com/topfreegames/pitaya/constants" ) diff --git a/examples/demo/cluster_protobuf/protos/cluster.pb.go b/examples/demo/cluster_protobuf/protos/cluster.pb.go index e78f0381..8570b802 100644 --- a/examples/demo/cluster_protobuf/protos/cluster.pb.go +++ b/examples/demo/cluster_protobuf/protos/cluster.pb.go @@ -1,27 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: cluster.proto -/* - Package protos is a generated protocol buffer package. - - It is generated from these files: - cluster.proto - - It has these top-level messages: - Response - UserMessage - NewUser - RPCMsg - AllMembers -*/ package protos -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -31,18 +16,40 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // Response represents a rpc message type Response struct { - Code int32 `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"` - Msg string `protobuf:"bytes,2,opt,name=Msg,proto3" json:"Msg,omitempty"` + Code int32 `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=Msg,proto3" json:"Msg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { return fileDescriptorCluster, []int{0} } +func (m *Response) Reset() { *m = Response{} } +func (m *Response) String() string { return proto.CompactTextString(m) } +func (*Response) ProtoMessage() {} +func (*Response) Descriptor() ([]byte, []int) { + return fileDescriptor_cluster_95360d360239b954, []int{0} +} +func (m *Response) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Response.Unmarshal(m, b) +} +func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Response.Marshal(b, m, deterministic) +} +func (dst *Response) XXX_Merge(src proto.Message) { + xxx_messageInfo_Response.Merge(dst, src) +} +func (m *Response) XXX_Size() int { + return xxx_messageInfo_Response.Size(m) +} +func (m *Response) XXX_DiscardUnknown() { + xxx_messageInfo_Response.DiscardUnknown(m) +} + +var xxx_messageInfo_Response proto.InternalMessageInfo func (m *Response) GetCode() int32 { if m != nil { @@ -60,14 +67,36 @@ func (m *Response) GetMsg() string { // UserMessage represents a message that user sent type UserMessage struct { - Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` - Content string `protobuf:"bytes,2,opt,name=Content,proto3" json:"Content,omitempty"` + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` + Content string `protobuf:"bytes,2,opt,name=Content,proto3" json:"Content,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UserMessage) Reset() { *m = UserMessage{} } +func (m *UserMessage) String() string { return proto.CompactTextString(m) } +func (*UserMessage) ProtoMessage() {} +func (*UserMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_cluster_95360d360239b954, []int{1} +} +func (m *UserMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserMessage.Unmarshal(m, b) +} +func (m *UserMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserMessage.Marshal(b, m, deterministic) +} +func (dst *UserMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserMessage.Merge(dst, src) +} +func (m *UserMessage) XXX_Size() int { + return xxx_messageInfo_UserMessage.Size(m) +} +func (m *UserMessage) XXX_DiscardUnknown() { + xxx_messageInfo_UserMessage.DiscardUnknown(m) } -func (m *UserMessage) Reset() { *m = UserMessage{} } -func (m *UserMessage) String() string { return proto.CompactTextString(m) } -func (*UserMessage) ProtoMessage() {} -func (*UserMessage) Descriptor() ([]byte, []int) { return fileDescriptorCluster, []int{1} } +var xxx_messageInfo_UserMessage proto.InternalMessageInfo func (m *UserMessage) GetName() string { if m != nil { @@ -85,13 +114,35 @@ func (m *UserMessage) GetContent() string { // NewUser message will be received when new user join room type NewUser struct { - Content string `protobuf:"bytes,1,opt,name=Content,proto3" json:"Content,omitempty"` + Content string `protobuf:"bytes,1,opt,name=Content,proto3" json:"Content,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *NewUser) Reset() { *m = NewUser{} } -func (m *NewUser) String() string { return proto.CompactTextString(m) } -func (*NewUser) ProtoMessage() {} -func (*NewUser) Descriptor() ([]byte, []int) { return fileDescriptorCluster, []int{2} } +func (m *NewUser) Reset() { *m = NewUser{} } +func (m *NewUser) String() string { return proto.CompactTextString(m) } +func (*NewUser) ProtoMessage() {} +func (*NewUser) Descriptor() ([]byte, []int) { + return fileDescriptor_cluster_95360d360239b954, []int{2} +} +func (m *NewUser) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NewUser.Unmarshal(m, b) +} +func (m *NewUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NewUser.Marshal(b, m, deterministic) +} +func (dst *NewUser) XXX_Merge(src proto.Message) { + xxx_messageInfo_NewUser.Merge(dst, src) +} +func (m *NewUser) XXX_Size() int { + return xxx_messageInfo_NewUser.Size(m) +} +func (m *NewUser) XXX_DiscardUnknown() { + xxx_messageInfo_NewUser.DiscardUnknown(m) +} + +var xxx_messageInfo_NewUser proto.InternalMessageInfo func (m *NewUser) GetContent() string { if m != nil { @@ -101,14 +152,36 @@ func (m *NewUser) GetContent() string { } type RPCMsg struct { - Route string `protobuf:"bytes,1,opt,name=Route,proto3" json:"Route,omitempty"` - Msg string `protobuf:"bytes,2,opt,name=Msg,proto3" json:"Msg,omitempty"` + Route string `protobuf:"bytes,1,opt,name=Route,proto3" json:"Route,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=Msg,proto3" json:"Msg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RPCMsg) Reset() { *m = RPCMsg{} } +func (m *RPCMsg) String() string { return proto.CompactTextString(m) } +func (*RPCMsg) ProtoMessage() {} +func (*RPCMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_cluster_95360d360239b954, []int{3} +} +func (m *RPCMsg) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RPCMsg.Unmarshal(m, b) +} +func (m *RPCMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RPCMsg.Marshal(b, m, deterministic) +} +func (dst *RPCMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_RPCMsg.Merge(dst, src) +} +func (m *RPCMsg) XXX_Size() int { + return xxx_messageInfo_RPCMsg.Size(m) +} +func (m *RPCMsg) XXX_DiscardUnknown() { + xxx_messageInfo_RPCMsg.DiscardUnknown(m) } -func (m *RPCMsg) Reset() { *m = RPCMsg{} } -func (m *RPCMsg) String() string { return proto.CompactTextString(m) } -func (*RPCMsg) ProtoMessage() {} -func (*RPCMsg) Descriptor() ([]byte, []int) { return fileDescriptorCluster, []int{3} } +var xxx_messageInfo_RPCMsg proto.InternalMessageInfo func (m *RPCMsg) GetRoute() string { if m != nil { @@ -126,13 +199,35 @@ func (m *RPCMsg) GetMsg() string { // AllMembers contains all members uid type AllMembers struct { - Members []string `protobuf:"bytes,1,rep,name=Members" json:"Members,omitempty"` + Members []string `protobuf:"bytes,1,rep,name=Members,proto3" json:"Members,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AllMembers) Reset() { *m = AllMembers{} } +func (m *AllMembers) String() string { return proto.CompactTextString(m) } +func (*AllMembers) ProtoMessage() {} +func (*AllMembers) Descriptor() ([]byte, []int) { + return fileDescriptor_cluster_95360d360239b954, []int{4} +} +func (m *AllMembers) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AllMembers.Unmarshal(m, b) +} +func (m *AllMembers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AllMembers.Marshal(b, m, deterministic) +} +func (dst *AllMembers) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllMembers.Merge(dst, src) +} +func (m *AllMembers) XXX_Size() int { + return xxx_messageInfo_AllMembers.Size(m) +} +func (m *AllMembers) XXX_DiscardUnknown() { + xxx_messageInfo_AllMembers.DiscardUnknown(m) } -func (m *AllMembers) Reset() { *m = AllMembers{} } -func (m *AllMembers) String() string { return proto.CompactTextString(m) } -func (*AllMembers) ProtoMessage() {} -func (*AllMembers) Descriptor() ([]byte, []int) { return fileDescriptorCluster, []int{4} } +var xxx_messageInfo_AllMembers proto.InternalMessageInfo func (m *AllMembers) GetMembers() []string { if m != nil { @@ -148,830 +243,21 @@ func init() { proto.RegisterType((*RPCMsg)(nil), "protos.RPCMsg") proto.RegisterType((*AllMembers)(nil), "protos.AllMembers") } -func (m *Response) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Response) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Code != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintCluster(dAtA, i, uint64(m.Code)) - } - if len(m.Msg) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintCluster(dAtA, i, uint64(len(m.Msg))) - i += copy(dAtA[i:], m.Msg) - } - return i, nil -} - -func (m *UserMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UserMessage) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCluster(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Content) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintCluster(dAtA, i, uint64(len(m.Content))) - i += copy(dAtA[i:], m.Content) - } - return i, nil -} - -func (m *NewUser) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NewUser) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Content) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCluster(dAtA, i, uint64(len(m.Content))) - i += copy(dAtA[i:], m.Content) - } - return i, nil -} - -func (m *RPCMsg) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RPCMsg) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Route) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCluster(dAtA, i, uint64(len(m.Route))) - i += copy(dAtA[i:], m.Route) - } - if len(m.Msg) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintCluster(dAtA, i, uint64(len(m.Msg))) - i += copy(dAtA[i:], m.Msg) - } - return i, nil -} - -func (m *AllMembers) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AllMembers) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Members) > 0 { - for _, s := range m.Members { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - return i, nil -} - -func encodeVarintCluster(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *Response) Size() (n int) { - var l int - _ = l - if m.Code != 0 { - n += 1 + sovCluster(uint64(m.Code)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovCluster(uint64(l)) - } - return n -} - -func (m *UserMessage) Size() (n int) { - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovCluster(uint64(l)) - } - l = len(m.Content) - if l > 0 { - n += 1 + l + sovCluster(uint64(l)) - } - return n -} - -func (m *NewUser) Size() (n int) { - var l int - _ = l - l = len(m.Content) - if l > 0 { - n += 1 + l + sovCluster(uint64(l)) - } - return n -} - -func (m *RPCMsg) Size() (n int) { - var l int - _ = l - l = len(m.Route) - if l > 0 { - n += 1 + l + sovCluster(uint64(l)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovCluster(uint64(l)) - } - return n -} - -func (m *AllMembers) Size() (n int) { - var l int - _ = l - if len(m.Members) > 0 { - for _, s := range m.Members { - l = len(s) - n += 1 + l + sovCluster(uint64(l)) - } - } - return n -} - -func sovCluster(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozCluster(x uint64) (n int) { - return sovCluster(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Response) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Response: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Response: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Code |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCluster - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCluster(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCluster - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UserMessage) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UserMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UserMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCluster - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCluster - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Content = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCluster(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCluster - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NewUser) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NewUser: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NewUser: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCluster - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Content = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCluster(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCluster - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RPCMsg) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RPCMsg: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RPCMsg: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Route", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCluster - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Route = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCluster - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCluster(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCluster - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AllMembers) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AllMembers: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AllMembers: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCluster - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Members = append(m.Members, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCluster(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCluster - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipCluster(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCluster - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCluster - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCluster - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthCluster - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCluster - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipCluster(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthCluster = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCluster = fmt.Errorf("proto: integer overflow") -) - -func init() { proto.RegisterFile("cluster.proto", fileDescriptorCluster) } -var fileDescriptorCluster = []byte{ - // 213 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4d, 0xce, 0x29, 0x2d, - 0x2e, 0x49, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, 0x06, - 0x5c, 0x1c, 0x41, 0xa9, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x42, 0x42, 0x5c, 0x2c, 0xce, 0xf9, - 0x29, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xac, 0x41, 0x60, 0xb6, 0x90, 0x00, 0x17, 0xb3, 0x6f, - 0x71, 0xba, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x88, 0xa9, 0x64, 0xcd, 0xc5, 0x1d, 0x5a, - 0x9c, 0x5a, 0xe4, 0x9b, 0x5a, 0x5c, 0x9c, 0x98, 0x0e, 0xd6, 0xe4, 0x97, 0x98, 0x0b, 0xd1, 0xc4, - 0x19, 0x04, 0x66, 0x0b, 0x49, 0x70, 0xb1, 0x3b, 0xe7, 0xe7, 0x95, 0xa4, 0xe6, 0x95, 0x40, 0x35, - 0xc2, 0xb8, 0x4a, 0xca, 0x5c, 0xec, 0x7e, 0xa9, 0xe5, 0x20, 0xfd, 0xc8, 0x8a, 0x18, 0x51, 0x15, - 0x19, 0x70, 0xb1, 0x05, 0x05, 0x38, 0xfb, 0x16, 0xa7, 0x0b, 0x89, 0x70, 0xb1, 0x06, 0xe5, 0x97, - 0x96, 0xc0, 0x4c, 0x87, 0x70, 0xb0, 0xb8, 0x49, 0x8d, 0x8b, 0xcb, 0x31, 0x27, 0xc7, 0x37, 0x35, - 0x37, 0x29, 0xb5, 0xa8, 0x18, 0x64, 0x32, 0x94, 0x29, 0xc1, 0xa8, 0xc0, 0x0c, 0x32, 0x19, 0xca, - 0x75, 0x12, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, - 0x3c, 0x96, 0x63, 0x48, 0x82, 0x84, 0x83, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xe4, 0x7d, 0x2a, - 0x2e, 0x1f, 0x01, 0x00, 0x00, +func init() { proto.RegisterFile("cluster.proto", fileDescriptor_cluster_95360d360239b954) } + +var fileDescriptor_cluster_95360d360239b954 = []byte{ + // 192 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x8f, 0x31, 0xab, 0x83, 0x30, + 0x14, 0x85, 0xc9, 0xf3, 0xa9, 0xcf, 0xfb, 0x28, 0x94, 0xd0, 0x21, 0xa3, 0x58, 0x28, 0x4e, 0x45, + 0xe8, 0xd8, 0xa9, 0x38, 0x47, 0x4a, 0xa0, 0x3f, 0x40, 0xdb, 0x8b, 0x8b, 0x1a, 0xc9, 0x8d, 0xf4, + 0xef, 0x97, 0x44, 0x85, 0x16, 0x3a, 0xe5, 0x3b, 0x70, 0xbe, 0x43, 0x2e, 0x6c, 0xee, 0xdd, 0x44, + 0x16, 0xcd, 0x71, 0x34, 0xda, 0x6a, 0x1e, 0xf9, 0x87, 0xb2, 0x02, 0xfe, 0x14, 0xd2, 0xa8, 0x07, + 0x42, 0xce, 0xe1, 0xb7, 0xd4, 0x0f, 0x14, 0x2c, 0x65, 0x79, 0xa8, 0x3c, 0xf3, 0x2d, 0x04, 0x92, + 0x5a, 0xf1, 0x93, 0xb2, 0x3c, 0x51, 0x0e, 0xb3, 0x33, 0xfc, 0xdf, 0x08, 0x8d, 0x44, 0xa2, 0xba, + 0xf5, 0x52, 0x55, 0xf7, 0xb3, 0x94, 0x28, 0xcf, 0x5c, 0x40, 0x5c, 0xea, 0xc1, 0xe2, 0x60, 0x17, + 0x71, 0x8d, 0xd9, 0x1e, 0xe2, 0x0a, 0x9f, 0xce, 0x7f, 0x2f, 0xb1, 0xcf, 0x52, 0x01, 0x91, 0xba, + 0x96, 0x92, 0x5a, 0xbe, 0x83, 0x50, 0xe9, 0xc9, 0xae, 0xeb, 0x73, 0xf8, 0xf2, 0xa7, 0x03, 0xc0, + 0xa5, 0xeb, 0x24, 0xf6, 0x0d, 0x1a, 0x72, 0xcb, 0x0b, 0x0a, 0x96, 0x06, 0x6e, 0x79, 0x89, 0xcd, + 0x7c, 0xf5, 0xe9, 0x15, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x13, 0x90, 0x17, 0x0d, 0x01, 0x00, 0x00, } diff --git a/examples/demo/worker/protos/arg.pb.go b/examples/demo/worker/protos/arg.pb.go index e2c8495c..fca6e659 100644 --- a/examples/demo/worker/protos/arg.pb.go +++ b/examples/demo/worker/protos/arg.pb.go @@ -1,4 +1,4 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: arg.proto package protos @@ -7,8 +7,6 @@ import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -31,28 +29,19 @@ func (m *Arg) Reset() { *m = Arg{} } func (m *Arg) String() string { return proto.CompactTextString(m) } func (*Arg) ProtoMessage() {} func (*Arg) Descriptor() ([]byte, []int) { - return fileDescriptor_arg_20896c0ea027c0a6, []int{0} + return fileDescriptor_arg_e1b1c8888ddf9d6e, []int{0} } func (m *Arg) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_Arg.Unmarshal(m, b) } func (m *Arg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Arg.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_Arg.Marshal(b, m, deterministic) } func (dst *Arg) XXX_Merge(src proto.Message) { xxx_messageInfo_Arg.Merge(dst, src) } func (m *Arg) XXX_Size() int { - return m.Size() + return xxx_messageInfo_Arg.Size(m) } func (m *Arg) XXX_DiscardUnknown() { xxx_messageInfo_Arg.DiscardUnknown(m) @@ -70,261 +59,14 @@ func (m *Arg) GetMsg() string { func init() { proto.RegisterType((*Arg)(nil), "protos.Arg") } -func (m *Arg) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Arg) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Msg) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintArg(dAtA, i, uint64(len(m.Msg))) - i += copy(dAtA[i:], m.Msg) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeVarintArg(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *Arg) Size() (n int) { - var l int - _ = l - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovArg(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovArg(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozArg(x uint64) (n int) { - return sovArg(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Arg) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowArg - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Arg: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Arg: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowArg - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthArg - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipArg(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthArg - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipArg(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowArg - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowArg - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowArg - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthArg - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowArg - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipArg(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthArg = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowArg = fmt.Errorf("proto: integer overflow") -) -func init() { proto.RegisterFile("arg.proto", fileDescriptor_arg_20896c0ea027c0a6) } +func init() { proto.RegisterFile("arg.proto", fileDescriptor_arg_e1b1c8888ddf9d6e) } -var fileDescriptor_arg_20896c0ea027c0a6 = []byte{ - // 85 bytes of a gzipped FileDescriptorProto +var fileDescriptor_arg_e1b1c8888ddf9d6e = []byte{ + // 66 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x2c, 0x4a, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, 0xe2, 0x5c, 0xcc, 0x8e, 0x45, 0xe9, 0x42, 0x02, 0x5c, 0xcc, 0xb9, 0xc5, 0xe9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x20, - 0xa6, 0x93, 0xc0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, - 0xe3, 0xb1, 0x1c, 0x43, 0x12, 0x44, 0x8b, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xf1, 0xdf, 0xac, - 0x8e, 0x46, 0x00, 0x00, 0x00, + 0x66, 0x12, 0x44, 0x81, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x57, 0x6c, 0xa7, 0xb1, 0x34, 0x00, + 0x00, 0x00, } diff --git a/examples/demo/worker/protos/response.pb.go b/examples/demo/worker/protos/response.pb.go index 10a673bb..49711c42 100644 --- a/examples/demo/worker/protos/response.pb.go +++ b/examples/demo/worker/protos/response.pb.go @@ -1,4 +1,4 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: response.proto package protos @@ -7,8 +7,6 @@ import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -32,28 +30,19 @@ func (m *Response) Reset() { *m = Response{} } func (m *Response) String() string { return proto.CompactTextString(m) } func (*Response) ProtoMessage() {} func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_response_5ea34d2f1531e33d, []int{0} + return fileDescriptor_response_7319a4323854ca68, []int{0} } func (m *Response) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_Response.Unmarshal(m, b) } func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Response.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_Response.Marshal(b, m, deterministic) } func (dst *Response) XXX_Merge(src proto.Message) { xxx_messageInfo_Response.Merge(dst, src) } func (m *Response) XXX_Size() int { - return m.Size() + return xxx_messageInfo_Response.Size(m) } func (m *Response) XXX_DiscardUnknown() { xxx_messageInfo_Response.DiscardUnknown(m) @@ -78,289 +67,15 @@ func (m *Response) GetMsg() string { func init() { proto.RegisterType((*Response)(nil), "protos.Response") } -func (m *Response) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Response) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Code != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintResponse(dAtA, i, uint64(m.Code)) - } - if len(m.Msg) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintResponse(dAtA, i, uint64(len(m.Msg))) - i += copy(dAtA[i:], m.Msg) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeVarintResponse(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *Response) Size() (n int) { - var l int - _ = l - if m.Code != 0 { - n += 1 + sovResponse(uint64(m.Code)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovResponse(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovResponse(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozResponse(x uint64) (n int) { - return sovResponse(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Response) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Response: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Response: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Code |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthResponse - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipResponse(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthResponse - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipResponse(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResponse - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResponse - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResponse - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthResponse - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResponse - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipResponse(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthResponse = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowResponse = fmt.Errorf("proto: integer overflow") -) -func init() { proto.RegisterFile("response.proto", fileDescriptor_response_5ea34d2f1531e33d) } +func init() { proto.RegisterFile("response.proto", fileDescriptor_response_7319a4323854ca68) } -var fileDescriptor_response_5ea34d2f1531e33d = []byte{ - // 107 bytes of a gzipped FileDescriptorProto +var fileDescriptor_response_7319a4323854ca68 = []byte{ + // 88 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2b, 0x4a, 0x2d, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, 0x06, 0x5c, 0x1c, 0x41, 0x50, 0x19, 0x21, 0x21, 0x2e, 0x96, 0xe4, 0xfc, 0x94, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xd6, 0x20, 0x30, 0x5b, 0x48, 0x80, 0x8b, 0x39, 0xb7, 0x38, 0x5d, 0x82, 0x49, - 0x81, 0x51, 0x83, 0x33, 0x08, 0xc4, 0x74, 0x12, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, - 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x67, 0x3c, 0x96, 0x63, 0x48, 0x82, 0x98, 0x65, 0x0c, 0x08, 0x00, - 0x00, 0xff, 0xff, 0xcc, 0x61, 0xf0, 0x7d, 0x64, 0x00, 0x00, 0x00, + 0x81, 0x51, 0x83, 0x33, 0x08, 0xc4, 0x4c, 0x82, 0xe8, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, + 0x46, 0x18, 0xa3, 0x40, 0x52, 0x00, 0x00, 0x00, } diff --git a/examples/demo/worker/services/worker.go b/examples/demo/worker/services/worker.go index 219e3e5c..77331361 100644 --- a/examples/demo/worker/services/worker.go +++ b/examples/demo/worker/services/worker.go @@ -3,7 +3,7 @@ package services import ( "context" - "github.com/gogo/protobuf/proto" + "github.com/golang/protobuf/proto" "github.com/topfreegames/pitaya" "github.com/topfreegames/pitaya/component" "github.com/topfreegames/pitaya/examples/demo/worker/protos" diff --git a/examples/testing/protos/cluster.pb.go b/examples/testing/protos/cluster.pb.go index edc93511..47f95747 100644 --- a/examples/testing/protos/cluster.pb.go +++ b/examples/testing/protos/cluster.pb.go @@ -1,24 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: cluster.proto -/* - Package protos is a generated protocol buffer package. - - It is generated from these files: - cluster.proto - - It has these top-level messages: - TestRequest - TestResponse -*/ package protos -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -28,17 +16,39 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // TestRequest message to be sent using rpc type TestRequest struct { - Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` + Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TestRequest) Reset() { *m = TestRequest{} } +func (m *TestRequest) String() string { return proto.CompactTextString(m) } +func (*TestRequest) ProtoMessage() {} +func (*TestRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_cluster_8103f0c0bad3b7cd, []int{0} +} +func (m *TestRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TestRequest.Unmarshal(m, b) +} +func (m *TestRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TestRequest.Marshal(b, m, deterministic) +} +func (dst *TestRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestRequest.Merge(dst, src) +} +func (m *TestRequest) XXX_Size() int { + return xxx_messageInfo_TestRequest.Size(m) +} +func (m *TestRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TestRequest.DiscardUnknown(m) } -func (m *TestRequest) Reset() { *m = TestRequest{} } -func (m *TestRequest) String() string { return proto.CompactTextString(m) } -func (*TestRequest) ProtoMessage() {} -func (*TestRequest) Descriptor() ([]byte, []int) { return fileDescriptorCluster, []int{0} } +var xxx_messageInfo_TestRequest proto.InternalMessageInfo func (m *TestRequest) GetMsg() string { if m != nil { @@ -49,14 +59,36 @@ func (m *TestRequest) GetMsg() string { // TestResponse is the rpc response type TestResponse struct { - Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *TestResponse) Reset() { *m = TestResponse{} } -func (m *TestResponse) String() string { return proto.CompactTextString(m) } -func (*TestResponse) ProtoMessage() {} -func (*TestResponse) Descriptor() ([]byte, []int) { return fileDescriptorCluster, []int{1} } +func (m *TestResponse) Reset() { *m = TestResponse{} } +func (m *TestResponse) String() string { return proto.CompactTextString(m) } +func (*TestResponse) ProtoMessage() {} +func (*TestResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cluster_8103f0c0bad3b7cd, []int{1} +} +func (m *TestResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TestResponse.Unmarshal(m, b) +} +func (m *TestResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TestResponse.Marshal(b, m, deterministic) +} +func (dst *TestResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestResponse.Merge(dst, src) +} +func (m *TestResponse) XXX_Size() int { + return xxx_messageInfo_TestResponse.Size(m) +} +func (m *TestResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TestResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_TestResponse proto.InternalMessageInfo func (m *TestResponse) GetCode() int32 { if m != nil { @@ -76,396 +108,16 @@ func init() { proto.RegisterType((*TestRequest)(nil), "protos.TestRequest") proto.RegisterType((*TestResponse)(nil), "protos.TestResponse") } -func (m *TestRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Msg) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCluster(dAtA, i, uint64(len(m.Msg))) - i += copy(dAtA[i:], m.Msg) - } - return i, nil -} - -func (m *TestResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Code != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintCluster(dAtA, i, uint64(m.Code)) - } - if len(m.Msg) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintCluster(dAtA, i, uint64(len(m.Msg))) - i += copy(dAtA[i:], m.Msg) - } - return i, nil -} - -func encodeVarintCluster(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *TestRequest) Size() (n int) { - var l int - _ = l - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovCluster(uint64(l)) - } - return n -} - -func (m *TestResponse) Size() (n int) { - var l int - _ = l - if m.Code != 0 { - n += 1 + sovCluster(uint64(m.Code)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovCluster(uint64(l)) - } - return n -} - -func sovCluster(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozCluster(x uint64) (n int) { - return sovCluster(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *TestRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCluster - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCluster(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCluster - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Code |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCluster - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCluster - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCluster(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCluster - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipCluster(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCluster - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCluster - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCluster - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthCluster - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCluster - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipCluster(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthCluster = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCluster = fmt.Errorf("proto: integer overflow") -) -func init() { proto.RegisterFile("cluster.proto", fileDescriptorCluster) } +func init() { proto.RegisterFile("cluster.proto", fileDescriptor_cluster_8103f0c0bad3b7cd) } -var fileDescriptorCluster = []byte{ - // 128 bytes of a gzipped FileDescriptorProto +var fileDescriptor_cluster_8103f0c0bad3b7cd = []byte{ + // 109 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4d, 0xce, 0x29, 0x2d, 0x2e, 0x49, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, 0xf2, 0x5c, 0xdc, 0x21, 0xa9, 0xc5, 0x25, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x42, 0x02, 0x5c, 0xcc, 0xb9, 0xc5, 0xe9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x20, 0xa6, 0x92, 0x09, 0x17, 0x0f, 0x44, 0x41, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x90, 0x10, 0x17, 0x4b, 0x72, 0x7e, 0x4a, - 0x2a, 0x58, 0x09, 0x6b, 0x10, 0x98, 0x0d, 0xd3, 0xc5, 0x04, 0xd7, 0xe5, 0x24, 0x70, 0xe2, 0x91, - 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x90, 0x04, - 0xb1, 0xd0, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x19, 0x66, 0xe4, 0x88, 0x00, 0x00, 0x00, + 0x2a, 0x58, 0x09, 0x6b, 0x10, 0x98, 0x0d, 0xd3, 0xc5, 0x04, 0xd7, 0x95, 0x04, 0x31, 0xde, 0x18, + 0x10, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x1b, 0x30, 0x27, 0x76, 0x00, 0x00, 0x00, } diff --git a/protos/bind.pb.go b/protos/bind.pb.go index bd759458..f869f847 100644 --- a/protos/bind.pb.go +++ b/protos/bind.pb.go @@ -1,14 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: bind.proto package protos -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -18,39 +16,33 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type BindMsg struct { - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - Fid string `protobuf:"bytes,2,opt,name=fid,proto3" json:"fid,omitempty"` + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` + Fid string `protobuf:"bytes,2,opt,name=fid,proto3" json:"fid,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *BindMsg) Reset() { *m = BindMsg{} } func (m *BindMsg) String() string { return proto.CompactTextString(m) } func (*BindMsg) ProtoMessage() {} func (*BindMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_bind_1b77025867925bef, []int{0} + return fileDescriptor_bind_cca2aa20c9145e3d, []int{0} } func (m *BindMsg) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_BindMsg.Unmarshal(m, b) } func (m *BindMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BindMsg.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_BindMsg.Marshal(b, m, deterministic) } func (dst *BindMsg) XXX_Merge(src proto.Message) { xxx_messageInfo_BindMsg.Merge(dst, src) } func (m *BindMsg) XXX_Size() int { - return m.Size() + return xxx_messageInfo_BindMsg.Size(m) } func (m *BindMsg) XXX_DiscardUnknown() { xxx_messageInfo_BindMsg.DiscardUnknown(m) @@ -75,297 +67,15 @@ func (m *BindMsg) GetFid() string { func init() { proto.RegisterType((*BindMsg)(nil), "protos.BindMsg") } -func (m *BindMsg) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BindMsg) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Uid) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintBind(dAtA, i, uint64(len(m.Uid))) - i += copy(dAtA[i:], m.Uid) - } - if len(m.Fid) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintBind(dAtA, i, uint64(len(m.Fid))) - i += copy(dAtA[i:], m.Fid) - } - return i, nil -} - -func encodeVarintBind(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *BindMsg) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Uid) - if l > 0 { - n += 1 + l + sovBind(uint64(l)) - } - l = len(m.Fid) - if l > 0 { - n += 1 + l + sovBind(uint64(l)) - } - return n -} - -func sovBind(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozBind(x uint64) (n int) { - return sovBind(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *BindMsg) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBind - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BindMsg: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BindMsg: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBind - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBind - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Uid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBind - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBind - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Fid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBind(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthBind - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipBind(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBind - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBind - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBind - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthBind - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBind - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipBind(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthBind = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowBind = fmt.Errorf("proto: integer overflow") -) -func init() { proto.RegisterFile("bind.proto", fileDescriptor_bind_1b77025867925bef) } +func init() { proto.RegisterFile("bind.proto", fileDescriptor_bind_cca2aa20c9145e3d) } -var fileDescriptor_bind_1b77025867925bef = []byte{ - // 111 bytes of a gzipped FileDescriptorProto +var fileDescriptor_bind_cca2aa20c9145e3d = []byte{ + // 83 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4a, 0xca, 0xcc, 0x4b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, 0xba, 0x5c, 0xec, 0x4e, 0x99, 0x79, 0x29, 0xbe, 0xc5, 0xe9, 0x42, 0x02, 0x5c, 0xcc, 0xa5, 0x99, 0x29, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x20, 0x26, 0x48, 0x24, 0x2d, 0x33, 0x45, 0x82, 0x09, 0x22, 0x92, 0x96, - 0x99, 0xe2, 0x24, 0x71, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, - 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x49, 0x10, 0x03, - 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x14, 0xc8, 0xb7, 0x65, 0x00, 0x00, 0x00, + 0x99, 0x92, 0x04, 0xd1, 0x66, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xce, 0x99, 0xf6, 0x32, 0x4b, + 0x00, 0x00, 0x00, } diff --git a/protos/doc.pb.go b/protos/doc.pb.go index e60adcb7..539cee5f 100644 --- a/protos/doc.pb.go +++ b/protos/doc.pb.go @@ -1,14 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: doc.proto package protos -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -18,38 +16,32 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type Doc struct { - Doc string `protobuf:"bytes,1,opt,name=doc,proto3" json:"doc,omitempty"` + Doc string `protobuf:"bytes,1,opt,name=doc,proto3" json:"doc,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Doc) Reset() { *m = Doc{} } func (m *Doc) String() string { return proto.CompactTextString(m) } func (*Doc) ProtoMessage() {} func (*Doc) Descriptor() ([]byte, []int) { - return fileDescriptor_doc_46e242faab339756, []int{0} + return fileDescriptor_doc_94b3504d2ce65147, []int{0} } func (m *Doc) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_Doc.Unmarshal(m, b) } func (m *Doc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Doc.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_Doc.Marshal(b, m, deterministic) } func (dst *Doc) XXX_Merge(src proto.Message) { xxx_messageInfo_Doc.Merge(dst, src) } func (m *Doc) XXX_Size() int { - return m.Size() + return xxx_messageInfo_Doc.Size(m) } func (m *Doc) XXX_DiscardUnknown() { xxx_messageInfo_Doc.DiscardUnknown(m) @@ -67,257 +59,14 @@ func (m *Doc) GetDoc() string { func init() { proto.RegisterType((*Doc)(nil), "protos.Doc") } -func (m *Doc) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Doc) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Doc) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintDoc(dAtA, i, uint64(len(m.Doc))) - i += copy(dAtA[i:], m.Doc) - } - return i, nil -} - -func encodeVarintDoc(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *Doc) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Doc) - if l > 0 { - n += 1 + l + sovDoc(uint64(l)) - } - return n -} - -func sovDoc(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozDoc(x uint64) (n int) { - return sovDoc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Doc) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDoc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Doc: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Doc: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Doc", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDoc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDoc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Doc = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDoc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthDoc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipDoc(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDoc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDoc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDoc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthDoc - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDoc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipDoc(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthDoc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDoc = fmt.Errorf("proto: integer overflow") -) -func init() { proto.RegisterFile("doc.proto", fileDescriptor_doc_46e242faab339756) } +func init() { proto.RegisterFile("doc.proto", fileDescriptor_doc_94b3504d2ce65147) } -var fileDescriptor_doc_46e242faab339756 = []byte{ - // 94 bytes of a gzipped FileDescriptorProto +var fileDescriptor_doc_94b3504d2ce65147 = []byte{ + // 66 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0xc9, 0x4f, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, 0xe2, 0x5c, 0xcc, 0x2e, 0xf9, 0xc9, 0x42, 0x02, 0x5c, 0xcc, 0x29, 0xf9, 0xc9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x20, - 0xa6, 0x93, 0xc4, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, - 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x24, 0x41, 0xb4, 0x1a, - 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x87, 0x87, 0xc3, 0x92, 0x4e, 0x00, 0x00, 0x00, + 0x66, 0x12, 0x44, 0x81, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x98, 0xdb, 0x15, 0x9b, 0x34, 0x00, + 0x00, 0x00, } diff --git a/protos/docmsg.pb.go b/protos/docmsg.pb.go index 95405b8c..a94413d7 100644 --- a/protos/docmsg.pb.go +++ b/protos/docmsg.pb.go @@ -1,14 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: docmsg.proto package protos -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -18,38 +16,32 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type DocMsg struct { - GetProtos bool `protobuf:"varint,1,opt,name=getProtos,proto3" json:"getProtos,omitempty"` + GetProtos bool `protobuf:"varint,1,opt,name=getProtos,proto3" json:"getProtos,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *DocMsg) Reset() { *m = DocMsg{} } func (m *DocMsg) String() string { return proto.CompactTextString(m) } func (*DocMsg) ProtoMessage() {} func (*DocMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_docmsg_e05ec12dae2e8317, []int{0} + return fileDescriptor_docmsg_07e3adea3d738f41, []int{0} } func (m *DocMsg) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_DocMsg.Unmarshal(m, b) } func (m *DocMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DocMsg.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_DocMsg.Marshal(b, m, deterministic) } func (dst *DocMsg) XXX_Merge(src proto.Message) { xxx_messageInfo_DocMsg.Merge(dst, src) } func (m *DocMsg) XXX_Size() int { - return m.Size() + return xxx_messageInfo_DocMsg.Size(m) } func (m *DocMsg) XXX_DiscardUnknown() { xxx_messageInfo_DocMsg.DiscardUnknown(m) @@ -67,252 +59,14 @@ func (m *DocMsg) GetGetProtos() bool { func init() { proto.RegisterType((*DocMsg)(nil), "protos.DocMsg") } -func (m *DocMsg) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DocMsg) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.GetProtos { - dAtA[i] = 0x8 - i++ - if m.GetProtos { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - return i, nil -} - -func encodeVarintDocmsg(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *DocMsg) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.GetProtos { - n += 2 - } - return n -} - -func sovDocmsg(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozDocmsg(x uint64) (n int) { - return sovDocmsg(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *DocMsg) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDocmsg - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DocMsg: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DocMsg: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GetProtos", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDocmsg - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.GetProtos = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipDocmsg(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthDocmsg - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipDocmsg(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDocmsg - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDocmsg - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDocmsg - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthDocmsg - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDocmsg - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipDocmsg(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthDocmsg = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDocmsg = fmt.Errorf("proto: integer overflow") -) -func init() { proto.RegisterFile("docmsg.proto", fileDescriptor_docmsg_e05ec12dae2e8317) } +func init() { proto.RegisterFile("docmsg.proto", fileDescriptor_docmsg_07e3adea3d738f41) } -var fileDescriptor_docmsg_e05ec12dae2e8317 = []byte{ - // 103 bytes of a gzipped FileDescriptorProto +var fileDescriptor_docmsg_07e3adea3d738f41 = []byte{ + // 75 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x49, 0xc9, 0x4f, 0xce, 0x2d, 0x4e, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, 0x6a, 0x5c, 0x6c, 0x2e, 0xf9, 0xc9, 0xbe, 0xc5, 0xe9, 0x42, 0x32, 0x5c, 0x9c, 0xe9, 0xa9, 0x25, 0x01, 0x60, - 0x61, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x8e, 0x20, 0x84, 0x80, 0x93, 0xc4, 0x89, 0x47, 0x72, 0x8c, - 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, - 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x24, 0x41, 0x4c, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xf3, - 0xe0, 0xc3, 0xc6, 0x60, 0x00, 0x00, 0x00, + 0x61, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x8e, 0x20, 0x84, 0x40, 0x12, 0x44, 0xbd, 0x31, 0x20, 0x00, + 0x00, 0xff, 0xff, 0x77, 0x5a, 0xd8, 0xbe, 0x46, 0x00, 0x00, 0x00, } diff --git a/protos/error.pb.go b/protos/error.pb.go index a9948391..100b66af 100644 --- a/protos/error.pb.go +++ b/protos/error.pb.go @@ -1,14 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: error.proto package protos -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -18,40 +16,34 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type Error struct { - Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` - Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` - Metadata map[string]string `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + Metadata map[string]string `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Error) Reset() { *m = Error{} } func (m *Error) String() string { return proto.CompactTextString(m) } func (*Error) ProtoMessage() {} func (*Error) Descriptor() ([]byte, []int) { - return fileDescriptor_error_01e55f08e82a2b7d, []int{0} + return fileDescriptor_error_28572e96028e6170, []int{0} } func (m *Error) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_Error.Unmarshal(m, b) } func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Error.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_Error.Marshal(b, m, deterministic) } func (dst *Error) XXX_Merge(src proto.Message) { xxx_messageInfo_Error.Merge(dst, src) } func (m *Error) XXX_Size() int { - return m.Size() + return xxx_messageInfo_Error.Size(m) } func (m *Error) XXX_DiscardUnknown() { xxx_messageInfo_Error.DiscardUnknown(m) @@ -84,435 +76,11 @@ func init() { proto.RegisterType((*Error)(nil), "protos.Error") proto.RegisterMapType((map[string]string)(nil), "protos.Error.MetadataEntry") } -func (m *Error) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Error) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Code) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintError(dAtA, i, uint64(len(m.Code))) - i += copy(dAtA[i:], m.Code) - } - if len(m.Msg) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintError(dAtA, i, uint64(len(m.Msg))) - i += copy(dAtA[i:], m.Msg) - } - if len(m.Metadata) > 0 { - for k, _ := range m.Metadata { - dAtA[i] = 0x1a - i++ - v := m.Metadata[k] - mapSize := 1 + len(k) + sovError(uint64(len(k))) + 1 + len(v) + sovError(uint64(len(v))) - i = encodeVarintError(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintError(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintError(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } - } - return i, nil -} - -func encodeVarintError(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *Error) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Code) - if l > 0 { - n += 1 + l + sovError(uint64(l)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovError(uint64(l)) - } - if len(m.Metadata) > 0 { - for k, v := range m.Metadata { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovError(uint64(len(k))) + 1 + len(v) + sovError(uint64(len(v))) - n += mapEntrySize + 1 + sovError(uint64(mapEntrySize)) - } - } - return n -} - -func sovError(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozError(x uint64) (n int) { - return sovError(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Error) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowError - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Error: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Error: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowError - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthError - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Code = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowError - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthError - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowError - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthError - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Metadata == nil { - m.Metadata = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowError - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowError - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthError - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowError - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthError - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipError(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthError - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Metadata[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipError(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthError - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipError(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowError - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowError - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowError - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthError - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowError - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipError(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthError = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowError = fmt.Errorf("proto: integer overflow") -) -func init() { proto.RegisterFile("error.proto", fileDescriptor_error_01e55f08e82a2b7d) } +func init() { proto.RegisterFile("error.proto", fileDescriptor_error_28572e96028e6170) } -var fileDescriptor_error_01e55f08e82a2b7d = []byte{ - // 181 bytes of a gzipped FileDescriptorProto +var fileDescriptor_error_28572e96028e6170 = []byte{ + // 153 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4e, 0x2d, 0x2a, 0xca, 0x2f, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, 0x8b, 0x19, 0xb9, 0x58, 0x5d, 0x41, 0xe2, 0x42, 0x42, 0x5c, 0x2c, 0xc9, 0xf9, 0x29, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, @@ -521,8 +89,6 @@ var fileDescriptor_error_01e55f08e82a2b7d = []byte{ 0x60, 0xd6, 0xe0, 0x36, 0x92, 0x86, 0x98, 0x58, 0xac, 0x07, 0x36, 0x46, 0xcf, 0x17, 0x2a, 0xeb, 0x9a, 0x57, 0x52, 0x54, 0x19, 0x04, 0x57, 0x2c, 0x65, 0xcd, 0xc5, 0x8b, 0x22, 0x05, 0x32, 0x3b, 0x3b, 0xb5, 0x12, 0x6a, 0x1d, 0x88, 0x29, 0x24, 0xc2, 0xc5, 0x5a, 0x96, 0x98, 0x53, 0x9a, 0x0a, - 0xb5, 0x0f, 0xc2, 0xb1, 0x62, 0xb2, 0x60, 0x74, 0x92, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, - 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, - 0x63, 0x39, 0x86, 0x24, 0x88, 0x3f, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x12, 0xe3, 0xd0, - 0xd3, 0xdd, 0x00, 0x00, 0x00, + 0xb5, 0x0f, 0xc2, 0xb1, 0x62, 0xb2, 0x60, 0x4c, 0x82, 0xb8, 0xd6, 0x18, 0x10, 0x00, 0x00, 0xff, + 0xff, 0xb9, 0xd5, 0x83, 0x89, 0xc3, 0x00, 0x00, 0x00, } diff --git a/protos/kick.pb.go b/protos/kick.pb.go index b5e30382..08990a8d 100644 --- a/protos/kick.pb.go +++ b/protos/kick.pb.go @@ -1,14 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: kick.proto package protos -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -18,38 +16,32 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type KickMsg struct { - UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *KickMsg) Reset() { *m = KickMsg{} } func (m *KickMsg) String() string { return proto.CompactTextString(m) } func (*KickMsg) ProtoMessage() {} func (*KickMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_kick_b2c303947e349fb0, []int{0} + return fileDescriptor_kick_25712f066fa1bd3c, []int{0} } func (m *KickMsg) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_KickMsg.Unmarshal(m, b) } func (m *KickMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_KickMsg.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_KickMsg.Marshal(b, m, deterministic) } func (dst *KickMsg) XXX_Merge(src proto.Message) { xxx_messageInfo_KickMsg.Merge(dst, src) } func (m *KickMsg) XXX_Size() int { - return m.Size() + return xxx_messageInfo_KickMsg.Size(m) } func (m *KickMsg) XXX_DiscardUnknown() { xxx_messageInfo_KickMsg.DiscardUnknown(m) @@ -65,35 +57,29 @@ func (m *KickMsg) GetUserId() string { } type KickAnswer struct { - Kicked bool `protobuf:"varint,1,opt,name=kicked,proto3" json:"kicked,omitempty"` + Kicked bool `protobuf:"varint,1,opt,name=kicked,proto3" json:"kicked,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *KickAnswer) Reset() { *m = KickAnswer{} } func (m *KickAnswer) String() string { return proto.CompactTextString(m) } func (*KickAnswer) ProtoMessage() {} func (*KickAnswer) Descriptor() ([]byte, []int) { - return fileDescriptor_kick_b2c303947e349fb0, []int{1} + return fileDescriptor_kick_25712f066fa1bd3c, []int{1} } func (m *KickAnswer) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_KickAnswer.Unmarshal(m, b) } func (m *KickAnswer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_KickAnswer.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_KickAnswer.Marshal(b, m, deterministic) } func (dst *KickAnswer) XXX_Merge(src proto.Message) { xxx_messageInfo_KickAnswer.Merge(dst, src) } func (m *KickAnswer) XXX_Size() int { - return m.Size() + return xxx_messageInfo_KickAnswer.Size(m) } func (m *KickAnswer) XXX_DiscardUnknown() { xxx_messageInfo_KickAnswer.DiscardUnknown(m) @@ -112,369 +98,16 @@ func init() { proto.RegisterType((*KickMsg)(nil), "protos.KickMsg") proto.RegisterType((*KickAnswer)(nil), "protos.KickAnswer") } -func (m *KickMsg) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *KickMsg) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.UserId) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintKick(dAtA, i, uint64(len(m.UserId))) - i += copy(dAtA[i:], m.UserId) - } - return i, nil -} - -func (m *KickAnswer) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *KickAnswer) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Kicked { - dAtA[i] = 0x8 - i++ - if m.Kicked { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - return i, nil -} - -func encodeVarintKick(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *KickMsg) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.UserId) - if l > 0 { - n += 1 + l + sovKick(uint64(l)) - } - return n -} - -func (m *KickAnswer) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Kicked { - n += 2 - } - return n -} - -func sovKick(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozKick(x uint64) (n int) { - return sovKick(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *KickMsg) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKick - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: KickMsg: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: KickMsg: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKick - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthKick - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.UserId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKick(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthKick - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *KickAnswer) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKick - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: KickAnswer: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: KickAnswer: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Kicked", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKick - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Kicked = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipKick(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthKick - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipKick(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowKick - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowKick - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowKick - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthKick - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowKick - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipKick(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthKick = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowKick = fmt.Errorf("proto: integer overflow") -) -func init() { proto.RegisterFile("kick.proto", fileDescriptor_kick_b2c303947e349fb0) } +func init() { proto.RegisterFile("kick.proto", fileDescriptor_kick_25712f066fa1bd3c) } -var fileDescriptor_kick_b2c303947e349fb0 = []byte{ - // 125 bytes of a gzipped FileDescriptorProto +var fileDescriptor_kick_25712f066fa1bd3c = []byte{ + // 97 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xca, 0xce, 0x4c, 0xce, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, 0x8a, 0x5c, 0xec, 0xde, 0x99, 0xc9, 0xd9, 0xbe, 0xc5, 0xe9, 0x42, 0x62, 0x5c, 0x6c, 0xa5, 0xc5, 0xa9, 0x45, 0x9e, 0x29, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x50, 0x9e, 0x92, 0x0a, 0x17, 0x17, 0x48, 0x89, 0x63, - 0x5e, 0x71, 0x79, 0x6a, 0x11, 0x48, 0x15, 0xc8, 0x98, 0x54, 0x88, 0x2a, 0x8e, 0x20, 0x28, 0xcf, - 0x49, 0xe2, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, - 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0x92, 0x20, 0x56, 0x19, 0x03, - 0x02, 0x00, 0x00, 0xff, 0xff, 0xb0, 0x9d, 0xb1, 0xa4, 0x7f, 0x00, 0x00, 0x00, + 0x5e, 0x71, 0x79, 0x6a, 0x11, 0x48, 0x15, 0xc8, 0x98, 0x54, 0x88, 0x2a, 0x8e, 0x20, 0x28, 0x2f, + 0x09, 0x62, 0xa0, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x57, 0xec, 0x62, 0xe2, 0x65, 0x00, 0x00, + 0x00, } diff --git a/protos/msg.pb.go b/protos/msg.pb.go index 3d46d10c..0f328f85 100644 --- a/protos/msg.pb.go +++ b/protos/msg.pb.go @@ -1,14 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: msg.proto package protos -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -18,7 +16,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type MsgType int32 @@ -46,43 +44,37 @@ func (x MsgType) String() string { return proto.EnumName(MsgType_name, int32(x)) } func (MsgType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_msg_0ff3186db9b1e335, []int{0} + return fileDescriptor_msg_c371bacb726ca576, []int{0} } type Msg struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Route string `protobuf:"bytes,2,opt,name=route,proto3" json:"route,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` - Reply string `protobuf:"bytes,4,opt,name=reply,proto3" json:"reply,omitempty"` - Type MsgType `protobuf:"varint,5,opt,name=type,proto3,enum=protos.MsgType" json:"type,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Route string `protobuf:"bytes,2,opt,name=route,proto3" json:"route,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Reply string `protobuf:"bytes,4,opt,name=reply,proto3" json:"reply,omitempty"` + Type MsgType `protobuf:"varint,5,opt,name=type,proto3,enum=protos.MsgType" json:"type,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Msg) Reset() { *m = Msg{} } func (m *Msg) String() string { return proto.CompactTextString(m) } func (*Msg) ProtoMessage() {} func (*Msg) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_0ff3186db9b1e335, []int{0} + return fileDescriptor_msg_c371bacb726ca576, []int{0} } func (m *Msg) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_Msg.Unmarshal(m, b) } func (m *Msg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Msg.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_Msg.Marshal(b, m, deterministic) } func (dst *Msg) XXX_Merge(src proto.Message) { xxx_messageInfo_Msg.Merge(dst, src) } func (m *Msg) XXX_Size() int { - return m.Size() + return xxx_messageInfo_Msg.Size(m) } func (m *Msg) XXX_DiscardUnknown() { xxx_messageInfo_Msg.DiscardUnknown(m) @@ -129,400 +121,22 @@ func init() { proto.RegisterType((*Msg)(nil), "protos.Msg") proto.RegisterEnum("protos.MsgType", MsgType_name, MsgType_value) } -func (m *Msg) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Msg) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Id != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintMsg(dAtA, i, uint64(m.Id)) - } - if len(m.Route) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintMsg(dAtA, i, uint64(len(m.Route))) - i += copy(dAtA[i:], m.Route) - } - if len(m.Data) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintMsg(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) - } - if len(m.Reply) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintMsg(dAtA, i, uint64(len(m.Reply))) - i += copy(dAtA[i:], m.Reply) - } - if m.Type != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintMsg(dAtA, i, uint64(m.Type)) - } - return i, nil -} - -func encodeVarintMsg(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *Msg) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovMsg(uint64(m.Id)) - } - l = len(m.Route) - if l > 0 { - n += 1 + l + sovMsg(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovMsg(uint64(l)) - } - l = len(m.Reply) - if l > 0 { - n += 1 + l + sovMsg(uint64(l)) - } - if m.Type != 0 { - n += 1 + sovMsg(uint64(m.Type)) - } - return n -} - -func sovMsg(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozMsg(x uint64) (n int) { - return sovMsg(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Msg) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMsg - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Msg: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Msg: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMsg - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Route", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMsg - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMsg - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Route = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMsg - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMsg - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reply", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMsg - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMsg - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Reply = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMsg - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= (MsgType(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipMsg(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMsg - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipMsg(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMsg - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMsg - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMsg - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthMsg - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMsg - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipMsg(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthMsg = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMsg = fmt.Errorf("proto: integer overflow") -) - -func init() { proto.RegisterFile("msg.proto", fileDescriptor_msg_0ff3186db9b1e335) } -var fileDescriptor_msg_0ff3186db9b1e335 = []byte{ - // 229 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x2c, 0x8f, 0xb1, 0x4e, 0xc4, 0x30, - 0x0c, 0x86, 0xeb, 0xb6, 0x07, 0xaa, 0x0f, 0x7a, 0x95, 0xc5, 0x90, 0x29, 0xaa, 0x60, 0xa9, 0x18, - 0x6e, 0x80, 0x37, 0x60, 0x60, 0x2b, 0x42, 0x11, 0x2f, 0x70, 0xa8, 0x21, 0x54, 0x02, 0x12, 0xce, - 0xe9, 0x10, 0x9e, 0x82, 0xc7, 0x62, 0xbc, 0x91, 0x11, 0xb5, 0x2f, 0x82, 0x2e, 0xed, 0x64, 0xff, - 0xfe, 0x3e, 0xcb, 0x32, 0x16, 0xef, 0x6c, 0xb6, 0x6e, 0x6f, 0xbd, 0xa5, 0x93, 0x58, 0xf8, 0xf2, - 0x0b, 0xb3, 0x96, 0x0d, 0x95, 0x98, 0xf6, 0x9d, 0x80, 0x1a, 0x9a, 0x5c, 0xa5, 0x7d, 0x47, 0x17, - 0xb8, 0xda, 0xdb, 0xc1, 0x6b, 0x91, 0xd6, 0xd0, 0x14, 0x6a, 0x0e, 0x44, 0x98, 0x77, 0x3b, 0xbf, - 0x13, 0x59, 0x0d, 0xcd, 0x99, 0x8a, 0x7d, 0x34, 0xb5, 0x7b, 0x0b, 0x22, 0x5f, 0xcc, 0x63, 0xa0, - 0x2b, 0xcc, 0x7d, 0x70, 0x5a, 0xac, 0x6a, 0x68, 0xca, 0x9b, 0xcd, 0x7c, 0x94, 0xb7, 0x2d, 0x9b, - 0xa7, 0xe0, 0xb4, 0x8a, 0xf0, 0xfa, 0x1e, 0x4f, 0x97, 0x01, 0x95, 0x88, 0x2d, 0x1b, 0xa5, 0x3f, - 0x07, 0xcd, 0xbe, 0x4a, 0xe8, 0x1c, 0x8b, 0x96, 0xcd, 0x83, 0xf5, 0xfd, 0x4b, 0xa8, 0x80, 0x36, - 0xb8, 0x8e, 0x98, 0x9d, 0xfd, 0x60, 0x5d, 0xa5, 0xb4, 0x8e, 0xab, 0x8f, 0x03, 0xbf, 0x56, 0xd9, - 0x9d, 0xf8, 0x19, 0x25, 0x1c, 0x46, 0x09, 0x7f, 0xa3, 0x84, 0xef, 0x49, 0x26, 0x87, 0x49, 0x26, - 0xbf, 0x93, 0x4c, 0x9e, 0xe7, 0x2f, 0x6f, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x80, 0x5a, 0xf8, - 0xdc, 0xf9, 0x00, 0x00, 0x00, +func init() { proto.RegisterFile("msg.proto", fileDescriptor_msg_c371bacb726ca576) } + +var fileDescriptor_msg_c371bacb726ca576 = []byte{ + // 196 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x2c, 0x8f, 0xc1, 0x4e, 0xc6, 0x20, + 0x0c, 0xc7, 0x85, 0xf1, 0x69, 0xd6, 0xe9, 0x46, 0x1a, 0x0f, 0x1c, 0x89, 0x5e, 0x88, 0x87, 0x1d, + 0xf4, 0x1d, 0xbc, 0x61, 0x0c, 0xf1, 0x05, 0x66, 0x86, 0xb8, 0x44, 0x05, 0x57, 0x76, 0xc0, 0xa7, + 0x37, 0x1f, 0xdb, 0xa9, 0xfd, 0xf7, 0xf7, 0x6b, 0x9a, 0x42, 0xfb, 0x4d, 0x61, 0x4c, 0x6b, 0xcc, + 0x11, 0x2f, 0x6b, 0xa1, 0xbb, 0x3f, 0x68, 0x2c, 0x05, 0xec, 0x81, 0x2f, 0xb3, 0x62, 0x9a, 0x19, + 0xe1, 0xf8, 0x32, 0xe3, 0x2d, 0x9c, 0xd6, 0xb8, 0x65, 0xaf, 0xb8, 0x66, 0xa6, 0x75, 0x7b, 0x40, + 0x04, 0x31, 0x4f, 0x79, 0x52, 0x8d, 0x66, 0xe6, 0xda, 0xd5, 0xbe, 0x9a, 0x3e, 0x7d, 0x15, 0x25, + 0x0e, 0xf3, 0x1c, 0xf0, 0x1e, 0x44, 0x2e, 0xc9, 0xab, 0x93, 0x66, 0xa6, 0x7f, 0x1c, 0xf6, 0xa3, + 0x34, 0x5a, 0x0a, 0x6f, 0x25, 0x79, 0x57, 0xe1, 0xc3, 0x33, 0x5c, 0x1d, 0x03, 0xec, 0x01, 0x2c, + 0x05, 0xe7, 0x7f, 0x37, 0x4f, 0x59, 0x5e, 0xe0, 0x0d, 0xb4, 0x96, 0xc2, 0x4b, 0xcc, 0xcb, 0x47, + 0x91, 0x0c, 0x07, 0xe8, 0x2a, 0xa6, 0x14, 0x7f, 0xc8, 0x4b, 0x8e, 0x5d, 0x5d, 0x7d, 0xdd, 0xe8, + 0x53, 0x36, 0xef, 0xfb, 0x2f, 0x4f, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8b, 0x95, 0xef, 0x13, + 0xdf, 0x00, 0x00, 0x00, } diff --git a/protos/pitaya.pb.go b/protos/pitaya.pb.go index 3e43a15c..c32e7da1 100644 --- a/protos/pitaya.pb.go +++ b/protos/pitaya.pb.go @@ -1,9 +1,9 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: pitaya.proto package protos -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" @@ -21,7 +21,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // Reference imports to suppress errors if they are not otherwise used. var _ context.Context @@ -194,10 +194,10 @@ var _Pitaya_serviceDesc = grpc.ServiceDesc{ Metadata: "pitaya.proto", } -func init() { proto.RegisterFile("pitaya.proto", fileDescriptor_pitaya_dbaa8f084d6a9b14) } +func init() { proto.RegisterFile("pitaya.proto", fileDescriptor_pitaya_0d90976760f86aa2) } -var fileDescriptor_pitaya_dbaa8f084d6a9b14 = []byte{ - // 226 bytes of a gzipped FileDescriptorProto +var fileDescriptor_pitaya_0d90976760f86aa2 = []byte{ + // 199 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0xc8, 0x2c, 0x49, 0xac, 0x4c, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x52, 0xbc, 0x45, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x10, 0x61, 0x29, 0xbe, 0xa2, 0xd4, 0xe2, 0x82, 0xfc, 0xbc, @@ -209,8 +209,6 @@ var fileDescriptor_pitaya_dbaa8f084d6a9b14 = []byte{ 0x06, 0xa7, 0x16, 0x17, 0x67, 0xe6, 0xe7, 0x39, 0x65, 0xe6, 0xa5, 0x04, 0xa5, 0xe6, 0xe6, 0x97, 0xa4, 0x22, 0x6c, 0x02, 0x89, 0xf9, 0x16, 0xa7, 0x63, 0xd5, 0x69, 0xc8, 0xc5, 0xe1, 0x9d, 0x99, 0x9c, 0x0d, 0xb6, 0x07, 0xae, 0x01, 0x24, 0x02, 0xd2, 0x20, 0x84, 0x2c, 0xe0, 0x98, 0x57, 0x5c, - 0x9e, 0x5a, 0xa4, 0xc4, 0xe0, 0x24, 0x71, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, - 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, - 0x49, 0x90, 0x90, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x86, 0x19, 0xc9, 0x86, 0x50, 0x01, - 0x00, 0x00, + 0x9e, 0x5a, 0xa4, 0xc4, 0x90, 0x04, 0x09, 0x1f, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x70, + 0x0c, 0x65, 0x3c, 0x36, 0x01, 0x00, 0x00, } diff --git a/protos/protodescriptor.pb.go b/protos/protodescriptor.pb.go index 64ef3d8c..483ca0f7 100644 --- a/protos/protodescriptor.pb.go +++ b/protos/protodescriptor.pb.go @@ -1,14 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: protodescriptor.proto package protos -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -18,39 +16,33 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // Descriptor proto used to retrieve zipped proto descriptors remotely type ProtoDescriptor struct { - Desc []byte `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"` + Desc []byte `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ProtoDescriptor) Reset() { *m = ProtoDescriptor{} } func (m *ProtoDescriptor) String() string { return proto.CompactTextString(m) } func (*ProtoDescriptor) ProtoMessage() {} func (*ProtoDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_protodescriptor_6b37d76a3399b8af, []int{0} + return fileDescriptor_protodescriptor_e04f446d4ffce499, []int{0} } func (m *ProtoDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_ProtoDescriptor.Unmarshal(m, b) } func (m *ProtoDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProtoDescriptor.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_ProtoDescriptor.Marshal(b, m, deterministic) } func (dst *ProtoDescriptor) XXX_Merge(src proto.Message) { xxx_messageInfo_ProtoDescriptor.Merge(dst, src) } func (m *ProtoDescriptor) XXX_Size() int { - return m.Size() + return xxx_messageInfo_ProtoDescriptor.Size(m) } func (m *ProtoDescriptor) XXX_DiscardUnknown() { xxx_messageInfo_ProtoDescriptor.DiscardUnknown(m) @@ -66,35 +58,29 @@ func (m *ProtoDescriptor) GetDesc() []byte { } type ProtoName struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ProtoName) Reset() { *m = ProtoName{} } func (m *ProtoName) String() string { return proto.CompactTextString(m) } func (*ProtoName) ProtoMessage() {} func (*ProtoName) Descriptor() ([]byte, []int) { - return fileDescriptor_protodescriptor_6b37d76a3399b8af, []int{1} + return fileDescriptor_protodescriptor_e04f446d4ffce499, []int{1} } func (m *ProtoName) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_ProtoName.Unmarshal(m, b) } func (m *ProtoName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProtoName.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_ProtoName.Marshal(b, m, deterministic) } func (dst *ProtoName) XXX_Merge(src proto.Message) { xxx_messageInfo_ProtoName.Merge(dst, src) } func (m *ProtoName) XXX_Size() int { - return m.Size() + return xxx_messageInfo_ProtoName.Size(m) } func (m *ProtoName) XXX_DiscardUnknown() { xxx_messageInfo_ProtoName.DiscardUnknown(m) @@ -110,35 +96,29 @@ func (m *ProtoName) GetName() string { } type ProtoDescriptors struct { - Desc [][]byte `protobuf:"bytes,1,rep,name=desc,proto3" json:"desc,omitempty"` + Desc [][]byte `protobuf:"bytes,1,rep,name=desc,proto3" json:"desc,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ProtoDescriptors) Reset() { *m = ProtoDescriptors{} } func (m *ProtoDescriptors) String() string { return proto.CompactTextString(m) } func (*ProtoDescriptors) ProtoMessage() {} func (*ProtoDescriptors) Descriptor() ([]byte, []int) { - return fileDescriptor_protodescriptor_6b37d76a3399b8af, []int{2} + return fileDescriptor_protodescriptor_e04f446d4ffce499, []int{2} } func (m *ProtoDescriptors) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_ProtoDescriptors.Unmarshal(m, b) } func (m *ProtoDescriptors) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProtoDescriptors.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_ProtoDescriptors.Marshal(b, m, deterministic) } func (dst *ProtoDescriptors) XXX_Merge(src proto.Message) { xxx_messageInfo_ProtoDescriptors.Merge(dst, src) } func (m *ProtoDescriptors) XXX_Size() int { - return m.Size() + return xxx_messageInfo_ProtoDescriptors.Size(m) } func (m *ProtoDescriptors) XXX_DiscardUnknown() { xxx_messageInfo_ProtoDescriptors.DiscardUnknown(m) @@ -154,35 +134,29 @@ func (m *ProtoDescriptors) GetDesc() [][]byte { } type ProtoNames struct { - Name []string `protobuf:"bytes,1,rep,name=name,proto3" json:"name,omitempty"` + Name []string `protobuf:"bytes,1,rep,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ProtoNames) Reset() { *m = ProtoNames{} } func (m *ProtoNames) String() string { return proto.CompactTextString(m) } func (*ProtoNames) ProtoMessage() {} func (*ProtoNames) Descriptor() ([]byte, []int) { - return fileDescriptor_protodescriptor_6b37d76a3399b8af, []int{3} + return fileDescriptor_protodescriptor_e04f446d4ffce499, []int{3} } func (m *ProtoNames) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_ProtoNames.Unmarshal(m, b) } func (m *ProtoNames) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProtoNames.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_ProtoNames.Marshal(b, m, deterministic) } func (dst *ProtoNames) XXX_Merge(src proto.Message) { xxx_messageInfo_ProtoNames.Merge(dst, src) } func (m *ProtoNames) XXX_Size() int { - return m.Size() + return xxx_messageInfo_ProtoNames.Size(m) } func (m *ProtoNames) XXX_DiscardUnknown() { xxx_messageInfo_ProtoNames.DiscardUnknown(m) @@ -203,628 +177,19 @@ func init() { proto.RegisterType((*ProtoDescriptors)(nil), "protos.ProtoDescriptors") proto.RegisterType((*ProtoNames)(nil), "protos.ProtoNames") } -func (m *ProtoDescriptor) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProtoDescriptor) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Desc) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintProtodescriptor(dAtA, i, uint64(len(m.Desc))) - i += copy(dAtA[i:], m.Desc) - } - return i, nil -} - -func (m *ProtoName) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProtoName) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintProtodescriptor(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - return i, nil -} - -func (m *ProtoDescriptors) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProtoDescriptors) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Desc) > 0 { - for _, b := range m.Desc { - dAtA[i] = 0xa - i++ - i = encodeVarintProtodescriptor(dAtA, i, uint64(len(b))) - i += copy(dAtA[i:], b) - } - } - return i, nil -} - -func (m *ProtoNames) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProtoNames) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Name) > 0 { - for _, s := range m.Name { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - return i, nil -} - -func encodeVarintProtodescriptor(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *ProtoDescriptor) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Desc) - if l > 0 { - n += 1 + l + sovProtodescriptor(uint64(l)) - } - return n -} - -func (m *ProtoName) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProtodescriptor(uint64(l)) - } - return n -} - -func (m *ProtoDescriptors) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Desc) > 0 { - for _, b := range m.Desc { - l = len(b) - n += 1 + l + sovProtodescriptor(uint64(l)) - } - } - return n -} - -func (m *ProtoNames) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Name) > 0 { - for _, s := range m.Name { - l = len(s) - n += 1 + l + sovProtodescriptor(uint64(l)) - } - } - return n -} - -func sovProtodescriptor(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozProtodescriptor(x uint64) (n int) { - return sovProtodescriptor(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ProtoDescriptor) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtodescriptor - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProtoDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProtoDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Desc", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtodescriptor - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProtodescriptor - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Desc = append(m.Desc[:0], dAtA[iNdEx:postIndex]...) - if m.Desc == nil { - m.Desc = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProtodescriptor(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtodescriptor - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProtoName) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtodescriptor - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProtoName: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProtoName: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtodescriptor - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProtodescriptor - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProtodescriptor(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtodescriptor - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProtoDescriptors) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtodescriptor - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProtoDescriptors: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProtoDescriptors: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Desc", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtodescriptor - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProtodescriptor - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Desc = append(m.Desc, make([]byte, postIndex-iNdEx)) - copy(m.Desc[len(m.Desc)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProtodescriptor(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtodescriptor - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProtoNames) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtodescriptor - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProtoNames: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProtoNames: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtodescriptor - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProtodescriptor - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = append(m.Name, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProtodescriptor(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtodescriptor - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProtodescriptor(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProtodescriptor - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProtodescriptor - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProtodescriptor - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthProtodescriptor - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProtodescriptor - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipProtodescriptor(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthProtodescriptor = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProtodescriptor = fmt.Errorf("proto: integer overflow") -) func init() { - proto.RegisterFile("protodescriptor.proto", fileDescriptor_protodescriptor_6b37d76a3399b8af) + proto.RegisterFile("protodescriptor.proto", fileDescriptor_protodescriptor_e04f446d4ffce499) } -var fileDescriptor_protodescriptor_6b37d76a3399b8af = []byte{ - // 151 bytes of a gzipped FileDescriptorProto +var fileDescriptor_protodescriptor_e04f446d4ffce499 = []byte{ + // 123 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2d, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x49, 0x2d, 0x4e, 0x2e, 0xca, 0x2c, 0x28, 0xc9, 0x2f, 0xd2, 0x03, 0xf3, 0x85, 0xd8, 0xc0, 0x54, 0xb1, 0x92, 0x2a, 0x17, 0x7f, 0x00, 0x88, 0xe5, 0x02, 0x57, 0x20, 0x24, 0xc4, 0xc5, 0x02, 0x52, 0x2e, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x13, 0x04, 0x66, 0x2b, 0xc9, 0x73, 0x71, 0x82, 0x95, 0xf9, 0x25, 0xe6, 0xa6, 0x82, 0x14, 0xe4, 0x25, 0xe6, 0xa6, 0x82, 0x15, 0x70, 0x06, 0x81, 0xd9, 0x4a, 0x6a, 0x5c, 0x02, 0x68, 0xe6, 0x14, 0x23, 0x19, 0xc4, 0x0c, 0x37, 0x48, 0x81, 0x8b, - 0x0b, 0x6e, 0x50, 0x31, 0x92, 0x49, 0xcc, 0x30, 0x93, 0x9c, 0x24, 0x4e, 0x3c, 0x92, 0x63, 0xbc, - 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, - 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x09, 0xe2, 0x66, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x13, - 0xe2, 0xef, 0x79, 0xd3, 0x00, 0x00, 0x00, + 0x0b, 0x6e, 0x50, 0x31, 0x92, 0x49, 0xcc, 0x30, 0x93, 0x92, 0x20, 0x2e, 0x33, 0x06, 0x04, 0x00, + 0x00, 0xff, 0xff, 0x91, 0xb4, 0x22, 0x97, 0xb9, 0x00, 0x00, 0x00, } diff --git a/protos/push.pb.go b/protos/push.pb.go index 13e56dd9..d8f2476d 100644 --- a/protos/push.pb.go +++ b/protos/push.pb.go @@ -1,14 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: push.proto package protos -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -18,40 +16,34 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type Push struct { - Route string `protobuf:"bytes,1,opt,name=route,proto3" json:"route,omitempty"` - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Route string `protobuf:"bytes,1,opt,name=route,proto3" json:"route,omitempty"` + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Push) Reset() { *m = Push{} } func (m *Push) String() string { return proto.CompactTextString(m) } func (*Push) ProtoMessage() {} func (*Push) Descriptor() ([]byte, []int) { - return fileDescriptor_push_c448ab47f0a4e79b, []int{0} + return fileDescriptor_push_b01900fa6aef5157, []int{0} } func (m *Push) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_Push.Unmarshal(m, b) } func (m *Push) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Push.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_Push.Marshal(b, m, deterministic) } func (dst *Push) XXX_Merge(src proto.Message) { xxx_messageInfo_Push.Merge(dst, src) } func (m *Push) XXX_Size() int { - return m.Size() + return xxx_messageInfo_Push.Size(m) } func (m *Push) XXX_DiscardUnknown() { xxx_messageInfo_Push.DiscardUnknown(m) @@ -83,339 +75,16 @@ func (m *Push) GetData() []byte { func init() { proto.RegisterType((*Push)(nil), "protos.Push") } -func (m *Push) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Push) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Route) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintPush(dAtA, i, uint64(len(m.Route))) - i += copy(dAtA[i:], m.Route) - } - if len(m.Uid) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintPush(dAtA, i, uint64(len(m.Uid))) - i += copy(dAtA[i:], m.Uid) - } - if len(m.Data) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintPush(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) - } - return i, nil -} - -func encodeVarintPush(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *Push) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Route) - if l > 0 { - n += 1 + l + sovPush(uint64(l)) - } - l = len(m.Uid) - if l > 0 { - n += 1 + l + sovPush(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovPush(uint64(l)) - } - return n -} - -func sovPush(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozPush(x uint64) (n int) { - return sovPush(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Push) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Push: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Push: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Route", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPush - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Route = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPush - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Uid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthPush - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPush(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthPush - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipPush(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPush - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPush - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPush - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthPush - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPush - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipPush(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthPush = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPush = fmt.Errorf("proto: integer overflow") -) -func init() { proto.RegisterFile("push.proto", fileDescriptor_push_c448ab47f0a4e79b) } +func init() { proto.RegisterFile("push.proto", fileDescriptor_push_b01900fa6aef5157) } -var fileDescriptor_push_c448ab47f0a4e79b = []byte{ - // 127 bytes of a gzipped FileDescriptorProto +var fileDescriptor_push_b01900fa6aef5157 = []byte{ + // 100 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0x28, 0x2d, 0xce, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, 0x4e, 0x5c, 0x2c, 0x01, 0xa5, 0xc5, 0x19, 0x42, 0x22, 0x5c, 0xac, 0x45, 0xf9, 0xa5, 0x25, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x10, 0x8e, 0x90, 0x00, 0x17, 0x73, 0x69, 0x66, 0x8a, 0x04, 0x13, 0x58, 0x0c, 0xc4, 0x14, 0x12, 0xe2, 0x62, 0x49, 0x49, 0x2c, 0x49, 0x94, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x09, - 0x02, 0xb3, 0x9d, 0x24, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, - 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x09, 0x62, - 0x8b, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xff, 0xc3, 0x93, 0xff, 0x7a, 0x00, 0x00, 0x00, + 0x02, 0xb3, 0x93, 0x20, 0x66, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x41, 0x79, 0x42, 0xe3, + 0x60, 0x00, 0x00, 0x00, } diff --git a/protos/request.pb.go b/protos/request.pb.go index 015dd990..8ff8a2ad 100644 --- a/protos/request.pb.go +++ b/protos/request.pb.go @@ -1,14 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: request.proto package protos -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -18,7 +16,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type RPCType int32 @@ -40,43 +38,37 @@ func (x RPCType) String() string { return proto.EnumName(RPCType_name, int32(x)) } func (RPCType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_request_7ef2a48bbcc1e903, []int{0} + return fileDescriptor_request_d729efd81f1bdb1c, []int{0} } type Request struct { - Type RPCType `protobuf:"varint,1,opt,name=type,proto3,enum=protos.RPCType" json:"type,omitempty"` - Session *Session `protobuf:"bytes,2,opt,name=session,proto3" json:"session,omitempty"` - Msg *Msg `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"` - FrontendID string `protobuf:"bytes,4,opt,name=frontendID,proto3" json:"frontendID,omitempty"` - Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` + Type RPCType `protobuf:"varint,1,opt,name=type,proto3,enum=protos.RPCType" json:"type,omitempty"` + Session *Session `protobuf:"bytes,2,opt,name=session,proto3" json:"session,omitempty"` + Msg *Msg `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"` + FrontendID string `protobuf:"bytes,4,opt,name=frontendID,proto3" json:"frontendID,omitempty"` + Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Request) Reset() { *m = Request{} } func (m *Request) String() string { return proto.CompactTextString(m) } func (*Request) ProtoMessage() {} func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_request_7ef2a48bbcc1e903, []int{0} + return fileDescriptor_request_d729efd81f1bdb1c, []int{0} } func (m *Request) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_Request.Unmarshal(m, b) } func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Request.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_Request.Marshal(b, m, deterministic) } func (dst *Request) XXX_Merge(src proto.Message) { xxx_messageInfo_Request.Merge(dst, src) } func (m *Request) XXX_Size() int { - return m.Size() + return xxx_messageInfo_Request.Size(m) } func (m *Request) XXX_DiscardUnknown() { xxx_messageInfo_Request.DiscardUnknown(m) @@ -123,428 +115,23 @@ func init() { proto.RegisterType((*Request)(nil), "protos.Request") proto.RegisterEnum("protos.RPCType", RPCType_name, RPCType_value) } -func (m *Request) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Request) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Type != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRequest(dAtA, i, uint64(m.Type)) - } - if m.Session != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRequest(dAtA, i, uint64(m.Session.Size())) - n1, err := m.Session.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - } - if m.Msg != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintRequest(dAtA, i, uint64(m.Msg.Size())) - n2, err := m.Msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - } - if len(m.FrontendID) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintRequest(dAtA, i, uint64(len(m.FrontendID))) - i += copy(dAtA[i:], m.FrontendID) - } - if len(m.Metadata) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintRequest(dAtA, i, uint64(len(m.Metadata))) - i += copy(dAtA[i:], m.Metadata) - } - return i, nil -} - -func encodeVarintRequest(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *Request) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovRequest(uint64(m.Type)) - } - if m.Session != nil { - l = m.Session.Size() - n += 1 + l + sovRequest(uint64(l)) - } - if m.Msg != nil { - l = m.Msg.Size() - n += 1 + l + sovRequest(uint64(l)) - } - l = len(m.FrontendID) - if l > 0 { - n += 1 + l + sovRequest(uint64(l)) - } - l = len(m.Metadata) - if l > 0 { - n += 1 + l + sovRequest(uint64(l)) - } - return n -} - -func sovRequest(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozRequest(x uint64) (n int) { - return sovRequest(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Request) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRequest - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Request: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Request: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRequest - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= (RPCType(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Session", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRequest - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRequest - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Session == nil { - m.Session = &Session{} - } - if err := m.Session.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRequest - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRequest - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Msg == nil { - m.Msg = &Msg{} - } - if err := m.Msg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrontendID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRequest - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRequest - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FrontendID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRequest - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRequest - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRequest(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRequest - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRequest(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRequest - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRequest - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRequest - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthRequest - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRequest - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipRequest(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthRequest = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRequest = fmt.Errorf("proto: integer overflow") -) - -func init() { proto.RegisterFile("request.proto", fileDescriptor_request_7ef2a48bbcc1e903) } -var fileDescriptor_request_7ef2a48bbcc1e903 = []byte{ - // 240 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2d, 0x4a, 0x2d, 0x2c, - 0x4d, 0x2d, 0x2e, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x52, 0xbc, - 0xc5, 0xa9, 0xc5, 0xc5, 0x99, 0xf9, 0x79, 0x10, 0x61, 0x29, 0xce, 0xdc, 0xe2, 0x74, 0x08, 0x53, - 0x69, 0x0b, 0x23, 0x17, 0x7b, 0x10, 0x44, 0x8f, 0x90, 0x32, 0x17, 0x4b, 0x49, 0x65, 0x41, 0xaa, - 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x9f, 0x11, 0x3f, 0x44, 0x45, 0xb1, 0x5e, 0x50, 0x80, 0x73, 0x48, - 0x65, 0x41, 0x6a, 0x10, 0x58, 0x52, 0x48, 0x93, 0x8b, 0x1d, 0x6a, 0x98, 0x04, 0x93, 0x02, 0xa3, - 0x06, 0x37, 0x42, 0x5d, 0x30, 0x44, 0x38, 0x08, 0x26, 0x2f, 0x24, 0xcb, 0xc5, 0x9c, 0x5b, 0x9c, - 0x2e, 0xc1, 0x0c, 0x56, 0xc6, 0x0d, 0x53, 0xe6, 0x5b, 0x9c, 0x1e, 0x04, 0x12, 0x17, 0x92, 0xe3, - 0xe2, 0x4a, 0x2b, 0xca, 0xcf, 0x2b, 0x49, 0xcd, 0x4b, 0xf1, 0x74, 0x91, 0x60, 0x51, 0x60, 0xd4, - 0xe0, 0x0c, 0x42, 0x12, 0x11, 0x92, 0xe2, 0xe2, 0xc8, 0x4d, 0x2d, 0x49, 0x4c, 0x49, 0x2c, 0x49, - 0x94, 0x60, 0x55, 0x60, 0xd4, 0xe0, 0x09, 0x82, 0xf3, 0xb5, 0x64, 0xb8, 0xd8, 0xa1, 0xce, 0x12, - 0x62, 0xe7, 0x62, 0x0e, 0xae, 0x2c, 0x16, 0x60, 0x10, 0xe2, 0xe0, 0x62, 0x09, 0x2d, 0x4e, 0x2d, - 0x12, 0x60, 0x74, 0x92, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, - 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x24, 0x48, - 0x80, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x42, 0x21, 0x7e, 0xb7, 0x28, 0x01, 0x00, 0x00, +func init() { proto.RegisterFile("request.proto", fileDescriptor_request_d729efd81f1bdb1c) } + +var fileDescriptor_request_d729efd81f1bdb1c = []byte{ + // 210 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x8f, 0xb1, 0x4e, 0x87, 0x30, + 0x10, 0x87, 0xad, 0xa0, 0xfd, 0x73, 0x88, 0x92, 0x9b, 0x1a, 0xa2, 0xa6, 0xd1, 0xa5, 0x3a, 0x30, + 0xe8, 0x23, 0xe8, 0xe2, 0x60, 0x62, 0x8a, 0x3e, 0x00, 0x86, 0x93, 0x38, 0x40, 0xb1, 0x57, 0x07, + 0xde, 0xcb, 0x07, 0x34, 0x52, 0x50, 0xa7, 0xf6, 0xbe, 0xdf, 0x77, 0x97, 0x3b, 0x28, 0x3c, 0x7d, + 0x7c, 0x12, 0x87, 0x7a, 0xf2, 0x2e, 0x38, 0x3c, 0x5c, 0x1e, 0xae, 0x0a, 0x26, 0xe6, 0x77, 0x37, + 0x46, 0x5c, 0x65, 0x03, 0xf7, 0xf1, 0x7b, 0xf1, 0x25, 0x40, 0xda, 0xd8, 0x83, 0x97, 0x90, 0x86, + 0x79, 0x22, 0x25, 0xb4, 0x30, 0xc7, 0x37, 0x27, 0xd1, 0xe0, 0xda, 0x3e, 0xdd, 0x3d, 0xcf, 0x13, + 0xd9, 0x25, 0xc4, 0x2b, 0x90, 0xeb, 0x30, 0xb5, 0xaf, 0x85, 0xc9, 0xff, 0xbc, 0x26, 0x62, 0xbb, + 0xe5, 0x78, 0x06, 0xc9, 0xc0, 0xbd, 0x4a, 0x16, 0x2d, 0xdf, 0xb4, 0x47, 0xee, 0xed, 0x0f, 0xc7, + 0x73, 0x80, 0x37, 0xef, 0xc6, 0x40, 0x63, 0xf7, 0x70, 0xaf, 0x52, 0x2d, 0x4c, 0x66, 0xff, 0x11, + 0xac, 0x60, 0x37, 0x50, 0x68, 0xbb, 0x36, 0xb4, 0xea, 0x40, 0x0b, 0x73, 0x64, 0x7f, 0xeb, 0xeb, + 0x53, 0x90, 0xeb, 0x5a, 0x28, 0x21, 0x69, 0x66, 0x2e, 0xf7, 0x70, 0x07, 0xe9, 0x0b, 0x93, 0x2f, + 0xc5, 0x6b, 0x3c, 0xfb, 0xf6, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x3f, 0x60, 0xec, 0x0e, 0x01, + 0x00, 0x00, } diff --git a/protos/response.pb.go b/protos/response.pb.go index f3e326c8..08492888 100644 --- a/protos/response.pb.go +++ b/protos/response.pb.go @@ -1,14 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: response.proto package protos -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -18,39 +16,33 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type Response struct { - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Error *Error `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Error *Error `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Response) Reset() { *m = Response{} } func (m *Response) String() string { return proto.CompactTextString(m) } func (*Response) ProtoMessage() {} func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_response_c2173384301af5a3, []int{0} + return fileDescriptor_response_c749f0402d6cb2d3, []int{0} } func (m *Response) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_Response.Unmarshal(m, b) } func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Response.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_Response.Marshal(b, m, deterministic) } func (dst *Response) XXX_Merge(src proto.Message) { xxx_messageInfo_Response.Merge(dst, src) } func (m *Response) XXX_Size() int { - return m.Size() + return xxx_messageInfo_Response.Size(m) } func (m *Response) XXX_DiscardUnknown() { xxx_messageInfo_Response.DiscardUnknown(m) @@ -75,309 +67,16 @@ func (m *Response) GetError() *Error { func init() { proto.RegisterType((*Response)(nil), "protos.Response") } -func (m *Response) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Response) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Data) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintResponse(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) - } - if m.Error != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintResponse(dAtA, i, uint64(m.Error.Size())) - n1, err := m.Error.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - } - return i, nil -} - -func encodeVarintResponse(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *Response) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + sovResponse(uint64(l)) - } - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovResponse(uint64(l)) - } - return n -} - -func sovResponse(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozResponse(x uint64) (n int) { - return sovResponse(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Response) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Response: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Response: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthResponse - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthResponse - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Error{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipResponse(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthResponse - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipResponse(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResponse - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResponse - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResponse - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthResponse - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResponse - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipResponse(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthResponse = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowResponse = fmt.Errorf("proto: integer overflow") -) -func init() { proto.RegisterFile("response.proto", fileDescriptor_response_c2173384301af5a3) } +func init() { proto.RegisterFile("response.proto", fileDescriptor_response_c749f0402d6cb2d3) } -var fileDescriptor_response_c2173384301af5a3 = []byte{ - // 133 bytes of a gzipped FileDescriptorProto +var fileDescriptor_response_c749f0402d6cb2d3 = []byte{ + // 105 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2b, 0x4a, 0x2d, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x52, 0xdc, 0xa9, 0x45, 0x45, 0xf9, 0x45, 0x10, 0x41, 0x25, 0x67, 0x2e, 0x8e, 0x20, 0xa8, 0x32, 0x21, 0x21, 0x2e, 0x96, 0x94, 0xc4, 0x92, 0x44, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x9e, 0x20, 0x30, 0x5b, 0x48, 0x99, 0x8b, 0x15, 0xac, 0x5c, 0x82, 0x49, 0x81, 0x51, 0x83, 0xdb, 0x88, 0x17, 0xa2, 0xad, - 0x58, 0xcf, 0x15, 0x24, 0x18, 0x04, 0x91, 0x73, 0x92, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, - 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, - 0x63, 0x39, 0x86, 0x24, 0x88, 0x9d, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3d, 0x88, 0x41, - 0xfe, 0x8c, 0x00, 0x00, 0x00, + 0x58, 0xcf, 0x15, 0x24, 0x18, 0x04, 0x91, 0x4b, 0x82, 0x98, 0x6c, 0x0c, 0x08, 0x00, 0x00, 0xff, + 0xff, 0xfc, 0x95, 0xc0, 0x6b, 0x72, 0x00, 0x00, 0x00, } diff --git a/protos/session.pb.go b/protos/session.pb.go index 8ff701b0..41f63075 100644 --- a/protos/session.pb.go +++ b/protos/session.pb.go @@ -1,14 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: session.proto package protos -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -18,40 +16,34 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type Session struct { - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Session) Reset() { *m = Session{} } func (m *Session) String() string { return proto.CompactTextString(m) } func (*Session) ProtoMessage() {} func (*Session) Descriptor() ([]byte, []int) { - return fileDescriptor_session_d62cf85f1e1ec7f1, []int{0} + return fileDescriptor_session_9a9ff980de1f2738, []int{0} } func (m *Session) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_Session.Unmarshal(m, b) } func (m *Session) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Session.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_Session.Marshal(b, m, deterministic) } func (dst *Session) XXX_Merge(src proto.Message) { xxx_messageInfo_Session.Merge(dst, src) } func (m *Session) XXX_Size() int { - return m.Size() + return xxx_messageInfo_Session.Size(m) } func (m *Session) XXX_DiscardUnknown() { xxx_messageInfo_Session.DiscardUnknown(m) @@ -83,328 +75,16 @@ func (m *Session) GetData() []byte { func init() { proto.RegisterType((*Session)(nil), "protos.Session") } -func (m *Session) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Session) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Id != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintSession(dAtA, i, uint64(m.Id)) - } - if len(m.Uid) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintSession(dAtA, i, uint64(len(m.Uid))) - i += copy(dAtA[i:], m.Uid) - } - if len(m.Data) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintSession(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) - } - return i, nil -} - -func encodeVarintSession(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *Session) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovSession(uint64(m.Id)) - } - l = len(m.Uid) - if l > 0 { - n += 1 + l + sovSession(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovSession(uint64(l)) - } - return n -} - -func sovSession(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozSession(x uint64) (n int) { - return sovSession(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Session) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSession - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Session: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Session: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSession - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSession - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSession - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Uid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSession - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSession - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSession(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthSession - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSession(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSession - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSession - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSession - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthSession - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSession - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipSession(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthSession = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSession = fmt.Errorf("proto: integer overflow") -) -func init() { proto.RegisterFile("session.proto", fileDescriptor_session_d62cf85f1e1ec7f1) } +func init() { proto.RegisterFile("session.proto", fileDescriptor_session_9a9ff980de1f2738) } -var fileDescriptor_session_d62cf85f1e1ec7f1 = []byte{ - // 131 bytes of a gzipped FileDescriptorProto +var fileDescriptor_session_9a9ff980de1f2738 = []byte{ + // 103 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2d, 0x4e, 0x2d, 0x2e, 0xce, 0xcc, 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, 0xf6, 0x5c, 0xec, 0xc1, 0x10, 0x09, 0x21, 0x3e, 0x2e, 0xa6, 0xcc, 0x14, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xe6, 0x20, 0xa6, 0xcc, 0x14, 0x21, 0x01, 0x2e, 0xe6, 0xd2, 0xcc, 0x14, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x10, 0x53, 0x48, 0x88, 0x8b, 0x25, 0x25, 0xb1, 0x24, 0x51, 0x82, 0x59, 0x81, - 0x51, 0x83, 0x27, 0x08, 0xcc, 0x76, 0x92, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, - 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, - 0x86, 0x24, 0x88, 0x15, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x75, 0xcf, 0x1a, 0x8e, 0x7a, - 0x00, 0x00, 0x00, + 0x51, 0x83, 0x27, 0x08, 0xcc, 0x4e, 0x82, 0x18, 0x64, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x90, + 0x07, 0x5b, 0x46, 0x60, 0x00, 0x00, 0x00, } diff --git a/protos/test/somestruct.pb.go b/protos/test/somestruct.pb.go index c7dfaf47..90f31d9e 100644 --- a/protos/test/somestruct.pb.go +++ b/protos/test/somestruct.pb.go @@ -1,14 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: somestruct.proto package test -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -18,39 +16,33 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type SomeStruct struct { - A int32 `protobuf:"varint,1,opt,name=A,proto3" json:"A,omitempty"` - B string `protobuf:"bytes,2,opt,name=B,proto3" json:"B,omitempty"` + A int32 `protobuf:"varint,1,opt,name=A,proto3" json:"A,omitempty"` + B string `protobuf:"bytes,2,opt,name=B,proto3" json:"B,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *SomeStruct) Reset() { *m = SomeStruct{} } func (m *SomeStruct) String() string { return proto.CompactTextString(m) } func (*SomeStruct) ProtoMessage() {} func (*SomeStruct) Descriptor() ([]byte, []int) { - return fileDescriptor_somestruct_2eb774db249dfbc5, []int{0} + return fileDescriptor_somestruct_5e81a066be23057d, []int{0} } func (m *SomeStruct) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_SomeStruct.Unmarshal(m, b) } func (m *SomeStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SomeStruct.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_SomeStruct.Marshal(b, m, deterministic) } func (dst *SomeStruct) XXX_Merge(src proto.Message) { xxx_messageInfo_SomeStruct.Merge(dst, src) } func (m *SomeStruct) XXX_Size() int { - return m.Size() + return xxx_messageInfo_SomeStruct.Size(m) } func (m *SomeStruct) XXX_DiscardUnknown() { xxx_messageInfo_SomeStruct.DiscardUnknown(m) @@ -75,286 +67,15 @@ func (m *SomeStruct) GetB() string { func init() { proto.RegisterType((*SomeStruct)(nil), "test.SomeStruct") } -func (m *SomeStruct) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SomeStruct) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.A != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintSomestruct(dAtA, i, uint64(m.A)) - } - if len(m.B) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintSomestruct(dAtA, i, uint64(len(m.B))) - i += copy(dAtA[i:], m.B) - } - return i, nil -} - -func encodeVarintSomestruct(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *SomeStruct) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.A != 0 { - n += 1 + sovSomestruct(uint64(m.A)) - } - l = len(m.B) - if l > 0 { - n += 1 + l + sovSomestruct(uint64(l)) - } - return n -} - -func sovSomestruct(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozSomestruct(x uint64) (n int) { - return sovSomestruct(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *SomeStruct) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSomestruct - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SomeStruct: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SomeStruct: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) - } - m.A = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSomestruct - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.A |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSomestruct - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSomestruct - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.B = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSomestruct(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthSomestruct - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSomestruct(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSomestruct - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSomestruct - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSomestruct - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthSomestruct - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSomestruct - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipSomestruct(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthSomestruct = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSomestruct = fmt.Errorf("proto: integer overflow") -) -func init() { proto.RegisterFile("somestruct.proto", fileDescriptor_somestruct_2eb774db249dfbc5) } +func init() { proto.RegisterFile("somestruct.proto", fileDescriptor_somestruct_5e81a066be23057d) } -var fileDescriptor_somestruct_2eb774db249dfbc5 = []byte{ - // 117 bytes of a gzipped FileDescriptorProto +var fileDescriptor_somestruct_5e81a066be23057d = []byte{ + // 90 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x28, 0xce, 0xcf, 0x4d, 0x2d, 0x2e, 0x29, 0x2a, 0x4d, 0x2e, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x29, 0x49, 0x2d, 0x2e, 0x51, 0xd2, 0xe0, 0xe2, 0x0a, 0xce, 0xcf, 0x4d, 0x0d, 0x06, 0xcb, 0x08, 0xf1, 0x70, 0x31, 0x3a, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0xb0, 0x06, 0x31, 0x3a, 0x82, 0x78, 0x4e, 0x12, 0x4c, - 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x8c, 0x4e, 0x4e, 0x12, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, - 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, - 0x2c, 0xc7, 0x90, 0xc4, 0x06, 0x36, 0xd0, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xd2, 0x8f, 0xe1, - 0x3e, 0x64, 0x00, 0x00, 0x00, + 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x8c, 0x4e, 0x49, 0x6c, 0x60, 0x6d, 0xc6, 0x80, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x3d, 0x9b, 0x98, 0xe0, 0x4a, 0x00, 0x00, 0x00, } diff --git a/protos/test/testrequest.pb.go b/protos/test/testrequest.pb.go index 2f251739..1898e448 100644 --- a/protos/test/testrequest.pb.go +++ b/protos/test/testrequest.pb.go @@ -1,14 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: testrequest.proto package test -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -18,38 +16,32 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type TestRequest struct { - Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` + Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *TestRequest) Reset() { *m = TestRequest{} } func (m *TestRequest) String() string { return proto.CompactTextString(m) } func (*TestRequest) ProtoMessage() {} func (*TestRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_testrequest_20ab47b87752e91e, []int{0} + return fileDescriptor_testrequest_b06ed3d5095fd632, []int{0} } func (m *TestRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_TestRequest.Unmarshal(m, b) } func (m *TestRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_TestRequest.Marshal(b, m, deterministic) } func (dst *TestRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_TestRequest.Merge(dst, src) } func (m *TestRequest) XXX_Size() int { - return m.Size() + return xxx_messageInfo_TestRequest.Size(m) } func (m *TestRequest) XXX_DiscardUnknown() { xxx_messageInfo_TestRequest.DiscardUnknown(m) @@ -67,258 +59,14 @@ func (m *TestRequest) GetMsg() string { func init() { proto.RegisterType((*TestRequest)(nil), "test.TestRequest") } -func (m *TestRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Msg) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTestrequest(dAtA, i, uint64(len(m.Msg))) - i += copy(dAtA[i:], m.Msg) - } - return i, nil -} - -func encodeVarintTestrequest(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *TestRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovTestrequest(uint64(l)) - } - return n -} - -func sovTestrequest(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozTestrequest(x uint64) (n int) { - return sovTestrequest(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *TestRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTestrequest - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTestrequest - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTestrequest - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTestrequest(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTestrequest - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTestrequest(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTestrequest - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTestrequest - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTestrequest - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthTestrequest - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTestrequest - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipTestrequest(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthTestrequest = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTestrequest = fmt.Errorf("proto: integer overflow") -) -func init() { proto.RegisterFile("testrequest.proto", fileDescriptor_testrequest_20ab47b87752e91e) } +func init() { proto.RegisterFile("testrequest.proto", fileDescriptor_testrequest_b06ed3d5095fd632) } -var fileDescriptor_testrequest_20ab47b87752e91e = []byte{ - // 106 bytes of a gzipped FileDescriptorProto +var fileDescriptor_testrequest_b06ed3d5095fd632 = []byte{ + // 79 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2c, 0x49, 0x2d, 0x2e, 0x29, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x01, 0x09, 0x29, 0xc9, 0x73, 0x71, 0x87, 0xa4, 0x16, 0x97, 0x04, 0x41, 0xa4, 0x84, 0x04, 0xb8, 0x98, - 0x73, 0x8b, 0xd3, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x40, 0x4c, 0x27, 0x89, 0x13, 0x8f, - 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, - 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x48, 0x62, 0x03, 0x9b, 0x63, 0x0c, 0x08, 0x00, 0x00, - 0xff, 0xff, 0xc2, 0x6a, 0x40, 0x1d, 0x5c, 0x00, 0x00, 0x00, + 0x73, 0x8b, 0xd3, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x40, 0xcc, 0x24, 0x36, 0xb0, 0x6a, + 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8e, 0xca, 0x49, 0xd7, 0x42, 0x00, 0x00, 0x00, } diff --git a/protos/test/testresponse.pb.go b/protos/test/testresponse.pb.go index 6ce96e35..e1ed35a0 100644 --- a/protos/test/testresponse.pb.go +++ b/protos/test/testresponse.pb.go @@ -1,14 +1,12 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: testresponse.proto package test -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -18,39 +16,33 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type TestResponse struct { - Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *TestResponse) Reset() { *m = TestResponse{} } func (m *TestResponse) String() string { return proto.CompactTextString(m) } func (*TestResponse) ProtoMessage() {} func (*TestResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_testresponse_68bc9a8da420ccc0, []int{0} + return fileDescriptor_testresponse_5fbd3cb466e28bc8, []int{0} } func (m *TestResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_TestResponse.Unmarshal(m, b) } func (m *TestResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_TestResponse.Marshal(b, m, deterministic) } func (dst *TestResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_TestResponse.Merge(dst, src) } func (m *TestResponse) XXX_Size() int { - return m.Size() + return xxx_messageInfo_TestResponse.Size(m) } func (m *TestResponse) XXX_DiscardUnknown() { xxx_messageInfo_TestResponse.DiscardUnknown(m) @@ -75,286 +67,15 @@ func (m *TestResponse) GetMsg() string { func init() { proto.RegisterType((*TestResponse)(nil), "test.TestResponse") } -func (m *TestResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Code != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTestresponse(dAtA, i, uint64(m.Code)) - } - if len(m.Msg) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTestresponse(dAtA, i, uint64(len(m.Msg))) - i += copy(dAtA[i:], m.Msg) - } - return i, nil -} - -func encodeVarintTestresponse(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *TestResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Code != 0 { - n += 1 + sovTestresponse(uint64(m.Code)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovTestresponse(uint64(l)) - } - return n -} - -func sovTestresponse(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozTestresponse(x uint64) (n int) { - return sovTestresponse(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *TestResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTestresponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTestresponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Code |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTestresponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTestresponse - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTestresponse(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTestresponse - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTestresponse(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTestresponse - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTestresponse - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTestresponse - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthTestresponse - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTestresponse - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipTestresponse(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthTestresponse = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTestresponse = fmt.Errorf("proto: integer overflow") -) -func init() { proto.RegisterFile("testresponse.proto", fileDescriptor_testresponse_68bc9a8da420ccc0) } +func init() { proto.RegisterFile("testresponse.proto", fileDescriptor_testresponse_5fbd3cb466e28bc8) } -var fileDescriptor_testresponse_68bc9a8da420ccc0 = []byte{ - // 124 bytes of a gzipped FileDescriptorProto +var fileDescriptor_testresponse_5fbd3cb466e28bc8 = []byte{ + // 96 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2a, 0x49, 0x2d, 0x2e, 0x29, 0x4a, 0x2d, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x01, 0x89, 0x29, 0x99, 0x70, 0xf1, 0x84, 0xa4, 0x16, 0x97, 0x04, 0x41, 0xe5, 0x84, 0x84, 0xb8, 0x58, 0x92, 0xf3, 0x53, 0x52, 0x25, 0x18, 0x15, 0x18, 0x35, 0x58, 0x83, 0xc0, 0x6c, 0x21, 0x01, - 0x2e, 0xe6, 0xdc, 0xe2, 0x74, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x10, 0xd3, 0x49, 0xe2, - 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, - 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0x92, 0xd8, 0xc0, 0x86, 0x1b, 0x03, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x68, 0x1b, 0x30, 0x7f, 0x72, 0x00, 0x00, 0x00, + 0x2e, 0xe6, 0xdc, 0xe2, 0x74, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x10, 0x33, 0x89, 0x0d, + 0x6c, 0x84, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x6a, 0x18, 0xc0, 0x42, 0x58, 0x00, 0x00, 0x00, } diff --git a/rpc.go b/rpc.go index 3ff15c6d..82fa5fa9 100644 --- a/rpc.go +++ b/rpc.go @@ -24,7 +24,7 @@ import ( "context" "reflect" - "github.com/gogo/protobuf/proto" + "github.com/golang/protobuf/proto" "github.com/topfreegames/pitaya/constants" "github.com/topfreegames/pitaya/route" "github.com/topfreegames/pitaya/worker" diff --git a/rpc_test.go b/rpc_test.go index 50d26546..6a854f4b 100644 --- a/rpc_test.go +++ b/rpc_test.go @@ -24,8 +24,8 @@ import ( "context" "testing" - "github.com/gogo/protobuf/proto" "github.com/golang/mock/gomock" + "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/topfreegames/pitaya/cluster" clustermocks "github.com/topfreegames/pitaya/cluster/mocks" diff --git a/serialize/protobuf/protobuf.go b/serialize/protobuf/protobuf.go index 3c241a3c..aa6e081f 100644 --- a/serialize/protobuf/protobuf.go +++ b/serialize/protobuf/protobuf.go @@ -21,7 +21,7 @@ package protobuf import ( - "github.com/gogo/protobuf/proto" + "github.com/golang/protobuf/proto" "github.com/topfreegames/pitaya/constants" ) diff --git a/service/remote.go b/service/remote.go index d3d393a1..6c131b14 100644 --- a/service/remote.go +++ b/service/remote.go @@ -26,7 +26,7 @@ import ( "fmt" "reflect" - "github.com/gogo/protobuf/proto" + "github.com/golang/protobuf/proto" "github.com/topfreegames/pitaya/agent" "github.com/topfreegames/pitaya/cluster" diff --git a/service/remote_test.go b/service/remote_test.go index 35d384d9..49f2e085 100644 --- a/service/remote_test.go +++ b/service/remote_test.go @@ -28,8 +28,8 @@ import ( "testing" "time" - "github.com/gogo/protobuf/proto" "github.com/golang/mock/gomock" + "github.com/golang/protobuf/proto" "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/topfreegames/pitaya/agent" diff --git a/service/util.go b/service/util.go index 43f08e00..9089bb1c 100644 --- a/service/util.go +++ b/service/util.go @@ -26,7 +26,7 @@ import ( "fmt" "reflect" - "github.com/gogo/protobuf/proto" + "github.com/golang/protobuf/proto" "github.com/topfreegames/pitaya/component" "github.com/topfreegames/pitaya/conn/message" "github.com/topfreegames/pitaya/constants" diff --git a/service/util_test.go b/service/util_test.go index 070f7be8..c991c547 100644 --- a/service/util_test.go +++ b/service/util_test.go @@ -29,8 +29,8 @@ import ( "reflect" "testing" - "github.com/gogo/protobuf/proto" "github.com/golang/mock/gomock" + "github.com/golang/protobuf/proto" "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/session/session.go b/session/session.go index 363a4edc..aa2cc3d9 100644 --- a/session/session.go +++ b/session/session.go @@ -29,7 +29,7 @@ import ( "sync/atomic" "time" - "github.com/gogo/protobuf/proto" + "github.com/golang/protobuf/proto" nats "github.com/nats-io/go-nats" "github.com/topfreegames/pitaya/constants" "github.com/topfreegames/pitaya/logger" diff --git a/session/session_test.go b/session/session_test.go index c759b0f8..d86eb354 100644 --- a/session/session_test.go +++ b/session/session_test.go @@ -31,8 +31,8 @@ import ( "testing" "time" - "github.com/gogo/protobuf/proto" "github.com/golang/mock/gomock" + "github.com/golang/protobuf/proto" "github.com/google/uuid" nats "github.com/nats-io/go-nats" "github.com/stretchr/testify/assert" diff --git a/worker/mocks/rpc_job.go b/worker/mocks/rpc_job.go index 6450568d..20236c16 100644 --- a/worker/mocks/rpc_job.go +++ b/worker/mocks/rpc_job.go @@ -6,8 +6,8 @@ package mocks import ( context "context" - proto "github.com/gogo/protobuf/proto" gomock "github.com/golang/mock/gomock" + proto "github.com/golang/protobuf/proto" reflect "reflect" ) diff --git a/worker/models.go b/worker/models.go index 8407abb5..6c542230 100644 --- a/worker/models.go +++ b/worker/models.go @@ -20,7 +20,7 @@ package worker -import "github.com/gogo/protobuf/proto" +import "github.com/golang/protobuf/proto" type rpcInfo struct { Route string diff --git a/worker/rpc_job.go b/worker/rpc_job.go index 25325768..eb537ea3 100644 --- a/worker/rpc_job.go +++ b/worker/rpc_job.go @@ -23,7 +23,7 @@ package worker import ( "context" - "github.com/gogo/protobuf/proto" + "github.com/golang/protobuf/proto" ) // RPCJob has infos to execute a rpc on worker diff --git a/worker/worker.go b/worker/worker.go index f874e3ca..98ba087b 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -25,7 +25,7 @@ import ( "encoding/json" "os" - "github.com/gogo/protobuf/proto" + "github.com/golang/protobuf/proto" "github.com/topfreegames/pitaya/config" "github.com/topfreegames/pitaya/constants" "github.com/topfreegames/pitaya/logger"