github.com/pachyderm/pachyderm@v1.13.4/src/client/admin/v1_7/hashtree/hashtree.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: client/admin/v1_7/hashtree/hashtree.proto 3 4 package hashtree 5 6 import ( 7 fmt "fmt" 8 proto "github.com/gogo/protobuf/proto" 9 pfs "github.com/pachyderm/pachyderm/src/client/admin/v1_7/pfs" 10 io "io" 11 math "math" 12 math_bits "math/bits" 13 ) 14 15 // Reference imports to suppress errors if they are not otherwise used. 16 var _ = proto.Marshal 17 var _ = fmt.Errorf 18 var _ = math.Inf 19 20 // This is a compile-time assertion to ensure that this generated file 21 // is compatible with the proto package it is being compiled against. 22 // A compilation error at this line likely means your copy of the 23 // proto package needs to be updated. 24 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 25 26 // FileNodeProto is a node corresponding to a file (which is also a leaf node). 27 type FileNodeProto struct { 28 // Object references an object in the object store which contains the content 29 // of the data. 30 Objects []*pfs.Object `protobuf:"bytes,4,rep,name=objects,proto3" json:"objects,omitempty"` 31 XXX_NoUnkeyedLiteral struct{} `json:"-"` 32 XXX_unrecognized []byte `json:"-"` 33 XXX_sizecache int32 `json:"-"` 34 } 35 36 func (m *FileNodeProto) Reset() { *m = FileNodeProto{} } 37 func (m *FileNodeProto) String() string { return proto.CompactTextString(m) } 38 func (*FileNodeProto) ProtoMessage() {} 39 func (*FileNodeProto) Descriptor() ([]byte, []int) { 40 return fileDescriptor_87122eeb83919439, []int{0} 41 } 42 func (m *FileNodeProto) XXX_Unmarshal(b []byte) error { 43 return m.Unmarshal(b) 44 } 45 func (m *FileNodeProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 46 if deterministic { 47 return xxx_messageInfo_FileNodeProto.Marshal(b, m, deterministic) 48 } else { 49 b = b[:cap(b)] 50 n, err := m.MarshalToSizedBuffer(b) 51 if err != nil { 52 return nil, err 53 } 54 return b[:n], nil 55 } 56 } 57 func (m *FileNodeProto) XXX_Merge(src proto.Message) { 58 xxx_messageInfo_FileNodeProto.Merge(m, src) 59 } 60 func (m *FileNodeProto) XXX_Size() int { 61 return m.Size() 62 } 63 func (m *FileNodeProto) XXX_DiscardUnknown() { 64 xxx_messageInfo_FileNodeProto.DiscardUnknown(m) 65 } 66 67 var xxx_messageInfo_FileNodeProto proto.InternalMessageInfo 68 69 func (m *FileNodeProto) GetObjects() []*pfs.Object { 70 if m != nil { 71 return m.Objects 72 } 73 return nil 74 } 75 76 // DirectoryNodeProto is a node corresponding to a directory. 77 type DirectoryNodeProto struct { 78 // Children of this directory. Note that paths are relative, so if "/foo/bar" 79 // has a child "baz", that means that there is a file at "/foo/bar/baz". 80 // 81 // 'Children' is ordered alphabetically, to quickly check if a new file is 82 // overwriting an existing one. 83 Children []string `protobuf:"bytes,3,rep,name=children,proto3" json:"children,omitempty"` 84 Header *pfs.Object `protobuf:"bytes,4,opt,name=header,proto3" json:"header,omitempty"` 85 Footer *pfs.Object `protobuf:"bytes,5,opt,name=footer,proto3" json:"footer,omitempty"` 86 XXX_NoUnkeyedLiteral struct{} `json:"-"` 87 XXX_unrecognized []byte `json:"-"` 88 XXX_sizecache int32 `json:"-"` 89 } 90 91 func (m *DirectoryNodeProto) Reset() { *m = DirectoryNodeProto{} } 92 func (m *DirectoryNodeProto) String() string { return proto.CompactTextString(m) } 93 func (*DirectoryNodeProto) ProtoMessage() {} 94 func (*DirectoryNodeProto) Descriptor() ([]byte, []int) { 95 return fileDescriptor_87122eeb83919439, []int{1} 96 } 97 func (m *DirectoryNodeProto) XXX_Unmarshal(b []byte) error { 98 return m.Unmarshal(b) 99 } 100 func (m *DirectoryNodeProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 101 if deterministic { 102 return xxx_messageInfo_DirectoryNodeProto.Marshal(b, m, deterministic) 103 } else { 104 b = b[:cap(b)] 105 n, err := m.MarshalToSizedBuffer(b) 106 if err != nil { 107 return nil, err 108 } 109 return b[:n], nil 110 } 111 } 112 func (m *DirectoryNodeProto) XXX_Merge(src proto.Message) { 113 xxx_messageInfo_DirectoryNodeProto.Merge(m, src) 114 } 115 func (m *DirectoryNodeProto) XXX_Size() int { 116 return m.Size() 117 } 118 func (m *DirectoryNodeProto) XXX_DiscardUnknown() { 119 xxx_messageInfo_DirectoryNodeProto.DiscardUnknown(m) 120 } 121 122 var xxx_messageInfo_DirectoryNodeProto proto.InternalMessageInfo 123 124 func (m *DirectoryNodeProto) GetChildren() []string { 125 if m != nil { 126 return m.Children 127 } 128 return nil 129 } 130 131 func (m *DirectoryNodeProto) GetHeader() *pfs.Object { 132 if m != nil { 133 return m.Header 134 } 135 return nil 136 } 137 138 func (m *DirectoryNodeProto) GetFooter() *pfs.Object { 139 if m != nil { 140 return m.Footer 141 } 142 return nil 143 } 144 145 // NodeProto is a node in the file tree (either a file or a directory) 146 type NodeProto struct { 147 // Name is the name (not path) of the file/directory (e.g. /lib). 148 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 149 // Hash is a hash of the node's name and contents (which includes the 150 // BlockRefs of a file and the Children of a directory). This can be used to 151 // detect if the name or contents have changed between versions. 152 Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` 153 // subtree_size is the of the subtree under node; i.e. if this is a directory, 154 // subtree_size includes all children. 155 SubtreeSize int64 `protobuf:"varint,3,opt,name=subtree_size,json=subtreeSize,proto3" json:"subtree_size,omitempty"` 156 // Exactly one of the following fields must be set. The type of this node will 157 // be determined by which field is set. 158 FileNode *FileNodeProto `protobuf:"bytes,4,opt,name=file_node,json=fileNode,proto3" json:"file_node,omitempty"` 159 DirNode *DirectoryNodeProto `protobuf:"bytes,5,opt,name=dir_node,json=dirNode,proto3" json:"dir_node,omitempty"` 160 XXX_NoUnkeyedLiteral struct{} `json:"-"` 161 XXX_unrecognized []byte `json:"-"` 162 XXX_sizecache int32 `json:"-"` 163 } 164 165 func (m *NodeProto) Reset() { *m = NodeProto{} } 166 func (m *NodeProto) String() string { return proto.CompactTextString(m) } 167 func (*NodeProto) ProtoMessage() {} 168 func (*NodeProto) Descriptor() ([]byte, []int) { 169 return fileDescriptor_87122eeb83919439, []int{2} 170 } 171 func (m *NodeProto) XXX_Unmarshal(b []byte) error { 172 return m.Unmarshal(b) 173 } 174 func (m *NodeProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 175 if deterministic { 176 return xxx_messageInfo_NodeProto.Marshal(b, m, deterministic) 177 } else { 178 b = b[:cap(b)] 179 n, err := m.MarshalToSizedBuffer(b) 180 if err != nil { 181 return nil, err 182 } 183 return b[:n], nil 184 } 185 } 186 func (m *NodeProto) XXX_Merge(src proto.Message) { 187 xxx_messageInfo_NodeProto.Merge(m, src) 188 } 189 func (m *NodeProto) XXX_Size() int { 190 return m.Size() 191 } 192 func (m *NodeProto) XXX_DiscardUnknown() { 193 xxx_messageInfo_NodeProto.DiscardUnknown(m) 194 } 195 196 var xxx_messageInfo_NodeProto proto.InternalMessageInfo 197 198 func (m *NodeProto) GetName() string { 199 if m != nil { 200 return m.Name 201 } 202 return "" 203 } 204 205 func (m *NodeProto) GetHash() []byte { 206 if m != nil { 207 return m.Hash 208 } 209 return nil 210 } 211 212 func (m *NodeProto) GetSubtreeSize() int64 { 213 if m != nil { 214 return m.SubtreeSize 215 } 216 return 0 217 } 218 219 func (m *NodeProto) GetFileNode() *FileNodeProto { 220 if m != nil { 221 return m.FileNode 222 } 223 return nil 224 } 225 226 func (m *NodeProto) GetDirNode() *DirectoryNodeProto { 227 if m != nil { 228 return m.DirNode 229 } 230 return nil 231 } 232 233 // HashTreeProto is a tree corresponding to the complete file contents of a 234 // pachyderm repo at a given commit (based on a Merkle Tree). We store one 235 // HashTree for every PFS commit. 236 type HashTreeProto struct { 237 // Version is an arbitrary version number, set by the corresponding library 238 // in hashtree.go. This ensures that if the hash function used to create 239 // these trees is changed, we won't run into errors when deserializing old 240 // trees. The current version is 1. 241 Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` 242 // Fs maps each node's path to the NodeProto with that node's details. 243 // See "Potential Optimizations" at the end for a compression scheme that 244 // could be useful if this map gets too large. 245 // 246 // Note that the key must end in "/" if an only if the value has .dir_node set 247 // (i.e. iff the path points to a directory). 248 Fs map[string]*NodeProto `protobuf:"bytes,2,rep,name=fs,proto3" json:"fs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 249 XXX_NoUnkeyedLiteral struct{} `json:"-"` 250 XXX_unrecognized []byte `json:"-"` 251 XXX_sizecache int32 `json:"-"` 252 } 253 254 func (m *HashTreeProto) Reset() { *m = HashTreeProto{} } 255 func (m *HashTreeProto) String() string { return proto.CompactTextString(m) } 256 func (*HashTreeProto) ProtoMessage() {} 257 func (*HashTreeProto) Descriptor() ([]byte, []int) { 258 return fileDescriptor_87122eeb83919439, []int{3} 259 } 260 func (m *HashTreeProto) XXX_Unmarshal(b []byte) error { 261 return m.Unmarshal(b) 262 } 263 func (m *HashTreeProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 264 if deterministic { 265 return xxx_messageInfo_HashTreeProto.Marshal(b, m, deterministic) 266 } else { 267 b = b[:cap(b)] 268 n, err := m.MarshalToSizedBuffer(b) 269 if err != nil { 270 return nil, err 271 } 272 return b[:n], nil 273 } 274 } 275 func (m *HashTreeProto) XXX_Merge(src proto.Message) { 276 xxx_messageInfo_HashTreeProto.Merge(m, src) 277 } 278 func (m *HashTreeProto) XXX_Size() int { 279 return m.Size() 280 } 281 func (m *HashTreeProto) XXX_DiscardUnknown() { 282 xxx_messageInfo_HashTreeProto.DiscardUnknown(m) 283 } 284 285 var xxx_messageInfo_HashTreeProto proto.InternalMessageInfo 286 287 func (m *HashTreeProto) GetVersion() int32 { 288 if m != nil { 289 return m.Version 290 } 291 return 0 292 } 293 294 func (m *HashTreeProto) GetFs() map[string]*NodeProto { 295 if m != nil { 296 return m.Fs 297 } 298 return nil 299 } 300 301 func init() { 302 proto.RegisterType((*FileNodeProto)(nil), "hashtree_1_7.FileNodeProto") 303 proto.RegisterType((*DirectoryNodeProto)(nil), "hashtree_1_7.DirectoryNodeProto") 304 proto.RegisterType((*NodeProto)(nil), "hashtree_1_7.NodeProto") 305 proto.RegisterType((*HashTreeProto)(nil), "hashtree_1_7.HashTreeProto") 306 proto.RegisterMapType((map[string]*NodeProto)(nil), "hashtree_1_7.HashTreeProto.FsEntry") 307 } 308 309 func init() { 310 proto.RegisterFile("client/admin/v1_7/hashtree/hashtree.proto", fileDescriptor_87122eeb83919439) 311 } 312 313 var fileDescriptor_87122eeb83919439 = []byte{ 314 // 437 bytes of a gzipped FileDescriptorProto 315 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xc1, 0x6e, 0xd3, 0x40, 316 0x10, 0xd5, 0xda, 0x49, 0x93, 0x4c, 0x52, 0x81, 0xf6, 0xc2, 0x2a, 0x48, 0xc1, 0x84, 0x03, 0xee, 317 0x01, 0x5b, 0x6d, 0x0f, 0xad, 0x8a, 0xb8, 0x20, 0xa8, 0x90, 0x90, 0x0a, 0x5a, 0x38, 0x71, 0x89, 318 0x1c, 0xef, 0x18, 0x2f, 0x38, 0xde, 0x68, 0x77, 0x13, 0x29, 0x3d, 0xf2, 0x41, 0x7c, 0x07, 0x17, 319 0x24, 0x3e, 0x01, 0xe5, 0x4b, 0x90, 0xd7, 0x4e, 0x53, 0xab, 0xf4, 0x60, 0xe9, 0xbd, 0x99, 0x79, 320 0x6f, 0x67, 0x9f, 0x17, 0x8e, 0xd2, 0x42, 0x62, 0x69, 0xe3, 0x44, 0x2c, 0x64, 0x19, 0xaf, 0x8f, 321 0x67, 0x67, 0x71, 0x9e, 0x98, 0xdc, 0x6a, 0xc4, 0x1b, 0x10, 0x2d, 0xb5, 0xb2, 0x8a, 0x8e, 0x76, 322 0x7c, 0x76, 0x3c, 0x3b, 0x1b, 0x3f, 0xb9, 0x2b, 0x5c, 0x66, 0xa6, 0xfa, 0xea, 0xf1, 0xe9, 0x05, 323 0x1c, 0x5e, 0xca, 0x02, 0xaf, 0x94, 0xc0, 0x8f, 0x4e, 0x7f, 0x04, 0x3d, 0x35, 0xff, 0x86, 0xa9, 324 0x35, 0xac, 0x13, 0xf8, 0xe1, 0xf0, 0xe4, 0x41, 0xb4, 0xcc, 0x4c, 0x65, 0x16, 0x7d, 0x70, 0x75, 325 0xbe, 0xeb, 0x4f, 0x7f, 0x10, 0xa0, 0x6f, 0xa4, 0xc6, 0xd4, 0x2a, 0xbd, 0xd9, 0x3b, 0x8c, 0xa1, 326 0x9f, 0xe6, 0xb2, 0x10, 0x1a, 0x4b, 0xe6, 0x07, 0x7e, 0x38, 0xe0, 0x37, 0x9c, 0x3e, 0x87, 0x83, 327 0x1c, 0x13, 0x81, 0x9a, 0x75, 0x02, 0xf2, 0x3f, 0xf3, 0xa6, 0x5d, 0x0d, 0x66, 0x4a, 0x59, 0xd4, 328 0xac, 0x7b, 0xcf, 0x60, 0xdd, 0x9e, 0xfe, 0x26, 0x30, 0xd8, 0x9f, 0x4d, 0xa1, 0x53, 0x26, 0x0b, 329 0x64, 0x24, 0x20, 0xe1, 0x80, 0x3b, 0x5c, 0xd5, 0xaa, 0x4c, 0x98, 0x17, 0x90, 0x70, 0xc4, 0x1d, 330 0xa6, 0x4f, 0x61, 0x64, 0x56, 0x73, 0x17, 0x93, 0x91, 0xd7, 0xc8, 0xfc, 0x80, 0x84, 0x3e, 0x1f, 331 0x36, 0xb5, 0x4f, 0xf2, 0x1a, 0xe9, 0x39, 0x0c, 0x32, 0x59, 0xe0, 0xac, 0x54, 0x02, 0x9b, 0x6d, 332 0x1f, 0x47, 0xb7, 0xc3, 0x8d, 0x5a, 0xc1, 0xf1, 0x7e, 0xd6, 0x50, 0xfa, 0x12, 0xfa, 0x42, 0xea, 333 0x5a, 0x58, 0x6f, 0x1f, 0xb4, 0x85, 0x77, 0x43, 0xe3, 0x3d, 0x21, 0x75, 0xc5, 0xa6, 0x3f, 0x09, 334 0x1c, 0xbe, 0x4b, 0x4c, 0xfe, 0x59, 0x63, 0x73, 0x27, 0x06, 0xbd, 0x35, 0x6a, 0x23, 0x55, 0xe9, 335 0xae, 0xd5, 0xe5, 0x3b, 0x4a, 0x4f, 0xc1, 0xcb, 0x0c, 0xf3, 0xdc, 0x6f, 0x7a, 0xd6, 0x3e, 0xa2, 336 0x65, 0x11, 0x5d, 0x9a, 0xb7, 0xa5, 0xd5, 0x1b, 0xee, 0x65, 0x66, 0x7c, 0x05, 0xbd, 0x86, 0xd2, 337 0x87, 0xe0, 0x7f, 0xc7, 0x4d, 0x13, 0x56, 0x05, 0xe9, 0x0b, 0xe8, 0xae, 0x93, 0x62, 0x85, 0x2e, 338 0xac, 0xe1, 0xc9, 0xa3, 0xb6, 0xe9, 0x7e, 0xdd, 0x7a, 0xea, 0xc2, 0x3b, 0x27, 0xaf, 0xdf, 0xff, 339 0xda, 0x4e, 0xc8, 0x9f, 0xed, 0x84, 0xfc, 0xdd, 0x4e, 0xc8, 0x97, 0x57, 0x5f, 0xa5, 0xcd, 0x57, 340 0xf3, 0x28, 0x55, 0x8b, 0x78, 0x99, 0xa4, 0xf9, 0x46, 0xa0, 0xbe, 0x8d, 0x8c, 0x4e, 0xe3, 0xfb, 341 0x1f, 0xf3, 0xfc, 0xc0, 0xbd, 0xca, 0xd3, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x8d, 0x3c, 342 0x5e, 0xf1, 0x02, 0x00, 0x00, 343 } 344 345 func (m *FileNodeProto) Marshal() (dAtA []byte, err error) { 346 size := m.Size() 347 dAtA = make([]byte, size) 348 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 349 if err != nil { 350 return nil, err 351 } 352 return dAtA[:n], nil 353 } 354 355 func (m *FileNodeProto) MarshalTo(dAtA []byte) (int, error) { 356 size := m.Size() 357 return m.MarshalToSizedBuffer(dAtA[:size]) 358 } 359 360 func (m *FileNodeProto) MarshalToSizedBuffer(dAtA []byte) (int, error) { 361 i := len(dAtA) 362 _ = i 363 var l int 364 _ = l 365 if m.XXX_unrecognized != nil { 366 i -= len(m.XXX_unrecognized) 367 copy(dAtA[i:], m.XXX_unrecognized) 368 } 369 if len(m.Objects) > 0 { 370 for iNdEx := len(m.Objects) - 1; iNdEx >= 0; iNdEx-- { 371 { 372 size, err := m.Objects[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 373 if err != nil { 374 return 0, err 375 } 376 i -= size 377 i = encodeVarintHashtree(dAtA, i, uint64(size)) 378 } 379 i-- 380 dAtA[i] = 0x22 381 } 382 } 383 return len(dAtA) - i, nil 384 } 385 386 func (m *DirectoryNodeProto) Marshal() (dAtA []byte, err error) { 387 size := m.Size() 388 dAtA = make([]byte, size) 389 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 390 if err != nil { 391 return nil, err 392 } 393 return dAtA[:n], nil 394 } 395 396 func (m *DirectoryNodeProto) MarshalTo(dAtA []byte) (int, error) { 397 size := m.Size() 398 return m.MarshalToSizedBuffer(dAtA[:size]) 399 } 400 401 func (m *DirectoryNodeProto) MarshalToSizedBuffer(dAtA []byte) (int, error) { 402 i := len(dAtA) 403 _ = i 404 var l int 405 _ = l 406 if m.XXX_unrecognized != nil { 407 i -= len(m.XXX_unrecognized) 408 copy(dAtA[i:], m.XXX_unrecognized) 409 } 410 if m.Footer != nil { 411 { 412 size, err := m.Footer.MarshalToSizedBuffer(dAtA[:i]) 413 if err != nil { 414 return 0, err 415 } 416 i -= size 417 i = encodeVarintHashtree(dAtA, i, uint64(size)) 418 } 419 i-- 420 dAtA[i] = 0x2a 421 } 422 if m.Header != nil { 423 { 424 size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) 425 if err != nil { 426 return 0, err 427 } 428 i -= size 429 i = encodeVarintHashtree(dAtA, i, uint64(size)) 430 } 431 i-- 432 dAtA[i] = 0x22 433 } 434 if len(m.Children) > 0 { 435 for iNdEx := len(m.Children) - 1; iNdEx >= 0; iNdEx-- { 436 i -= len(m.Children[iNdEx]) 437 copy(dAtA[i:], m.Children[iNdEx]) 438 i = encodeVarintHashtree(dAtA, i, uint64(len(m.Children[iNdEx]))) 439 i-- 440 dAtA[i] = 0x1a 441 } 442 } 443 return len(dAtA) - i, nil 444 } 445 446 func (m *NodeProto) Marshal() (dAtA []byte, err error) { 447 size := m.Size() 448 dAtA = make([]byte, size) 449 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 450 if err != nil { 451 return nil, err 452 } 453 return dAtA[:n], nil 454 } 455 456 func (m *NodeProto) MarshalTo(dAtA []byte) (int, error) { 457 size := m.Size() 458 return m.MarshalToSizedBuffer(dAtA[:size]) 459 } 460 461 func (m *NodeProto) MarshalToSizedBuffer(dAtA []byte) (int, error) { 462 i := len(dAtA) 463 _ = i 464 var l int 465 _ = l 466 if m.XXX_unrecognized != nil { 467 i -= len(m.XXX_unrecognized) 468 copy(dAtA[i:], m.XXX_unrecognized) 469 } 470 if m.DirNode != nil { 471 { 472 size, err := m.DirNode.MarshalToSizedBuffer(dAtA[:i]) 473 if err != nil { 474 return 0, err 475 } 476 i -= size 477 i = encodeVarintHashtree(dAtA, i, uint64(size)) 478 } 479 i-- 480 dAtA[i] = 0x2a 481 } 482 if m.FileNode != nil { 483 { 484 size, err := m.FileNode.MarshalToSizedBuffer(dAtA[:i]) 485 if err != nil { 486 return 0, err 487 } 488 i -= size 489 i = encodeVarintHashtree(dAtA, i, uint64(size)) 490 } 491 i-- 492 dAtA[i] = 0x22 493 } 494 if m.SubtreeSize != 0 { 495 i = encodeVarintHashtree(dAtA, i, uint64(m.SubtreeSize)) 496 i-- 497 dAtA[i] = 0x18 498 } 499 if len(m.Hash) > 0 { 500 i -= len(m.Hash) 501 copy(dAtA[i:], m.Hash) 502 i = encodeVarintHashtree(dAtA, i, uint64(len(m.Hash))) 503 i-- 504 dAtA[i] = 0x12 505 } 506 if len(m.Name) > 0 { 507 i -= len(m.Name) 508 copy(dAtA[i:], m.Name) 509 i = encodeVarintHashtree(dAtA, i, uint64(len(m.Name))) 510 i-- 511 dAtA[i] = 0xa 512 } 513 return len(dAtA) - i, nil 514 } 515 516 func (m *HashTreeProto) Marshal() (dAtA []byte, err error) { 517 size := m.Size() 518 dAtA = make([]byte, size) 519 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 520 if err != nil { 521 return nil, err 522 } 523 return dAtA[:n], nil 524 } 525 526 func (m *HashTreeProto) MarshalTo(dAtA []byte) (int, error) { 527 size := m.Size() 528 return m.MarshalToSizedBuffer(dAtA[:size]) 529 } 530 531 func (m *HashTreeProto) MarshalToSizedBuffer(dAtA []byte) (int, error) { 532 i := len(dAtA) 533 _ = i 534 var l int 535 _ = l 536 if m.XXX_unrecognized != nil { 537 i -= len(m.XXX_unrecognized) 538 copy(dAtA[i:], m.XXX_unrecognized) 539 } 540 if len(m.Fs) > 0 { 541 for k := range m.Fs { 542 v := m.Fs[k] 543 baseI := i 544 if v != nil { 545 { 546 size, err := v.MarshalToSizedBuffer(dAtA[:i]) 547 if err != nil { 548 return 0, err 549 } 550 i -= size 551 i = encodeVarintHashtree(dAtA, i, uint64(size)) 552 } 553 i-- 554 dAtA[i] = 0x12 555 } 556 i -= len(k) 557 copy(dAtA[i:], k) 558 i = encodeVarintHashtree(dAtA, i, uint64(len(k))) 559 i-- 560 dAtA[i] = 0xa 561 i = encodeVarintHashtree(dAtA, i, uint64(baseI-i)) 562 i-- 563 dAtA[i] = 0x12 564 } 565 } 566 if m.Version != 0 { 567 i = encodeVarintHashtree(dAtA, i, uint64(m.Version)) 568 i-- 569 dAtA[i] = 0x8 570 } 571 return len(dAtA) - i, nil 572 } 573 574 func encodeVarintHashtree(dAtA []byte, offset int, v uint64) int { 575 offset -= sovHashtree(v) 576 base := offset 577 for v >= 1<<7 { 578 dAtA[offset] = uint8(v&0x7f | 0x80) 579 v >>= 7 580 offset++ 581 } 582 dAtA[offset] = uint8(v) 583 return base 584 } 585 func (m *FileNodeProto) Size() (n int) { 586 if m == nil { 587 return 0 588 } 589 var l int 590 _ = l 591 if len(m.Objects) > 0 { 592 for _, e := range m.Objects { 593 l = e.Size() 594 n += 1 + l + sovHashtree(uint64(l)) 595 } 596 } 597 if m.XXX_unrecognized != nil { 598 n += len(m.XXX_unrecognized) 599 } 600 return n 601 } 602 603 func (m *DirectoryNodeProto) Size() (n int) { 604 if m == nil { 605 return 0 606 } 607 var l int 608 _ = l 609 if len(m.Children) > 0 { 610 for _, s := range m.Children { 611 l = len(s) 612 n += 1 + l + sovHashtree(uint64(l)) 613 } 614 } 615 if m.Header != nil { 616 l = m.Header.Size() 617 n += 1 + l + sovHashtree(uint64(l)) 618 } 619 if m.Footer != nil { 620 l = m.Footer.Size() 621 n += 1 + l + sovHashtree(uint64(l)) 622 } 623 if m.XXX_unrecognized != nil { 624 n += len(m.XXX_unrecognized) 625 } 626 return n 627 } 628 629 func (m *NodeProto) Size() (n int) { 630 if m == nil { 631 return 0 632 } 633 var l int 634 _ = l 635 l = len(m.Name) 636 if l > 0 { 637 n += 1 + l + sovHashtree(uint64(l)) 638 } 639 l = len(m.Hash) 640 if l > 0 { 641 n += 1 + l + sovHashtree(uint64(l)) 642 } 643 if m.SubtreeSize != 0 { 644 n += 1 + sovHashtree(uint64(m.SubtreeSize)) 645 } 646 if m.FileNode != nil { 647 l = m.FileNode.Size() 648 n += 1 + l + sovHashtree(uint64(l)) 649 } 650 if m.DirNode != nil { 651 l = m.DirNode.Size() 652 n += 1 + l + sovHashtree(uint64(l)) 653 } 654 if m.XXX_unrecognized != nil { 655 n += len(m.XXX_unrecognized) 656 } 657 return n 658 } 659 660 func (m *HashTreeProto) Size() (n int) { 661 if m == nil { 662 return 0 663 } 664 var l int 665 _ = l 666 if m.Version != 0 { 667 n += 1 + sovHashtree(uint64(m.Version)) 668 } 669 if len(m.Fs) > 0 { 670 for k, v := range m.Fs { 671 _ = k 672 _ = v 673 l = 0 674 if v != nil { 675 l = v.Size() 676 l += 1 + sovHashtree(uint64(l)) 677 } 678 mapEntrySize := 1 + len(k) + sovHashtree(uint64(len(k))) + l 679 n += mapEntrySize + 1 + sovHashtree(uint64(mapEntrySize)) 680 } 681 } 682 if m.XXX_unrecognized != nil { 683 n += len(m.XXX_unrecognized) 684 } 685 return n 686 } 687 688 func sovHashtree(x uint64) (n int) { 689 return (math_bits.Len64(x|1) + 6) / 7 690 } 691 func sozHashtree(x uint64) (n int) { 692 return sovHashtree(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 693 } 694 func (m *FileNodeProto) Unmarshal(dAtA []byte) error { 695 l := len(dAtA) 696 iNdEx := 0 697 for iNdEx < l { 698 preIndex := iNdEx 699 var wire uint64 700 for shift := uint(0); ; shift += 7 { 701 if shift >= 64 { 702 return ErrIntOverflowHashtree 703 } 704 if iNdEx >= l { 705 return io.ErrUnexpectedEOF 706 } 707 b := dAtA[iNdEx] 708 iNdEx++ 709 wire |= uint64(b&0x7F) << shift 710 if b < 0x80 { 711 break 712 } 713 } 714 fieldNum := int32(wire >> 3) 715 wireType := int(wire & 0x7) 716 if wireType == 4 { 717 return fmt.Errorf("proto: FileNodeProto: wiretype end group for non-group") 718 } 719 if fieldNum <= 0 { 720 return fmt.Errorf("proto: FileNodeProto: illegal tag %d (wire type %d)", fieldNum, wire) 721 } 722 switch fieldNum { 723 case 4: 724 if wireType != 2 { 725 return fmt.Errorf("proto: wrong wireType = %d for field Objects", wireType) 726 } 727 var msglen int 728 for shift := uint(0); ; shift += 7 { 729 if shift >= 64 { 730 return ErrIntOverflowHashtree 731 } 732 if iNdEx >= l { 733 return io.ErrUnexpectedEOF 734 } 735 b := dAtA[iNdEx] 736 iNdEx++ 737 msglen |= int(b&0x7F) << shift 738 if b < 0x80 { 739 break 740 } 741 } 742 if msglen < 0 { 743 return ErrInvalidLengthHashtree 744 } 745 postIndex := iNdEx + msglen 746 if postIndex < 0 { 747 return ErrInvalidLengthHashtree 748 } 749 if postIndex > l { 750 return io.ErrUnexpectedEOF 751 } 752 m.Objects = append(m.Objects, &pfs.Object{}) 753 if err := m.Objects[len(m.Objects)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 754 return err 755 } 756 iNdEx = postIndex 757 default: 758 iNdEx = preIndex 759 skippy, err := skipHashtree(dAtA[iNdEx:]) 760 if err != nil { 761 return err 762 } 763 if (skippy < 0) || (iNdEx+skippy) < 0 { 764 return ErrInvalidLengthHashtree 765 } 766 if (iNdEx + skippy) > l { 767 return io.ErrUnexpectedEOF 768 } 769 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 770 iNdEx += skippy 771 } 772 } 773 774 if iNdEx > l { 775 return io.ErrUnexpectedEOF 776 } 777 return nil 778 } 779 func (m *DirectoryNodeProto) Unmarshal(dAtA []byte) error { 780 l := len(dAtA) 781 iNdEx := 0 782 for iNdEx < l { 783 preIndex := iNdEx 784 var wire uint64 785 for shift := uint(0); ; shift += 7 { 786 if shift >= 64 { 787 return ErrIntOverflowHashtree 788 } 789 if iNdEx >= l { 790 return io.ErrUnexpectedEOF 791 } 792 b := dAtA[iNdEx] 793 iNdEx++ 794 wire |= uint64(b&0x7F) << shift 795 if b < 0x80 { 796 break 797 } 798 } 799 fieldNum := int32(wire >> 3) 800 wireType := int(wire & 0x7) 801 if wireType == 4 { 802 return fmt.Errorf("proto: DirectoryNodeProto: wiretype end group for non-group") 803 } 804 if fieldNum <= 0 { 805 return fmt.Errorf("proto: DirectoryNodeProto: illegal tag %d (wire type %d)", fieldNum, wire) 806 } 807 switch fieldNum { 808 case 3: 809 if wireType != 2 { 810 return fmt.Errorf("proto: wrong wireType = %d for field Children", wireType) 811 } 812 var stringLen uint64 813 for shift := uint(0); ; shift += 7 { 814 if shift >= 64 { 815 return ErrIntOverflowHashtree 816 } 817 if iNdEx >= l { 818 return io.ErrUnexpectedEOF 819 } 820 b := dAtA[iNdEx] 821 iNdEx++ 822 stringLen |= uint64(b&0x7F) << shift 823 if b < 0x80 { 824 break 825 } 826 } 827 intStringLen := int(stringLen) 828 if intStringLen < 0 { 829 return ErrInvalidLengthHashtree 830 } 831 postIndex := iNdEx + intStringLen 832 if postIndex < 0 { 833 return ErrInvalidLengthHashtree 834 } 835 if postIndex > l { 836 return io.ErrUnexpectedEOF 837 } 838 m.Children = append(m.Children, string(dAtA[iNdEx:postIndex])) 839 iNdEx = postIndex 840 case 4: 841 if wireType != 2 { 842 return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) 843 } 844 var msglen int 845 for shift := uint(0); ; shift += 7 { 846 if shift >= 64 { 847 return ErrIntOverflowHashtree 848 } 849 if iNdEx >= l { 850 return io.ErrUnexpectedEOF 851 } 852 b := dAtA[iNdEx] 853 iNdEx++ 854 msglen |= int(b&0x7F) << shift 855 if b < 0x80 { 856 break 857 } 858 } 859 if msglen < 0 { 860 return ErrInvalidLengthHashtree 861 } 862 postIndex := iNdEx + msglen 863 if postIndex < 0 { 864 return ErrInvalidLengthHashtree 865 } 866 if postIndex > l { 867 return io.ErrUnexpectedEOF 868 } 869 if m.Header == nil { 870 m.Header = &pfs.Object{} 871 } 872 if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 873 return err 874 } 875 iNdEx = postIndex 876 case 5: 877 if wireType != 2 { 878 return fmt.Errorf("proto: wrong wireType = %d for field Footer", wireType) 879 } 880 var msglen int 881 for shift := uint(0); ; shift += 7 { 882 if shift >= 64 { 883 return ErrIntOverflowHashtree 884 } 885 if iNdEx >= l { 886 return io.ErrUnexpectedEOF 887 } 888 b := dAtA[iNdEx] 889 iNdEx++ 890 msglen |= int(b&0x7F) << shift 891 if b < 0x80 { 892 break 893 } 894 } 895 if msglen < 0 { 896 return ErrInvalidLengthHashtree 897 } 898 postIndex := iNdEx + msglen 899 if postIndex < 0 { 900 return ErrInvalidLengthHashtree 901 } 902 if postIndex > l { 903 return io.ErrUnexpectedEOF 904 } 905 if m.Footer == nil { 906 m.Footer = &pfs.Object{} 907 } 908 if err := m.Footer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 909 return err 910 } 911 iNdEx = postIndex 912 default: 913 iNdEx = preIndex 914 skippy, err := skipHashtree(dAtA[iNdEx:]) 915 if err != nil { 916 return err 917 } 918 if (skippy < 0) || (iNdEx+skippy) < 0 { 919 return ErrInvalidLengthHashtree 920 } 921 if (iNdEx + skippy) > l { 922 return io.ErrUnexpectedEOF 923 } 924 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 925 iNdEx += skippy 926 } 927 } 928 929 if iNdEx > l { 930 return io.ErrUnexpectedEOF 931 } 932 return nil 933 } 934 func (m *NodeProto) Unmarshal(dAtA []byte) error { 935 l := len(dAtA) 936 iNdEx := 0 937 for iNdEx < l { 938 preIndex := iNdEx 939 var wire uint64 940 for shift := uint(0); ; shift += 7 { 941 if shift >= 64 { 942 return ErrIntOverflowHashtree 943 } 944 if iNdEx >= l { 945 return io.ErrUnexpectedEOF 946 } 947 b := dAtA[iNdEx] 948 iNdEx++ 949 wire |= uint64(b&0x7F) << shift 950 if b < 0x80 { 951 break 952 } 953 } 954 fieldNum := int32(wire >> 3) 955 wireType := int(wire & 0x7) 956 if wireType == 4 { 957 return fmt.Errorf("proto: NodeProto: wiretype end group for non-group") 958 } 959 if fieldNum <= 0 { 960 return fmt.Errorf("proto: NodeProto: illegal tag %d (wire type %d)", fieldNum, wire) 961 } 962 switch fieldNum { 963 case 1: 964 if wireType != 2 { 965 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 966 } 967 var stringLen uint64 968 for shift := uint(0); ; shift += 7 { 969 if shift >= 64 { 970 return ErrIntOverflowHashtree 971 } 972 if iNdEx >= l { 973 return io.ErrUnexpectedEOF 974 } 975 b := dAtA[iNdEx] 976 iNdEx++ 977 stringLen |= uint64(b&0x7F) << shift 978 if b < 0x80 { 979 break 980 } 981 } 982 intStringLen := int(stringLen) 983 if intStringLen < 0 { 984 return ErrInvalidLengthHashtree 985 } 986 postIndex := iNdEx + intStringLen 987 if postIndex < 0 { 988 return ErrInvalidLengthHashtree 989 } 990 if postIndex > l { 991 return io.ErrUnexpectedEOF 992 } 993 m.Name = string(dAtA[iNdEx:postIndex]) 994 iNdEx = postIndex 995 case 2: 996 if wireType != 2 { 997 return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) 998 } 999 var byteLen int 1000 for shift := uint(0); ; shift += 7 { 1001 if shift >= 64 { 1002 return ErrIntOverflowHashtree 1003 } 1004 if iNdEx >= l { 1005 return io.ErrUnexpectedEOF 1006 } 1007 b := dAtA[iNdEx] 1008 iNdEx++ 1009 byteLen |= int(b&0x7F) << shift 1010 if b < 0x80 { 1011 break 1012 } 1013 } 1014 if byteLen < 0 { 1015 return ErrInvalidLengthHashtree 1016 } 1017 postIndex := iNdEx + byteLen 1018 if postIndex < 0 { 1019 return ErrInvalidLengthHashtree 1020 } 1021 if postIndex > l { 1022 return io.ErrUnexpectedEOF 1023 } 1024 m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) 1025 if m.Hash == nil { 1026 m.Hash = []byte{} 1027 } 1028 iNdEx = postIndex 1029 case 3: 1030 if wireType != 0 { 1031 return fmt.Errorf("proto: wrong wireType = %d for field SubtreeSize", wireType) 1032 } 1033 m.SubtreeSize = 0 1034 for shift := uint(0); ; shift += 7 { 1035 if shift >= 64 { 1036 return ErrIntOverflowHashtree 1037 } 1038 if iNdEx >= l { 1039 return io.ErrUnexpectedEOF 1040 } 1041 b := dAtA[iNdEx] 1042 iNdEx++ 1043 m.SubtreeSize |= int64(b&0x7F) << shift 1044 if b < 0x80 { 1045 break 1046 } 1047 } 1048 case 4: 1049 if wireType != 2 { 1050 return fmt.Errorf("proto: wrong wireType = %d for field FileNode", wireType) 1051 } 1052 var msglen int 1053 for shift := uint(0); ; shift += 7 { 1054 if shift >= 64 { 1055 return ErrIntOverflowHashtree 1056 } 1057 if iNdEx >= l { 1058 return io.ErrUnexpectedEOF 1059 } 1060 b := dAtA[iNdEx] 1061 iNdEx++ 1062 msglen |= int(b&0x7F) << shift 1063 if b < 0x80 { 1064 break 1065 } 1066 } 1067 if msglen < 0 { 1068 return ErrInvalidLengthHashtree 1069 } 1070 postIndex := iNdEx + msglen 1071 if postIndex < 0 { 1072 return ErrInvalidLengthHashtree 1073 } 1074 if postIndex > l { 1075 return io.ErrUnexpectedEOF 1076 } 1077 if m.FileNode == nil { 1078 m.FileNode = &FileNodeProto{} 1079 } 1080 if err := m.FileNode.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1081 return err 1082 } 1083 iNdEx = postIndex 1084 case 5: 1085 if wireType != 2 { 1086 return fmt.Errorf("proto: wrong wireType = %d for field DirNode", wireType) 1087 } 1088 var msglen int 1089 for shift := uint(0); ; shift += 7 { 1090 if shift >= 64 { 1091 return ErrIntOverflowHashtree 1092 } 1093 if iNdEx >= l { 1094 return io.ErrUnexpectedEOF 1095 } 1096 b := dAtA[iNdEx] 1097 iNdEx++ 1098 msglen |= int(b&0x7F) << shift 1099 if b < 0x80 { 1100 break 1101 } 1102 } 1103 if msglen < 0 { 1104 return ErrInvalidLengthHashtree 1105 } 1106 postIndex := iNdEx + msglen 1107 if postIndex < 0 { 1108 return ErrInvalidLengthHashtree 1109 } 1110 if postIndex > l { 1111 return io.ErrUnexpectedEOF 1112 } 1113 if m.DirNode == nil { 1114 m.DirNode = &DirectoryNodeProto{} 1115 } 1116 if err := m.DirNode.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1117 return err 1118 } 1119 iNdEx = postIndex 1120 default: 1121 iNdEx = preIndex 1122 skippy, err := skipHashtree(dAtA[iNdEx:]) 1123 if err != nil { 1124 return err 1125 } 1126 if (skippy < 0) || (iNdEx+skippy) < 0 { 1127 return ErrInvalidLengthHashtree 1128 } 1129 if (iNdEx + skippy) > l { 1130 return io.ErrUnexpectedEOF 1131 } 1132 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1133 iNdEx += skippy 1134 } 1135 } 1136 1137 if iNdEx > l { 1138 return io.ErrUnexpectedEOF 1139 } 1140 return nil 1141 } 1142 func (m *HashTreeProto) Unmarshal(dAtA []byte) error { 1143 l := len(dAtA) 1144 iNdEx := 0 1145 for iNdEx < l { 1146 preIndex := iNdEx 1147 var wire uint64 1148 for shift := uint(0); ; shift += 7 { 1149 if shift >= 64 { 1150 return ErrIntOverflowHashtree 1151 } 1152 if iNdEx >= l { 1153 return io.ErrUnexpectedEOF 1154 } 1155 b := dAtA[iNdEx] 1156 iNdEx++ 1157 wire |= uint64(b&0x7F) << shift 1158 if b < 0x80 { 1159 break 1160 } 1161 } 1162 fieldNum := int32(wire >> 3) 1163 wireType := int(wire & 0x7) 1164 if wireType == 4 { 1165 return fmt.Errorf("proto: HashTreeProto: wiretype end group for non-group") 1166 } 1167 if fieldNum <= 0 { 1168 return fmt.Errorf("proto: HashTreeProto: illegal tag %d (wire type %d)", fieldNum, wire) 1169 } 1170 switch fieldNum { 1171 case 1: 1172 if wireType != 0 { 1173 return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) 1174 } 1175 m.Version = 0 1176 for shift := uint(0); ; shift += 7 { 1177 if shift >= 64 { 1178 return ErrIntOverflowHashtree 1179 } 1180 if iNdEx >= l { 1181 return io.ErrUnexpectedEOF 1182 } 1183 b := dAtA[iNdEx] 1184 iNdEx++ 1185 m.Version |= int32(b&0x7F) << shift 1186 if b < 0x80 { 1187 break 1188 } 1189 } 1190 case 2: 1191 if wireType != 2 { 1192 return fmt.Errorf("proto: wrong wireType = %d for field Fs", wireType) 1193 } 1194 var msglen int 1195 for shift := uint(0); ; shift += 7 { 1196 if shift >= 64 { 1197 return ErrIntOverflowHashtree 1198 } 1199 if iNdEx >= l { 1200 return io.ErrUnexpectedEOF 1201 } 1202 b := dAtA[iNdEx] 1203 iNdEx++ 1204 msglen |= int(b&0x7F) << shift 1205 if b < 0x80 { 1206 break 1207 } 1208 } 1209 if msglen < 0 { 1210 return ErrInvalidLengthHashtree 1211 } 1212 postIndex := iNdEx + msglen 1213 if postIndex < 0 { 1214 return ErrInvalidLengthHashtree 1215 } 1216 if postIndex > l { 1217 return io.ErrUnexpectedEOF 1218 } 1219 if m.Fs == nil { 1220 m.Fs = make(map[string]*NodeProto) 1221 } 1222 var mapkey string 1223 var mapvalue *NodeProto 1224 for iNdEx < postIndex { 1225 entryPreIndex := iNdEx 1226 var wire uint64 1227 for shift := uint(0); ; shift += 7 { 1228 if shift >= 64 { 1229 return ErrIntOverflowHashtree 1230 } 1231 if iNdEx >= l { 1232 return io.ErrUnexpectedEOF 1233 } 1234 b := dAtA[iNdEx] 1235 iNdEx++ 1236 wire |= uint64(b&0x7F) << shift 1237 if b < 0x80 { 1238 break 1239 } 1240 } 1241 fieldNum := int32(wire >> 3) 1242 if fieldNum == 1 { 1243 var stringLenmapkey uint64 1244 for shift := uint(0); ; shift += 7 { 1245 if shift >= 64 { 1246 return ErrIntOverflowHashtree 1247 } 1248 if iNdEx >= l { 1249 return io.ErrUnexpectedEOF 1250 } 1251 b := dAtA[iNdEx] 1252 iNdEx++ 1253 stringLenmapkey |= uint64(b&0x7F) << shift 1254 if b < 0x80 { 1255 break 1256 } 1257 } 1258 intStringLenmapkey := int(stringLenmapkey) 1259 if intStringLenmapkey < 0 { 1260 return ErrInvalidLengthHashtree 1261 } 1262 postStringIndexmapkey := iNdEx + intStringLenmapkey 1263 if postStringIndexmapkey < 0 { 1264 return ErrInvalidLengthHashtree 1265 } 1266 if postStringIndexmapkey > l { 1267 return io.ErrUnexpectedEOF 1268 } 1269 mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) 1270 iNdEx = postStringIndexmapkey 1271 } else if fieldNum == 2 { 1272 var mapmsglen int 1273 for shift := uint(0); ; shift += 7 { 1274 if shift >= 64 { 1275 return ErrIntOverflowHashtree 1276 } 1277 if iNdEx >= l { 1278 return io.ErrUnexpectedEOF 1279 } 1280 b := dAtA[iNdEx] 1281 iNdEx++ 1282 mapmsglen |= int(b&0x7F) << shift 1283 if b < 0x80 { 1284 break 1285 } 1286 } 1287 if mapmsglen < 0 { 1288 return ErrInvalidLengthHashtree 1289 } 1290 postmsgIndex := iNdEx + mapmsglen 1291 if postmsgIndex < 0 { 1292 return ErrInvalidLengthHashtree 1293 } 1294 if postmsgIndex > l { 1295 return io.ErrUnexpectedEOF 1296 } 1297 mapvalue = &NodeProto{} 1298 if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { 1299 return err 1300 } 1301 iNdEx = postmsgIndex 1302 } else { 1303 iNdEx = entryPreIndex 1304 skippy, err := skipHashtree(dAtA[iNdEx:]) 1305 if err != nil { 1306 return err 1307 } 1308 if (skippy < 0) || (iNdEx+skippy) < 0 { 1309 return ErrInvalidLengthHashtree 1310 } 1311 if (iNdEx + skippy) > postIndex { 1312 return io.ErrUnexpectedEOF 1313 } 1314 iNdEx += skippy 1315 } 1316 } 1317 m.Fs[mapkey] = mapvalue 1318 iNdEx = postIndex 1319 default: 1320 iNdEx = preIndex 1321 skippy, err := skipHashtree(dAtA[iNdEx:]) 1322 if err != nil { 1323 return err 1324 } 1325 if (skippy < 0) || (iNdEx+skippy) < 0 { 1326 return ErrInvalidLengthHashtree 1327 } 1328 if (iNdEx + skippy) > l { 1329 return io.ErrUnexpectedEOF 1330 } 1331 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1332 iNdEx += skippy 1333 } 1334 } 1335 1336 if iNdEx > l { 1337 return io.ErrUnexpectedEOF 1338 } 1339 return nil 1340 } 1341 func skipHashtree(dAtA []byte) (n int, err error) { 1342 l := len(dAtA) 1343 iNdEx := 0 1344 depth := 0 1345 for iNdEx < l { 1346 var wire uint64 1347 for shift := uint(0); ; shift += 7 { 1348 if shift >= 64 { 1349 return 0, ErrIntOverflowHashtree 1350 } 1351 if iNdEx >= l { 1352 return 0, io.ErrUnexpectedEOF 1353 } 1354 b := dAtA[iNdEx] 1355 iNdEx++ 1356 wire |= (uint64(b) & 0x7F) << shift 1357 if b < 0x80 { 1358 break 1359 } 1360 } 1361 wireType := int(wire & 0x7) 1362 switch wireType { 1363 case 0: 1364 for shift := uint(0); ; shift += 7 { 1365 if shift >= 64 { 1366 return 0, ErrIntOverflowHashtree 1367 } 1368 if iNdEx >= l { 1369 return 0, io.ErrUnexpectedEOF 1370 } 1371 iNdEx++ 1372 if dAtA[iNdEx-1] < 0x80 { 1373 break 1374 } 1375 } 1376 case 1: 1377 iNdEx += 8 1378 case 2: 1379 var length int 1380 for shift := uint(0); ; shift += 7 { 1381 if shift >= 64 { 1382 return 0, ErrIntOverflowHashtree 1383 } 1384 if iNdEx >= l { 1385 return 0, io.ErrUnexpectedEOF 1386 } 1387 b := dAtA[iNdEx] 1388 iNdEx++ 1389 length |= (int(b) & 0x7F) << shift 1390 if b < 0x80 { 1391 break 1392 } 1393 } 1394 if length < 0 { 1395 return 0, ErrInvalidLengthHashtree 1396 } 1397 iNdEx += length 1398 case 3: 1399 depth++ 1400 case 4: 1401 if depth == 0 { 1402 return 0, ErrUnexpectedEndOfGroupHashtree 1403 } 1404 depth-- 1405 case 5: 1406 iNdEx += 4 1407 default: 1408 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1409 } 1410 if iNdEx < 0 { 1411 return 0, ErrInvalidLengthHashtree 1412 } 1413 if depth == 0 { 1414 return iNdEx, nil 1415 } 1416 } 1417 return 0, io.ErrUnexpectedEOF 1418 } 1419 1420 var ( 1421 ErrInvalidLengthHashtree = fmt.Errorf("proto: negative length found during unmarshaling") 1422 ErrIntOverflowHashtree = fmt.Errorf("proto: integer overflow") 1423 ErrUnexpectedEndOfGroupHashtree = fmt.Errorf("proto: unexpected end of group") 1424 )