github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/cmn/objlist_gen.go (about)

     1  // msgp -file cmn/objlist.go -tests=false -marshal=false -unexported
     2  // Code generated by the command above where msgp is tinylib/msgp; see docs/msgp.md. DO NOT EDIT.
     3  package cmn
     4  
     5  // Code generated by github.com/tinylib/msgp DO NOT EDIT.
     6  
     7  import (
     8  	"github.com/tinylib/msgp/msgp"
     9  )
    10  
    11  // DecodeMsg implements msgp.Decodable
    12  func (z *LsoEnt) DecodeMsg(dc *msgp.Reader) (err error) {
    13  	var field []byte
    14  	_ = field
    15  	var zb0001 uint32
    16  	zb0001, err = dc.ReadMapHeader()
    17  	if err != nil {
    18  		err = msgp.WrapError(err)
    19  		return
    20  	}
    21  	for zb0001 > 0 {
    22  		zb0001--
    23  		field, err = dc.ReadMapKeyPtr()
    24  		if err != nil {
    25  			err = msgp.WrapError(err)
    26  			return
    27  		}
    28  		switch msgp.UnsafeString(field) {
    29  		case "n":
    30  			z.Name, err = dc.ReadString()
    31  			if err != nil {
    32  				err = msgp.WrapError(err, "Name")
    33  				return
    34  			}
    35  		case "cs":
    36  			z.Checksum, err = dc.ReadString()
    37  			if err != nil {
    38  				err = msgp.WrapError(err, "Checksum")
    39  				return
    40  			}
    41  		case "a":
    42  			z.Atime, err = dc.ReadString()
    43  			if err != nil {
    44  				err = msgp.WrapError(err, "Atime")
    45  				return
    46  			}
    47  		case "v":
    48  			z.Version, err = dc.ReadString()
    49  			if err != nil {
    50  				err = msgp.WrapError(err, "Version")
    51  				return
    52  			}
    53  		case "t":
    54  			z.Location, err = dc.ReadString()
    55  			if err != nil {
    56  				err = msgp.WrapError(err, "Location")
    57  				return
    58  			}
    59  		case "m":
    60  			z.Custom, err = dc.ReadString()
    61  			if err != nil {
    62  				err = msgp.WrapError(err, "Custom")
    63  				return
    64  			}
    65  		case "s":
    66  			z.Size, err = dc.ReadInt64()
    67  			if err != nil {
    68  				err = msgp.WrapError(err, "Size")
    69  				return
    70  			}
    71  		case "c":
    72  			z.Copies, err = dc.ReadInt16()
    73  			if err != nil {
    74  				err = msgp.WrapError(err, "Copies")
    75  				return
    76  			}
    77  		case "f":
    78  			z.Flags, err = dc.ReadUint16()
    79  			if err != nil {
    80  				err = msgp.WrapError(err, "Flags")
    81  				return
    82  			}
    83  		default:
    84  			err = dc.Skip()
    85  			if err != nil {
    86  				err = msgp.WrapError(err)
    87  				return
    88  			}
    89  		}
    90  	}
    91  	return
    92  }
    93  
    94  // EncodeMsg implements msgp.Encodable
    95  func (z *LsoEnt) EncodeMsg(en *msgp.Writer) (err error) {
    96  	// omitempty: check for empty values
    97  	zb0001Len := uint32(9)
    98  	var zb0001Mask uint16 /* 9 bits */
    99  	if z.Checksum == "" {
   100  		zb0001Len--
   101  		zb0001Mask |= 0x2
   102  	}
   103  	if z.Atime == "" {
   104  		zb0001Len--
   105  		zb0001Mask |= 0x4
   106  	}
   107  	if z.Version == "" {
   108  		zb0001Len--
   109  		zb0001Mask |= 0x8
   110  	}
   111  	if z.Location == "" {
   112  		zb0001Len--
   113  		zb0001Mask |= 0x10
   114  	}
   115  	if z.Custom == "" {
   116  		zb0001Len--
   117  		zb0001Mask |= 0x20
   118  	}
   119  	if z.Size == 0 {
   120  		zb0001Len--
   121  		zb0001Mask |= 0x40
   122  	}
   123  	if z.Copies == 0 {
   124  		zb0001Len--
   125  		zb0001Mask |= 0x80
   126  	}
   127  	if z.Flags == 0 {
   128  		zb0001Len--
   129  		zb0001Mask |= 0x100
   130  	}
   131  	// variable map header, size zb0001Len
   132  	err = en.Append(0x80 | uint8(zb0001Len))
   133  	if err != nil {
   134  		return
   135  	}
   136  	if zb0001Len == 0 {
   137  		return
   138  	}
   139  	// write "n"
   140  	err = en.Append(0xa1, 0x6e)
   141  	if err != nil {
   142  		return
   143  	}
   144  	err = en.WriteString(z.Name)
   145  	if err != nil {
   146  		err = msgp.WrapError(err, "Name")
   147  		return
   148  	}
   149  	if (zb0001Mask & 0x2) == 0 { // if not empty
   150  		// write "cs"
   151  		err = en.Append(0xa2, 0x63, 0x73)
   152  		if err != nil {
   153  			return
   154  		}
   155  		err = en.WriteString(z.Checksum)
   156  		if err != nil {
   157  			err = msgp.WrapError(err, "Checksum")
   158  			return
   159  		}
   160  	}
   161  	if (zb0001Mask & 0x4) == 0 { // if not empty
   162  		// write "a"
   163  		err = en.Append(0xa1, 0x61)
   164  		if err != nil {
   165  			return
   166  		}
   167  		err = en.WriteString(z.Atime)
   168  		if err != nil {
   169  			err = msgp.WrapError(err, "Atime")
   170  			return
   171  		}
   172  	}
   173  	if (zb0001Mask & 0x8) == 0 { // if not empty
   174  		// write "v"
   175  		err = en.Append(0xa1, 0x76)
   176  		if err != nil {
   177  			return
   178  		}
   179  		err = en.WriteString(z.Version)
   180  		if err != nil {
   181  			err = msgp.WrapError(err, "Version")
   182  			return
   183  		}
   184  	}
   185  	if (zb0001Mask & 0x10) == 0 { // if not empty
   186  		// write "t"
   187  		err = en.Append(0xa1, 0x74)
   188  		if err != nil {
   189  			return
   190  		}
   191  		err = en.WriteString(z.Location)
   192  		if err != nil {
   193  			err = msgp.WrapError(err, "Location")
   194  			return
   195  		}
   196  	}
   197  	if (zb0001Mask & 0x20) == 0 { // if not empty
   198  		// write "m"
   199  		err = en.Append(0xa1, 0x6d)
   200  		if err != nil {
   201  			return
   202  		}
   203  		err = en.WriteString(z.Custom)
   204  		if err != nil {
   205  			err = msgp.WrapError(err, "Custom")
   206  			return
   207  		}
   208  	}
   209  	if (zb0001Mask & 0x40) == 0 { // if not empty
   210  		// write "s"
   211  		err = en.Append(0xa1, 0x73)
   212  		if err != nil {
   213  			return
   214  		}
   215  		err = en.WriteInt64(z.Size)
   216  		if err != nil {
   217  			err = msgp.WrapError(err, "Size")
   218  			return
   219  		}
   220  	}
   221  	if (zb0001Mask & 0x80) == 0 { // if not empty
   222  		// write "c"
   223  		err = en.Append(0xa1, 0x63)
   224  		if err != nil {
   225  			return
   226  		}
   227  		err = en.WriteInt16(z.Copies)
   228  		if err != nil {
   229  			err = msgp.WrapError(err, "Copies")
   230  			return
   231  		}
   232  	}
   233  	if (zb0001Mask & 0x100) == 0 { // if not empty
   234  		// write "f"
   235  		err = en.Append(0xa1, 0x66)
   236  		if err != nil {
   237  			return
   238  		}
   239  		err = en.WriteUint16(z.Flags)
   240  		if err != nil {
   241  			err = msgp.WrapError(err, "Flags")
   242  			return
   243  		}
   244  	}
   245  	return
   246  }
   247  
   248  // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
   249  func (z *LsoEnt) Msgsize() (s int) {
   250  	s = 1 + 2 + msgp.StringPrefixSize + len(z.Name) + 3 + msgp.StringPrefixSize + len(z.Checksum) + 2 + msgp.StringPrefixSize + len(z.Atime) + 2 + msgp.StringPrefixSize + len(z.Version) + 2 + msgp.StringPrefixSize + len(z.Location) + 2 + msgp.StringPrefixSize + len(z.Custom) + 2 + msgp.Int64Size + 2 + msgp.Int16Size + 2 + msgp.Uint16Size
   251  	return
   252  }
   253  
   254  // DecodeMsg implements msgp.Decodable
   255  func (z *LsoEntries) DecodeMsg(dc *msgp.Reader) (err error) {
   256  	var zb0002 uint32
   257  	zb0002, err = dc.ReadArrayHeader()
   258  	if err != nil {
   259  		err = msgp.WrapError(err)
   260  		return
   261  	}
   262  	if cap((*z)) >= int(zb0002) {
   263  		(*z) = (*z)[:zb0002]
   264  	} else {
   265  		(*z) = make(LsoEntries, zb0002)
   266  	}
   267  	for zb0001 := range *z {
   268  		if dc.IsNil() {
   269  			err = dc.ReadNil()
   270  			if err != nil {
   271  				err = msgp.WrapError(err, zb0001)
   272  				return
   273  			}
   274  			(*z)[zb0001] = nil
   275  		} else {
   276  			if (*z)[zb0001] == nil {
   277  				(*z)[zb0001] = new(LsoEnt)
   278  			}
   279  			err = (*z)[zb0001].DecodeMsg(dc)
   280  			if err != nil {
   281  				err = msgp.WrapError(err, zb0001)
   282  				return
   283  			}
   284  		}
   285  	}
   286  	return
   287  }
   288  
   289  // EncodeMsg implements msgp.Encodable
   290  func (z LsoEntries) EncodeMsg(en *msgp.Writer) (err error) {
   291  	err = en.WriteArrayHeader(uint32(len(z)))
   292  	if err != nil {
   293  		err = msgp.WrapError(err)
   294  		return
   295  	}
   296  	for zb0003 := range z {
   297  		if z[zb0003] == nil {
   298  			err = en.WriteNil()
   299  			if err != nil {
   300  				return
   301  			}
   302  		} else {
   303  			err = z[zb0003].EncodeMsg(en)
   304  			if err != nil {
   305  				err = msgp.WrapError(err, zb0003)
   306  				return
   307  			}
   308  		}
   309  	}
   310  	return
   311  }
   312  
   313  // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
   314  func (z LsoEntries) Msgsize() (s int) {
   315  	s = msgp.ArrayHeaderSize
   316  	for zb0003 := range z {
   317  		if z[zb0003] == nil {
   318  			s += msgp.NilSize
   319  		} else {
   320  			s += z[zb0003].Msgsize()
   321  		}
   322  	}
   323  	return
   324  }
   325  
   326  // DecodeMsg implements msgp.Decodable
   327  func (z *LsoRes) DecodeMsg(dc *msgp.Reader) (err error) {
   328  	var field []byte
   329  	_ = field
   330  	var zb0001 uint32
   331  	zb0001, err = dc.ReadMapHeader()
   332  	if err != nil {
   333  		err = msgp.WrapError(err)
   334  		return
   335  	}
   336  	for zb0001 > 0 {
   337  		zb0001--
   338  		field, err = dc.ReadMapKeyPtr()
   339  		if err != nil {
   340  			err = msgp.WrapError(err)
   341  			return
   342  		}
   343  		switch msgp.UnsafeString(field) {
   344  		case "UUID":
   345  			z.UUID, err = dc.ReadString()
   346  			if err != nil {
   347  				err = msgp.WrapError(err, "UUID")
   348  				return
   349  			}
   350  		case "ContinuationToken":
   351  			z.ContinuationToken, err = dc.ReadString()
   352  			if err != nil {
   353  				err = msgp.WrapError(err, "ContinuationToken")
   354  				return
   355  			}
   356  		case "Entries":
   357  			var zb0002 uint32
   358  			zb0002, err = dc.ReadArrayHeader()
   359  			if err != nil {
   360  				err = msgp.WrapError(err, "Entries")
   361  				return
   362  			}
   363  			if cap(z.Entries) >= int(zb0002) {
   364  				z.Entries = (z.Entries)[:zb0002]
   365  			} else {
   366  				z.Entries = make(LsoEntries, zb0002)
   367  			}
   368  			for za0001 := range z.Entries {
   369  				if dc.IsNil() {
   370  					err = dc.ReadNil()
   371  					if err != nil {
   372  						err = msgp.WrapError(err, "Entries", za0001)
   373  						return
   374  					}
   375  					z.Entries[za0001] = nil
   376  				} else {
   377  					if z.Entries[za0001] == nil {
   378  						z.Entries[za0001] = new(LsoEnt)
   379  					}
   380  					err = z.Entries[za0001].DecodeMsg(dc)
   381  					if err != nil {
   382  						err = msgp.WrapError(err, "Entries", za0001)
   383  						return
   384  					}
   385  				}
   386  			}
   387  		case "Flags":
   388  			z.Flags, err = dc.ReadUint32()
   389  			if err != nil {
   390  				err = msgp.WrapError(err, "Flags")
   391  				return
   392  			}
   393  		default:
   394  			err = dc.Skip()
   395  			if err != nil {
   396  				err = msgp.WrapError(err)
   397  				return
   398  			}
   399  		}
   400  	}
   401  	return
   402  }
   403  
   404  // EncodeMsg implements msgp.Encodable
   405  func (z *LsoRes) EncodeMsg(en *msgp.Writer) (err error) {
   406  	// map header, size 4
   407  	// write "UUID"
   408  	err = en.Append(0x84, 0xa4, 0x55, 0x55, 0x49, 0x44)
   409  	if err != nil {
   410  		return
   411  	}
   412  	err = en.WriteString(z.UUID)
   413  	if err != nil {
   414  		err = msgp.WrapError(err, "UUID")
   415  		return
   416  	}
   417  	// write "ContinuationToken"
   418  	err = en.Append(0xb1, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e)
   419  	if err != nil {
   420  		return
   421  	}
   422  	err = en.WriteString(z.ContinuationToken)
   423  	if err != nil {
   424  		err = msgp.WrapError(err, "ContinuationToken")
   425  		return
   426  	}
   427  	// write "Entries"
   428  	err = en.Append(0xa7, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73)
   429  	if err != nil {
   430  		return
   431  	}
   432  	err = en.WriteArrayHeader(uint32(len(z.Entries)))
   433  	if err != nil {
   434  		err = msgp.WrapError(err, "Entries")
   435  		return
   436  	}
   437  	for za0001 := range z.Entries {
   438  		if z.Entries[za0001] == nil {
   439  			err = en.WriteNil()
   440  			if err != nil {
   441  				return
   442  			}
   443  		} else {
   444  			err = z.Entries[za0001].EncodeMsg(en)
   445  			if err != nil {
   446  				err = msgp.WrapError(err, "Entries", za0001)
   447  				return
   448  			}
   449  		}
   450  	}
   451  	// write "Flags"
   452  	err = en.Append(0xa5, 0x46, 0x6c, 0x61, 0x67, 0x73)
   453  	if err != nil {
   454  		return
   455  	}
   456  	err = en.WriteUint32(z.Flags)
   457  	if err != nil {
   458  		err = msgp.WrapError(err, "Flags")
   459  		return
   460  	}
   461  	return
   462  }
   463  
   464  // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
   465  func (z *LsoRes) Msgsize() (s int) {
   466  	s = 1 + 5 + msgp.StringPrefixSize + len(z.UUID) + 18 + msgp.StringPrefixSize + len(z.ContinuationToken) + 8 + msgp.ArrayHeaderSize
   467  	for za0001 := range z.Entries {
   468  		if z.Entries[za0001] == nil {
   469  			s += msgp.NilSize
   470  		} else {
   471  			s += z.Entries[za0001].Msgsize()
   472  		}
   473  	}
   474  	s += 6 + msgp.Uint32Size
   475  	return
   476  }