mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-15 01:34:05 +00:00
415 lines
9.9 KiB
Go
415 lines
9.9 KiB
Go
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||
|
// source: map.proto
|
||
|
|
||
|
/*
|
||
|
Package mapdefaults is a generated protocol buffer package.
|
||
|
|
||
|
It is generated from these files:
|
||
|
map.proto
|
||
|
|
||
|
It has these top-level messages:
|
||
|
MapTest
|
||
|
*/
|
||
|
package mapdefaults
|
||
|
|
||
|
import proto "github.com/gogo/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
|
||
|
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 MapTest struct {
|
||
|
StrStr map[string]string `protobuf:"bytes,1,rep,name=str_str,json=strStr" json:"str_str,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||
|
}
|
||
|
|
||
|
func (m *MapTest) Reset() { *m = MapTest{} }
|
||
|
func (m *MapTest) String() string { return proto.CompactTextString(m) }
|
||
|
func (*MapTest) ProtoMessage() {}
|
||
|
func (*MapTest) Descriptor() ([]byte, []int) { return fileDescriptorMap, []int{0} }
|
||
|
|
||
|
func (m *MapTest) GetStrStr() map[string]string {
|
||
|
if m != nil {
|
||
|
return m.StrStr
|
||
|
}
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
proto.RegisterType((*MapTest)(nil), "mapdefaults.MapTest")
|
||
|
}
|
||
|
func (m *MapTest) 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 *MapTest) MarshalTo(dAtA []byte) (int, error) {
|
||
|
var i int
|
||
|
_ = i
|
||
|
var l int
|
||
|
_ = l
|
||
|
if len(m.StrStr) > 0 {
|
||
|
for k := range m.StrStr {
|
||
|
dAtA[i] = 0xa
|
||
|
i++
|
||
|
v := m.StrStr[k]
|
||
|
mapSize := 1 + len(k) + sovMap(uint64(len(k))) + 1 + len(v) + sovMap(uint64(len(v)))
|
||
|
i = encodeVarintMap(dAtA, i, uint64(mapSize))
|
||
|
dAtA[i] = 0xa
|
||
|
i++
|
||
|
i = encodeVarintMap(dAtA, i, uint64(len(k)))
|
||
|
i += copy(dAtA[i:], k)
|
||
|
dAtA[i] = 0x12
|
||
|
i++
|
||
|
i = encodeVarintMap(dAtA, i, uint64(len(v)))
|
||
|
i += copy(dAtA[i:], v)
|
||
|
}
|
||
|
}
|
||
|
return i, nil
|
||
|
}
|
||
|
|
||
|
func encodeFixed64Map(dAtA []byte, offset int, v uint64) int {
|
||
|
dAtA[offset] = uint8(v)
|
||
|
dAtA[offset+1] = uint8(v >> 8)
|
||
|
dAtA[offset+2] = uint8(v >> 16)
|
||
|
dAtA[offset+3] = uint8(v >> 24)
|
||
|
dAtA[offset+4] = uint8(v >> 32)
|
||
|
dAtA[offset+5] = uint8(v >> 40)
|
||
|
dAtA[offset+6] = uint8(v >> 48)
|
||
|
dAtA[offset+7] = uint8(v >> 56)
|
||
|
return offset + 8
|
||
|
}
|
||
|
func encodeFixed32Map(dAtA []byte, offset int, v uint32) int {
|
||
|
dAtA[offset] = uint8(v)
|
||
|
dAtA[offset+1] = uint8(v >> 8)
|
||
|
dAtA[offset+2] = uint8(v >> 16)
|
||
|
dAtA[offset+3] = uint8(v >> 24)
|
||
|
return offset + 4
|
||
|
}
|
||
|
func encodeVarintMap(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 *MapTest) Size() (n int) {
|
||
|
var l int
|
||
|
_ = l
|
||
|
if len(m.StrStr) > 0 {
|
||
|
for k, v := range m.StrStr {
|
||
|
_ = k
|
||
|
_ = v
|
||
|
mapEntrySize := 1 + len(k) + sovMap(uint64(len(k))) + 1 + len(v) + sovMap(uint64(len(v)))
|
||
|
n += mapEntrySize + 1 + sovMap(uint64(mapEntrySize))
|
||
|
}
|
||
|
}
|
||
|
return n
|
||
|
}
|
||
|
|
||
|
func sovMap(x uint64) (n int) {
|
||
|
for {
|
||
|
n++
|
||
|
x >>= 7
|
||
|
if x == 0 {
|
||
|
break
|
||
|
}
|
||
|
}
|
||
|
return n
|
||
|
}
|
||
|
func sozMap(x uint64) (n int) {
|
||
|
return sovMap(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||
|
}
|
||
|
func (m *MapTest) 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 ErrIntOverflowMap
|
||
|
}
|
||
|
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: MapTest: wiretype end group for non-group")
|
||
|
}
|
||
|
if fieldNum <= 0 {
|
||
|
return fmt.Errorf("proto: MapTest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||
|
}
|
||
|
switch fieldNum {
|
||
|
case 1:
|
||
|
if wireType != 2 {
|
||
|
return fmt.Errorf("proto: wrong wireType = %d for field StrStr", wireType)
|
||
|
}
|
||
|
var msglen int
|
||
|
for shift := uint(0); ; shift += 7 {
|
||
|
if shift >= 64 {
|
||
|
return ErrIntOverflowMap
|
||
|
}
|
||
|
if iNdEx >= l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
b := dAtA[iNdEx]
|
||
|
iNdEx++
|
||
|
msglen |= (int(b) & 0x7F) << shift
|
||
|
if b < 0x80 {
|
||
|
break
|
||
|
}
|
||
|
}
|
||
|
if msglen < 0 {
|
||
|
return ErrInvalidLengthMap
|
||
|
}
|
||
|
postIndex := iNdEx + msglen
|
||
|
if postIndex > l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
if m.StrStr == nil {
|
||
|
m.StrStr = make(map[string]string)
|
||
|
}
|
||
|
var mapkey string
|
||
|
var mapvalue string
|
||
|
for iNdEx < postIndex {
|
||
|
var wire uint64
|
||
|
for shift := uint(0); ; shift += 7 {
|
||
|
if shift >= 64 {
|
||
|
return ErrIntOverflowMap
|
||
|
}
|
||
|
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 ErrIntOverflowMap
|
||
|
}
|
||
|
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 ErrInvalidLengthMap
|
||
|
}
|
||
|
postStringIndexmapkey := iNdEx + intStringLenmapkey
|
||
|
if postStringIndexmapkey > l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
|
||
|
iNdEx = postStringIndexmapkey
|
||
|
} else {
|
||
|
var stringLenmapvalue uint64
|
||
|
for shift := uint(0); ; shift += 7 {
|
||
|
if shift >= 64 {
|
||
|
return ErrIntOverflowMap
|
||
|
}
|
||
|
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 ErrInvalidLengthMap
|
||
|
}
|
||
|
postStringIndexmapvalue := iNdEx + intStringLenmapvalue
|
||
|
if postStringIndexmapvalue > l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
|
||
|
iNdEx = postStringIndexmapvalue
|
||
|
}
|
||
|
}
|
||
|
m.StrStr[mapkey] = mapvalue
|
||
|
iNdEx = postIndex
|
||
|
default:
|
||
|
iNdEx = preIndex
|
||
|
skippy, err := skipMap(dAtA[iNdEx:])
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
if skippy < 0 {
|
||
|
return ErrInvalidLengthMap
|
||
|
}
|
||
|
if (iNdEx + skippy) > l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
iNdEx += skippy
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if iNdEx > l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
return nil
|
||
|
}
|
||
|
func skipMap(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, ErrIntOverflowMap
|
||
|
}
|
||
|
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, ErrIntOverflowMap
|
||
|
}
|
||
|
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, ErrIntOverflowMap
|
||
|
}
|
||
|
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, ErrInvalidLengthMap
|
||
|
}
|
||
|
return iNdEx, nil
|
||
|
case 3:
|
||
|
for {
|
||
|
var innerWire uint64
|
||
|
var start int = iNdEx
|
||
|
for shift := uint(0); ; shift += 7 {
|
||
|
if shift >= 64 {
|
||
|
return 0, ErrIntOverflowMap
|
||
|
}
|
||
|
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 := skipMap(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 (
|
||
|
ErrInvalidLengthMap = fmt.Errorf("proto: negative length found during unmarshaling")
|
||
|
ErrIntOverflowMap = fmt.Errorf("proto: integer overflow")
|
||
|
)
|
||
|
|
||
|
func init() { proto.RegisterFile("map.proto", fileDescriptorMap) }
|
||
|
|
||
|
var fileDescriptorMap = []byte{
|
||
|
// 161 bytes of a gzipped FileDescriptorProto
|
||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcc, 0x4d, 0x2c, 0xd0,
|
||
|
0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xce, 0x4d, 0x2c, 0x48, 0x49, 0x4d, 0x4b, 0x2c, 0xcd,
|
||
|
0x29, 0x29, 0x56, 0xaa, 0xe7, 0x62, 0xf7, 0x4d, 0x2c, 0x08, 0x49, 0x2d, 0x2e, 0x11, 0xb2, 0xe4,
|
||
|
0x62, 0x2f, 0x2e, 0x29, 0x8a, 0x2f, 0x2e, 0x29, 0x92, 0x60, 0x54, 0x60, 0xd6, 0xe0, 0x36, 0x52,
|
||
|
0xd0, 0x43, 0x52, 0xa9, 0x07, 0x55, 0xa6, 0x17, 0x5c, 0x52, 0x14, 0x5c, 0x52, 0xe4, 0x9a, 0x57,
|
||
|
0x52, 0x54, 0x19, 0xc4, 0x56, 0x0c, 0xe6, 0x48, 0x59, 0x72, 0x71, 0x23, 0x09, 0x0b, 0x09, 0x70,
|
||
|
0x31, 0x67, 0xa7, 0x56, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x81, 0x98, 0x42, 0x22, 0x5c,
|
||
|
0xac, 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x12, 0x4c, 0x60, 0x31, 0x08, 0xc7, 0x8a, 0xc9, 0x82, 0xd1,
|
||
|
0x89, 0xe7, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x4c, 0x62,
|
||
|
0x03, 0x3b, 0xd1, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x38, 0xe5, 0x24, 0x74, 0xaf, 0x00, 0x00,
|
||
|
0x00,
|
||
|
}
|