protobuf updates (#742)

This commit is contained in:
Jesse Peterson
2021-06-09 15:55:32 -07:00
committed by GitHub
parent 4d5fbf5fd1
commit 0ba759a5c1
4 changed files with 244 additions and 404 deletions

View File

@@ -1,22 +1,15 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: command.proto
/*
Package commandproto is a generated protocol buffer package.
It is generated from these files:
command.proto
It has these top-level messages:
Event
*/
package commandproto
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import io "io"
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
@@ -27,19 +20,50 @@ 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.ProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type Event struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Time int64 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"`
DeviceUdid string `protobuf:"bytes,4,opt,name=device_udid,json=deviceUdid,proto3" json:"device_udid,omitempty"`
PayloadBytes []byte `protobuf:"bytes,5,opt,name=payload_bytes,json=payloadBytes,proto3" json:"payload_bytes,omitempty"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Time int64 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"`
DeviceUdid string `protobuf:"bytes,4,opt,name=device_udid,json=deviceUdid,proto3" json:"device_udid,omitempty"`
PayloadBytes []byte `protobuf:"bytes,5,opt,name=payload_bytes,json=payloadBytes,proto3" json:"payload_bytes,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Event) Reset() { *m = Event{} }
func (m *Event) String() string { return proto.CompactTextString(m) }
func (*Event) ProtoMessage() {}
func (*Event) Descriptor() ([]byte, []int) { return fileDescriptorCommand, []int{0} }
func (m *Event) Reset() { *m = Event{} }
func (m *Event) String() string { return proto.CompactTextString(m) }
func (*Event) ProtoMessage() {}
func (*Event) Descriptor() ([]byte, []int) {
return fileDescriptor_213c0bb044472049, []int{0}
}
func (m *Event) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Event.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Event) XXX_Merge(src proto.Message) {
xxx_messageInfo_Event.Merge(m, src)
}
func (m *Event) XXX_Size() int {
return m.Size()
}
func (m *Event) XXX_DiscardUnknown() {
xxx_messageInfo_Event.DiscardUnknown(m)
}
var xxx_messageInfo_Event proto.InternalMessageInfo
func (m *Event) GetId() string {
if m != nil {
@@ -72,10 +96,28 @@ func (m *Event) GetPayloadBytes() []byte {
func init() {
proto.RegisterType((*Event)(nil), "commandproto.Event")
}
func init() { proto.RegisterFile("command.proto", fileDescriptor_213c0bb044472049) }
var fileDescriptor_213c0bb044472049 = []byte{
// 166 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4d, 0xce, 0xcf, 0xcd,
0x4d, 0xcc, 0x4b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x81, 0x72, 0xc1, 0x3c, 0xa5,
0x42, 0x2e, 0x56, 0xd7, 0xb2, 0xd4, 0xbc, 0x12, 0x21, 0x3e, 0x2e, 0xa6, 0xcc, 0x14, 0x09, 0x46,
0x05, 0x46, 0x0d, 0xce, 0x20, 0xa6, 0xcc, 0x14, 0x21, 0x21, 0x2e, 0x96, 0x92, 0xcc, 0xdc, 0x54,
0x09, 0x26, 0x05, 0x46, 0x0d, 0xe6, 0x20, 0x30, 0x5b, 0x48, 0x9e, 0x8b, 0x3b, 0x25, 0xb5, 0x2c,
0x33, 0x39, 0x35, 0xbe, 0x34, 0x25, 0x33, 0x45, 0x82, 0x05, 0xac, 0x98, 0x0b, 0x22, 0x14, 0x9a,
0x92, 0x99, 0x22, 0xa4, 0xcc, 0xc5, 0x5b, 0x90, 0x58, 0x99, 0x93, 0x9f, 0x98, 0x12, 0x9f, 0x54,
0x59, 0x92, 0x5a, 0x2c, 0xc1, 0xaa, 0xc0, 0xa8, 0xc1, 0x13, 0xc4, 0x03, 0x15, 0x74, 0x02, 0x89,
0x39, 0x09, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x33,
0x1e, 0xcb, 0x31, 0x24, 0xb1, 0x81, 0xdd, 0x62, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xca,
0xac, 0xde, 0xaa, 0x00, 0x00, 0x00,
}
func (m *Event) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
@@ -83,46 +125,63 @@ func (m *Event) Marshal() (dAtA []byte, err error) {
}
func (m *Event) MarshalTo(dAtA []byte) (int, error) {
var i int
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Id) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintCommand(dAtA, i, uint64(len(m.Id)))
i += copy(dAtA[i:], m.Id)
}
if m.Time != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintCommand(dAtA, i, uint64(m.Time))
}
if len(m.DeviceUdid) > 0 {
dAtA[i] = 0x22
i++
i = encodeVarintCommand(dAtA, i, uint64(len(m.DeviceUdid)))
i += copy(dAtA[i:], m.DeviceUdid)
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.PayloadBytes) > 0 {
dAtA[i] = 0x2a
i++
i -= len(m.PayloadBytes)
copy(dAtA[i:], m.PayloadBytes)
i = encodeVarintCommand(dAtA, i, uint64(len(m.PayloadBytes)))
i += copy(dAtA[i:], m.PayloadBytes)
i--
dAtA[i] = 0x2a
}
return i, nil
if len(m.DeviceUdid) > 0 {
i -= len(m.DeviceUdid)
copy(dAtA[i:], m.DeviceUdid)
i = encodeVarintCommand(dAtA, i, uint64(len(m.DeviceUdid)))
i--
dAtA[i] = 0x22
}
if m.Time != 0 {
i = encodeVarintCommand(dAtA, i, uint64(m.Time))
i--
dAtA[i] = 0x10
}
if len(m.Id) > 0 {
i -= len(m.Id)
copy(dAtA[i:], m.Id)
i = encodeVarintCommand(dAtA, i, uint64(len(m.Id)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintCommand(dAtA []byte, offset int, v uint64) int {
offset -= sovCommand(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
return base
}
func (m *Event) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Id)
@@ -140,18 +199,14 @@ func (m *Event) Size() (n int) {
if l > 0 {
n += 1 + l + sovCommand(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovCommand(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
return (math_bits.Len64(x|1) + 6) / 7
}
func sozCommand(x uint64) (n int) {
return sovCommand(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@@ -171,7 +226,7 @@ func (m *Event) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
@@ -199,7 +254,7 @@ func (m *Event) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
@@ -209,6 +264,9 @@ func (m *Event) Unmarshal(dAtA []byte) error {
return ErrInvalidLengthCommand
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthCommand
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
@@ -228,7 +286,7 @@ func (m *Event) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
m.Time |= (int64(b) & 0x7F) << shift
m.Time |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
@@ -247,7 +305,7 @@ func (m *Event) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
@@ -257,6 +315,9 @@ func (m *Event) Unmarshal(dAtA []byte) error {
return ErrInvalidLengthCommand
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthCommand
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
@@ -276,7 +337,7 @@ func (m *Event) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= (int(b) & 0x7F) << shift
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
@@ -285,6 +346,9 @@ func (m *Event) Unmarshal(dAtA []byte) error {
return ErrInvalidLengthCommand
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthCommand
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
@@ -299,12 +363,13 @@ func (m *Event) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if skippy < 0 {
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthCommand
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
@@ -317,6 +382,7 @@ func (m *Event) Unmarshal(dAtA []byte) error {
func skipCommand(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
@@ -348,10 +414,8 @@ func skipCommand(dAtA []byte) (n int, err error) {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
@@ -368,70 +432,34 @@ func skipCommand(dAtA []byte) (n int, err error) {
break
}
}
iNdEx += length
if length < 0 {
return 0, ErrInvalidLengthCommand
}
return iNdEx, nil
iNdEx += length
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowCommand
}
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 := skipCommand(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
}
return iNdEx, nil
depth++
case 4:
return iNdEx, nil
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupCommand
}
depth--
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthCommand
}
if depth == 0 {
return iNdEx, nil
}
}
panic("unreachable")
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthCommand = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowCommand = fmt.Errorf("proto: integer overflow")
ErrInvalidLengthCommand = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowCommand = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupCommand = fmt.Errorf("proto: unexpected end of group")
)
func init() { proto.RegisterFile("command.proto", fileDescriptorCommand) }
var fileDescriptorCommand = []byte{
// 166 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4d, 0xce, 0xcf, 0xcd,
0x4d, 0xcc, 0x4b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x81, 0x72, 0xc1, 0x3c, 0xa5,
0x42, 0x2e, 0x56, 0xd7, 0xb2, 0xd4, 0xbc, 0x12, 0x21, 0x3e, 0x2e, 0xa6, 0xcc, 0x14, 0x09, 0x46,
0x05, 0x46, 0x0d, 0xce, 0x20, 0xa6, 0xcc, 0x14, 0x21, 0x21, 0x2e, 0x96, 0x92, 0xcc, 0xdc, 0x54,
0x09, 0x26, 0x05, 0x46, 0x0d, 0xe6, 0x20, 0x30, 0x5b, 0x48, 0x9e, 0x8b, 0x3b, 0x25, 0xb5, 0x2c,
0x33, 0x39, 0x35, 0xbe, 0x34, 0x25, 0x33, 0x45, 0x82, 0x05, 0xac, 0x98, 0x0b, 0x22, 0x14, 0x9a,
0x92, 0x99, 0x22, 0xa4, 0xcc, 0xc5, 0x5b, 0x90, 0x58, 0x99, 0x93, 0x9f, 0x98, 0x12, 0x9f, 0x54,
0x59, 0x92, 0x5a, 0x2c, 0xc1, 0xaa, 0xc0, 0xa8, 0xc1, 0x13, 0xc4, 0x03, 0x15, 0x74, 0x02, 0x89,
0x39, 0x09, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x33,
0x1e, 0xcb, 0x31, 0x24, 0xb1, 0x81, 0xdd, 0x62, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xca,
0xac, 0xde, 0xaa, 0x00, 0x00, 0x00,
}