From dd1ef998554df4189cf6c2115548689e5825d299 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期四, 09 五月 2019 15:25:02 +0800
Subject: [PATCH] add .pb.go
---
.gitignore | 1
protomsg.pb.go | 959 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 959 insertions(+), 1 deletions(-)
diff --git a/.gitignore b/.gitignore
index f323e83..bb73550 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,4 +22,3 @@
*.exe
*.test
-*.pb.go
diff --git a/protomsg.pb.go b/protomsg.pb.go
new file mode 100644
index 0000000..8ba5c61
--- /dev/null
+++ b/protomsg.pb.go
@@ -0,0 +1,959 @@
+// Code generated by protoc-gen-gogo. DO NOT EDIT.
+// source: protomsg.proto
+
+package protomsg
+
+import (
+ fmt "fmt"
+ proto "github.com/gogo/protobuf/proto"
+ io "io"
+ math "math"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// 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
+
+type TaskLabel struct {
+ Taskid string `protobuf:"bytes,1,opt,name=taskid,proto3" json:"taskid,omitempty"`
+ Sdkids []string `protobuf:"bytes,2,rep,name=sdkids,proto3" json:"sdkids,omitempty"`
+ Index int32 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"`
+}
+
+func (m *TaskLabel) Reset() { *m = TaskLabel{} }
+func (m *TaskLabel) String() string { return proto.CompactTextString(m) }
+func (*TaskLabel) ProtoMessage() {}
+func (*TaskLabel) Descriptor() ([]byte, []int) {
+ return fileDescriptor_32de24555f916688, []int{0}
+}
+func (m *TaskLabel) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *TaskLabel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_TaskLabel.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalTo(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *TaskLabel) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_TaskLabel.Merge(m, src)
+}
+func (m *TaskLabel) XXX_Size() int {
+ return m.Size()
+}
+func (m *TaskLabel) XXX_DiscardUnknown() {
+ xxx_messageInfo_TaskLabel.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_TaskLabel proto.InternalMessageInfo
+
+func (m *TaskLabel) GetTaskid() string {
+ if m != nil {
+ return m.Taskid
+ }
+ return ""
+}
+
+func (m *TaskLabel) GetSdkids() []string {
+ if m != nil {
+ return m.Sdkids
+ }
+ return nil
+}
+
+func (m *TaskLabel) GetIndex() int32 {
+ if m != nil {
+ return m.Index
+ }
+ return 0
+}
+
+type SdkMessage struct {
+ Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"`
+ Tasklab *TaskLabel `protobuf:"bytes,2,opt,name=tasklab,proto3" json:"tasklab,omitempty"`
+ Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
+}
+
+func (m *SdkMessage) Reset() { *m = SdkMessage{} }
+func (m *SdkMessage) String() string { return proto.CompactTextString(m) }
+func (*SdkMessage) ProtoMessage() {}
+func (*SdkMessage) Descriptor() ([]byte, []int) {
+ return fileDescriptor_32de24555f916688, []int{1}
+}
+func (m *SdkMessage) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *SdkMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_SdkMessage.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalTo(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *SdkMessage) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_SdkMessage.Merge(m, src)
+}
+func (m *SdkMessage) XXX_Size() int {
+ return m.Size()
+}
+func (m *SdkMessage) XXX_DiscardUnknown() {
+ xxx_messageInfo_SdkMessage.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_SdkMessage proto.InternalMessageInfo
+
+func (m *SdkMessage) GetCid() string {
+ if m != nil {
+ return m.Cid
+ }
+ return ""
+}
+
+func (m *SdkMessage) GetTasklab() *TaskLabel {
+ if m != nil {
+ return m.Tasklab
+ }
+ return nil
+}
+
+func (m *SdkMessage) GetData() []byte {
+ if m != nil {
+ return m.Data
+ }
+ return nil
+}
+
+// Image ipc struct
+type Image struct {
+ Width int32 `protobuf:"varint,1,opt,name=width,proto3" json:"width,omitempty"`
+ Height int32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
+ Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
+}
+
+func (m *Image) Reset() { *m = Image{} }
+func (m *Image) String() string { return proto.CompactTextString(m) }
+func (*Image) ProtoMessage() {}
+func (*Image) Descriptor() ([]byte, []int) {
+ return fileDescriptor_32de24555f916688, []int{2}
+}
+func (m *Image) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *Image) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_Image.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalTo(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *Image) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Image.Merge(m, src)
+}
+func (m *Image) XXX_Size() int {
+ return m.Size()
+}
+func (m *Image) XXX_DiscardUnknown() {
+ xxx_messageInfo_Image.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Image proto.InternalMessageInfo
+
+func (m *Image) GetWidth() int32 {
+ if m != nil {
+ return m.Width
+ }
+ return 0
+}
+
+func (m *Image) GetHeight() int32 {
+ if m != nil {
+ return m.Height
+ }
+ return 0
+}
+
+func (m *Image) GetData() []byte {
+ if m != nil {
+ return m.Data
+ }
+ return nil
+}
+
+func init() {
+ proto.RegisterType((*TaskLabel)(nil), "protomsg.TaskLabel")
+ proto.RegisterType((*SdkMessage)(nil), "protomsg.SdkMessage")
+ proto.RegisterType((*Image)(nil), "protomsg.Image")
+}
+
+func init() { proto.RegisterFile("protomsg.proto", fileDescriptor_32de24555f916688) }
+
+var fileDescriptor_32de24555f916688 = []byte{
+ // 238 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x8e, 0xbd, 0x4e, 0xc3, 0x30,
+ 0x14, 0x85, 0xe3, 0x06, 0x17, 0x7a, 0x41, 0x08, 0x99, 0x0a, 0x79, 0xb2, 0xac, 0x4c, 0x59, 0xe8,
+ 0x00, 0x6f, 0xc0, 0x56, 0x09, 0x06, 0x0c, 0x2f, 0x70, 0x83, 0xad, 0xc4, 0x72, 0x4b, 0x11, 0xb6,
+ 0x04, 0x8f, 0xc1, 0x63, 0x31, 0x66, 0x64, 0x44, 0xc9, 0x8b, 0x20, 0x3b, 0x3f, 0x13, 0xdb, 0xf9,
+ 0xae, 0xae, 0xbe, 0x73, 0xe0, 0xfc, 0xed, 0xfd, 0x10, 0x0e, 0x7b, 0x5f, 0x6f, 0x52, 0x60, 0x27,
+ 0x13, 0x17, 0x8f, 0xb0, 0x7a, 0x46, 0xef, 0xee, 0xb1, 0x32, 0x3b, 0x76, 0x05, 0xcb, 0x80, 0xde,
+ 0x59, 0xcd, 0x89, 0x24, 0xe5, 0x4a, 0x8d, 0x14, 0xef, 0x5e, 0x3b, 0xab, 0x3d, 0x5f, 0xc8, 0x3c,
+ 0xde, 0x07, 0x62, 0x6b, 0xa0, 0xf6, 0x55, 0x9b, 0x4f, 0x9e, 0x4b, 0x52, 0x52, 0x35, 0x40, 0x81,
+ 0x00, 0x4f, 0xda, 0x3d, 0x18, 0xef, 0xb1, 0x36, 0xec, 0x02, 0xf2, 0x97, 0x59, 0x18, 0x23, 0xbb,
+ 0x86, 0xe3, 0xe8, 0xdd, 0x61, 0xc5, 0x17, 0x92, 0x94, 0xa7, 0x37, 0x97, 0x9b, 0x79, 0xde, 0xbc,
+ 0x45, 0x4d, 0x3f, 0x8c, 0xc1, 0x91, 0xc6, 0x80, 0xa9, 0xe3, 0x4c, 0xa5, 0x5c, 0x6c, 0x81, 0x6e,
+ 0xf7, 0xd1, 0xbe, 0x06, 0xfa, 0x61, 0x75, 0x68, 0x92, 0x9f, 0xaa, 0x01, 0xe2, 0xde, 0xc6, 0xd8,
+ 0xba, 0x09, 0xa9, 0x80, 0xaa, 0x91, 0xfe, 0x53, 0xdd, 0xf1, 0xef, 0x4e, 0x90, 0xb6, 0x13, 0xe4,
+ 0xb7, 0x13, 0xe4, 0xab, 0x17, 0x59, 0xdb, 0x8b, 0xec, 0xa7, 0x17, 0x59, 0xb5, 0x4c, 0xab, 0x6e,
+ 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x88, 0x81, 0x6c, 0xa1, 0x3d, 0x01, 0x00, 0x00,
+}
+
+func (m *TaskLabel) 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 *TaskLabel) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ if len(m.Taskid) > 0 {
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintProtomsg(dAtA, i, uint64(len(m.Taskid)))
+ i += copy(dAtA[i:], m.Taskid)
+ }
+ if len(m.Sdkids) > 0 {
+ for _, s := range m.Sdkids {
+ dAtA[i] = 0x12
+ 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)
+ }
+ }
+ if m.Index != 0 {
+ dAtA[i] = 0x18
+ i++
+ i = encodeVarintProtomsg(dAtA, i, uint64(m.Index))
+ }
+ return i, nil
+}
+
+func (m *SdkMessage) 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 *SdkMessage) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ if len(m.Cid) > 0 {
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintProtomsg(dAtA, i, uint64(len(m.Cid)))
+ i += copy(dAtA[i:], m.Cid)
+ }
+ if m.Tasklab != nil {
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintProtomsg(dAtA, i, uint64(m.Tasklab.Size()))
+ n1, err1 := m.Tasklab.MarshalTo(dAtA[i:])
+ if err1 != nil {
+ return 0, err1
+ }
+ i += n1
+ }
+ if len(m.Data) > 0 {
+ dAtA[i] = 0x1a
+ i++
+ i = encodeVarintProtomsg(dAtA, i, uint64(len(m.Data)))
+ i += copy(dAtA[i:], m.Data)
+ }
+ return i, nil
+}
+
+func (m *Image) 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 *Image) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ if m.Width != 0 {
+ dAtA[i] = 0x8
+ i++
+ i = encodeVarintProtomsg(dAtA, i, uint64(m.Width))
+ }
+ if m.Height != 0 {
+ dAtA[i] = 0x10
+ i++
+ i = encodeVarintProtomsg(dAtA, i, uint64(m.Height))
+ }
+ if len(m.Data) > 0 {
+ dAtA[i] = 0x1a
+ i++
+ i = encodeVarintProtomsg(dAtA, i, uint64(len(m.Data)))
+ i += copy(dAtA[i:], m.Data)
+ }
+ return i, nil
+}
+
+func encodeVarintProtomsg(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 *TaskLabel) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Taskid)
+ if l > 0 {
+ n += 1 + l + sovProtomsg(uint64(l))
+ }
+ if len(m.Sdkids) > 0 {
+ for _, s := range m.Sdkids {
+ l = len(s)
+ n += 1 + l + sovProtomsg(uint64(l))
+ }
+ }
+ if m.Index != 0 {
+ n += 1 + sovProtomsg(uint64(m.Index))
+ }
+ return n
+}
+
+func (m *SdkMessage) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Cid)
+ if l > 0 {
+ n += 1 + l + sovProtomsg(uint64(l))
+ }
+ if m.Tasklab != nil {
+ l = m.Tasklab.Size()
+ n += 1 + l + sovProtomsg(uint64(l))
+ }
+ l = len(m.Data)
+ if l > 0 {
+ n += 1 + l + sovProtomsg(uint64(l))
+ }
+ return n
+}
+
+func (m *Image) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.Width != 0 {
+ n += 1 + sovProtomsg(uint64(m.Width))
+ }
+ if m.Height != 0 {
+ n += 1 + sovProtomsg(uint64(m.Height))
+ }
+ l = len(m.Data)
+ if l > 0 {
+ n += 1 + l + sovProtomsg(uint64(l))
+ }
+ return n
+}
+
+func sovProtomsg(x uint64) (n int) {
+ for {
+ n++
+ x >>= 7
+ if x == 0 {
+ break
+ }
+ }
+ return n
+}
+func sozProtomsg(x uint64) (n int) {
+ return sovProtomsg(uint64((x << 1) ^ uint64((int64(x) >> 63))))
+}
+func (m *TaskLabel) 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 ErrIntOverflowProtomsg
+ }
+ 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: TaskLabel: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: TaskLabel: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Taskid", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowProtomsg
+ }
+ 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 ErrInvalidLengthProtomsg
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthProtomsg
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Taskid = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Sdkids", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowProtomsg
+ }
+ 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 ErrInvalidLengthProtomsg
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthProtomsg
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Sdkids = append(m.Sdkids, string(dAtA[iNdEx:postIndex]))
+ iNdEx = postIndex
+ case 3:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
+ }
+ m.Index = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowProtomsg
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Index |= int32(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ default:
+ iNdEx = preIndex
+ skippy, err := skipProtomsg(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthProtomsg
+ }
+ if (iNdEx + skippy) < 0 {
+ return ErrInvalidLengthProtomsg
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *SdkMessage) 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 ErrIntOverflowProtomsg
+ }
+ 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: SdkMessage: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: SdkMessage: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowProtomsg
+ }
+ 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 ErrInvalidLengthProtomsg
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthProtomsg
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Cid = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Tasklab", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowProtomsg
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthProtomsg
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthProtomsg
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Tasklab == nil {
+ m.Tasklab = &TaskLabel{}
+ }
+ if err := m.Tasklab.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ 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 ErrIntOverflowProtomsg
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ byteLen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if byteLen < 0 {
+ return ErrInvalidLengthProtomsg
+ }
+ postIndex := iNdEx + byteLen
+ if postIndex < 0 {
+ return ErrInvalidLengthProtomsg
+ }
+ 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 := skipProtomsg(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthProtomsg
+ }
+ if (iNdEx + skippy) < 0 {
+ return ErrInvalidLengthProtomsg
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *Image) 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 ErrIntOverflowProtomsg
+ }
+ 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: Image: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: Image: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Width", wireType)
+ }
+ m.Width = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowProtomsg
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Width |= int32(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType)
+ }
+ m.Height = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowProtomsg
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Height |= int32(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ 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 ErrIntOverflowProtomsg
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ byteLen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if byteLen < 0 {
+ return ErrInvalidLengthProtomsg
+ }
+ postIndex := iNdEx + byteLen
+ if postIndex < 0 {
+ return ErrInvalidLengthProtomsg
+ }
+ 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 := skipProtomsg(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthProtomsg
+ }
+ if (iNdEx + skippy) < 0 {
+ return ErrInvalidLengthProtomsg
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func skipProtomsg(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, ErrIntOverflowProtomsg
+ }
+ 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, ErrIntOverflowProtomsg
+ }
+ 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, ErrIntOverflowProtomsg
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ length |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if length < 0 {
+ return 0, ErrInvalidLengthProtomsg
+ }
+ iNdEx += length
+ if iNdEx < 0 {
+ return 0, ErrInvalidLengthProtomsg
+ }
+ return iNdEx, nil
+ case 3:
+ for {
+ var innerWire uint64
+ var start int = iNdEx
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowProtomsg
+ }
+ 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 := skipProtomsg(dAtA[start:])
+ if err != nil {
+ return 0, err
+ }
+ iNdEx = start + next
+ if iNdEx < 0 {
+ return 0, ErrInvalidLengthProtomsg
+ }
+ }
+ 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 (
+ ErrInvalidLengthProtomsg = fmt.Errorf("proto: negative length found during unmarshaling")
+ ErrIntOverflowProtomsg = fmt.Errorf("proto: integer overflow")
+)
--
Gitblit v1.8.0