github.com/minio/madmin-go/v3@v3.0.51/tier-s3_gen.go (about)

     1  package madmin
     2  
     3  // Code generated by github.com/tinylib/msgp DO NOT EDIT.
     4  
     5  import (
     6  	"github.com/tinylib/msgp/msgp"
     7  )
     8  
     9  // DecodeMsg implements msgp.Decodable
    10  func (z *TierS3) DecodeMsg(dc *msgp.Reader) (err error) {
    11  	var field []byte
    12  	_ = field
    13  	var zb0001 uint32
    14  	zb0001, err = dc.ReadMapHeader()
    15  	if err != nil {
    16  		err = msgp.WrapError(err)
    17  		return
    18  	}
    19  	for zb0001 > 0 {
    20  		zb0001--
    21  		field, err = dc.ReadMapKeyPtr()
    22  		if err != nil {
    23  			err = msgp.WrapError(err)
    24  			return
    25  		}
    26  		switch msgp.UnsafeString(field) {
    27  		case "Endpoint":
    28  			z.Endpoint, err = dc.ReadString()
    29  			if err != nil {
    30  				err = msgp.WrapError(err, "Endpoint")
    31  				return
    32  			}
    33  		case "AccessKey":
    34  			z.AccessKey, err = dc.ReadString()
    35  			if err != nil {
    36  				err = msgp.WrapError(err, "AccessKey")
    37  				return
    38  			}
    39  		case "SecretKey":
    40  			z.SecretKey, err = dc.ReadString()
    41  			if err != nil {
    42  				err = msgp.WrapError(err, "SecretKey")
    43  				return
    44  			}
    45  		case "Bucket":
    46  			z.Bucket, err = dc.ReadString()
    47  			if err != nil {
    48  				err = msgp.WrapError(err, "Bucket")
    49  				return
    50  			}
    51  		case "Prefix":
    52  			z.Prefix, err = dc.ReadString()
    53  			if err != nil {
    54  				err = msgp.WrapError(err, "Prefix")
    55  				return
    56  			}
    57  		case "Region":
    58  			z.Region, err = dc.ReadString()
    59  			if err != nil {
    60  				err = msgp.WrapError(err, "Region")
    61  				return
    62  			}
    63  		case "StorageClass":
    64  			z.StorageClass, err = dc.ReadString()
    65  			if err != nil {
    66  				err = msgp.WrapError(err, "StorageClass")
    67  				return
    68  			}
    69  		case "AWSRole":
    70  			z.AWSRole, err = dc.ReadBool()
    71  			if err != nil {
    72  				err = msgp.WrapError(err, "AWSRole")
    73  				return
    74  			}
    75  		case "AWSRoleWebIdentityTokenFile":
    76  			z.AWSRoleWebIdentityTokenFile, err = dc.ReadString()
    77  			if err != nil {
    78  				err = msgp.WrapError(err, "AWSRoleWebIdentityTokenFile")
    79  				return
    80  			}
    81  		case "AWSRoleARN":
    82  			z.AWSRoleARN, err = dc.ReadString()
    83  			if err != nil {
    84  				err = msgp.WrapError(err, "AWSRoleARN")
    85  				return
    86  			}
    87  		case "AWSRoleSessionName":
    88  			z.AWSRoleSessionName, err = dc.ReadString()
    89  			if err != nil {
    90  				err = msgp.WrapError(err, "AWSRoleSessionName")
    91  				return
    92  			}
    93  		case "AWSRoleDurationSeconds":
    94  			z.AWSRoleDurationSeconds, err = dc.ReadInt()
    95  			if err != nil {
    96  				err = msgp.WrapError(err, "AWSRoleDurationSeconds")
    97  				return
    98  			}
    99  		default:
   100  			err = dc.Skip()
   101  			if err != nil {
   102  				err = msgp.WrapError(err)
   103  				return
   104  			}
   105  		}
   106  	}
   107  	return
   108  }
   109  
   110  // EncodeMsg implements msgp.Encodable
   111  func (z *TierS3) EncodeMsg(en *msgp.Writer) (err error) {
   112  	// map header, size 12
   113  	// write "Endpoint"
   114  	err = en.Append(0x8c, 0xa8, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74)
   115  	if err != nil {
   116  		return
   117  	}
   118  	err = en.WriteString(z.Endpoint)
   119  	if err != nil {
   120  		err = msgp.WrapError(err, "Endpoint")
   121  		return
   122  	}
   123  	// write "AccessKey"
   124  	err = en.Append(0xa9, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79)
   125  	if err != nil {
   126  		return
   127  	}
   128  	err = en.WriteString(z.AccessKey)
   129  	if err != nil {
   130  		err = msgp.WrapError(err, "AccessKey")
   131  		return
   132  	}
   133  	// write "SecretKey"
   134  	err = en.Append(0xa9, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79)
   135  	if err != nil {
   136  		return
   137  	}
   138  	err = en.WriteString(z.SecretKey)
   139  	if err != nil {
   140  		err = msgp.WrapError(err, "SecretKey")
   141  		return
   142  	}
   143  	// write "Bucket"
   144  	err = en.Append(0xa6, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74)
   145  	if err != nil {
   146  		return
   147  	}
   148  	err = en.WriteString(z.Bucket)
   149  	if err != nil {
   150  		err = msgp.WrapError(err, "Bucket")
   151  		return
   152  	}
   153  	// write "Prefix"
   154  	err = en.Append(0xa6, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78)
   155  	if err != nil {
   156  		return
   157  	}
   158  	err = en.WriteString(z.Prefix)
   159  	if err != nil {
   160  		err = msgp.WrapError(err, "Prefix")
   161  		return
   162  	}
   163  	// write "Region"
   164  	err = en.Append(0xa6, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e)
   165  	if err != nil {
   166  		return
   167  	}
   168  	err = en.WriteString(z.Region)
   169  	if err != nil {
   170  		err = msgp.WrapError(err, "Region")
   171  		return
   172  	}
   173  	// write "StorageClass"
   174  	err = en.Append(0xac, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73)
   175  	if err != nil {
   176  		return
   177  	}
   178  	err = en.WriteString(z.StorageClass)
   179  	if err != nil {
   180  		err = msgp.WrapError(err, "StorageClass")
   181  		return
   182  	}
   183  	// write "AWSRole"
   184  	err = en.Append(0xa7, 0x41, 0x57, 0x53, 0x52, 0x6f, 0x6c, 0x65)
   185  	if err != nil {
   186  		return
   187  	}
   188  	err = en.WriteBool(z.AWSRole)
   189  	if err != nil {
   190  		err = msgp.WrapError(err, "AWSRole")
   191  		return
   192  	}
   193  	// write "AWSRoleWebIdentityTokenFile"
   194  	err = en.Append(0xbb, 0x41, 0x57, 0x53, 0x52, 0x6f, 0x6c, 0x65, 0x57, 0x65, 0x62, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x46, 0x69, 0x6c, 0x65)
   195  	if err != nil {
   196  		return
   197  	}
   198  	err = en.WriteString(z.AWSRoleWebIdentityTokenFile)
   199  	if err != nil {
   200  		err = msgp.WrapError(err, "AWSRoleWebIdentityTokenFile")
   201  		return
   202  	}
   203  	// write "AWSRoleARN"
   204  	err = en.Append(0xaa, 0x41, 0x57, 0x53, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x52, 0x4e)
   205  	if err != nil {
   206  		return
   207  	}
   208  	err = en.WriteString(z.AWSRoleARN)
   209  	if err != nil {
   210  		err = msgp.WrapError(err, "AWSRoleARN")
   211  		return
   212  	}
   213  	// write "AWSRoleSessionName"
   214  	err = en.Append(0xb2, 0x41, 0x57, 0x53, 0x52, 0x6f, 0x6c, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65)
   215  	if err != nil {
   216  		return
   217  	}
   218  	err = en.WriteString(z.AWSRoleSessionName)
   219  	if err != nil {
   220  		err = msgp.WrapError(err, "AWSRoleSessionName")
   221  		return
   222  	}
   223  	// write "AWSRoleDurationSeconds"
   224  	err = en.Append(0xb6, 0x41, 0x57, 0x53, 0x52, 0x6f, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73)
   225  	if err != nil {
   226  		return
   227  	}
   228  	err = en.WriteInt(z.AWSRoleDurationSeconds)
   229  	if err != nil {
   230  		err = msgp.WrapError(err, "AWSRoleDurationSeconds")
   231  		return
   232  	}
   233  	return
   234  }
   235  
   236  // MarshalMsg implements msgp.Marshaler
   237  func (z *TierS3) MarshalMsg(b []byte) (o []byte, err error) {
   238  	o = msgp.Require(b, z.Msgsize())
   239  	// map header, size 12
   240  	// string "Endpoint"
   241  	o = append(o, 0x8c, 0xa8, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74)
   242  	o = msgp.AppendString(o, z.Endpoint)
   243  	// string "AccessKey"
   244  	o = append(o, 0xa9, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79)
   245  	o = msgp.AppendString(o, z.AccessKey)
   246  	// string "SecretKey"
   247  	o = append(o, 0xa9, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79)
   248  	o = msgp.AppendString(o, z.SecretKey)
   249  	// string "Bucket"
   250  	o = append(o, 0xa6, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74)
   251  	o = msgp.AppendString(o, z.Bucket)
   252  	// string "Prefix"
   253  	o = append(o, 0xa6, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78)
   254  	o = msgp.AppendString(o, z.Prefix)
   255  	// string "Region"
   256  	o = append(o, 0xa6, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e)
   257  	o = msgp.AppendString(o, z.Region)
   258  	// string "StorageClass"
   259  	o = append(o, 0xac, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73)
   260  	o = msgp.AppendString(o, z.StorageClass)
   261  	// string "AWSRole"
   262  	o = append(o, 0xa7, 0x41, 0x57, 0x53, 0x52, 0x6f, 0x6c, 0x65)
   263  	o = msgp.AppendBool(o, z.AWSRole)
   264  	// string "AWSRoleWebIdentityTokenFile"
   265  	o = append(o, 0xbb, 0x41, 0x57, 0x53, 0x52, 0x6f, 0x6c, 0x65, 0x57, 0x65, 0x62, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x46, 0x69, 0x6c, 0x65)
   266  	o = msgp.AppendString(o, z.AWSRoleWebIdentityTokenFile)
   267  	// string "AWSRoleARN"
   268  	o = append(o, 0xaa, 0x41, 0x57, 0x53, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x52, 0x4e)
   269  	o = msgp.AppendString(o, z.AWSRoleARN)
   270  	// string "AWSRoleSessionName"
   271  	o = append(o, 0xb2, 0x41, 0x57, 0x53, 0x52, 0x6f, 0x6c, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65)
   272  	o = msgp.AppendString(o, z.AWSRoleSessionName)
   273  	// string "AWSRoleDurationSeconds"
   274  	o = append(o, 0xb6, 0x41, 0x57, 0x53, 0x52, 0x6f, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73)
   275  	o = msgp.AppendInt(o, z.AWSRoleDurationSeconds)
   276  	return
   277  }
   278  
   279  // UnmarshalMsg implements msgp.Unmarshaler
   280  func (z *TierS3) UnmarshalMsg(bts []byte) (o []byte, err error) {
   281  	var field []byte
   282  	_ = field
   283  	var zb0001 uint32
   284  	zb0001, bts, err = msgp.ReadMapHeaderBytes(bts)
   285  	if err != nil {
   286  		err = msgp.WrapError(err)
   287  		return
   288  	}
   289  	for zb0001 > 0 {
   290  		zb0001--
   291  		field, bts, err = msgp.ReadMapKeyZC(bts)
   292  		if err != nil {
   293  			err = msgp.WrapError(err)
   294  			return
   295  		}
   296  		switch msgp.UnsafeString(field) {
   297  		case "Endpoint":
   298  			z.Endpoint, bts, err = msgp.ReadStringBytes(bts)
   299  			if err != nil {
   300  				err = msgp.WrapError(err, "Endpoint")
   301  				return
   302  			}
   303  		case "AccessKey":
   304  			z.AccessKey, bts, err = msgp.ReadStringBytes(bts)
   305  			if err != nil {
   306  				err = msgp.WrapError(err, "AccessKey")
   307  				return
   308  			}
   309  		case "SecretKey":
   310  			z.SecretKey, bts, err = msgp.ReadStringBytes(bts)
   311  			if err != nil {
   312  				err = msgp.WrapError(err, "SecretKey")
   313  				return
   314  			}
   315  		case "Bucket":
   316  			z.Bucket, bts, err = msgp.ReadStringBytes(bts)
   317  			if err != nil {
   318  				err = msgp.WrapError(err, "Bucket")
   319  				return
   320  			}
   321  		case "Prefix":
   322  			z.Prefix, bts, err = msgp.ReadStringBytes(bts)
   323  			if err != nil {
   324  				err = msgp.WrapError(err, "Prefix")
   325  				return
   326  			}
   327  		case "Region":
   328  			z.Region, bts, err = msgp.ReadStringBytes(bts)
   329  			if err != nil {
   330  				err = msgp.WrapError(err, "Region")
   331  				return
   332  			}
   333  		case "StorageClass":
   334  			z.StorageClass, bts, err = msgp.ReadStringBytes(bts)
   335  			if err != nil {
   336  				err = msgp.WrapError(err, "StorageClass")
   337  				return
   338  			}
   339  		case "AWSRole":
   340  			z.AWSRole, bts, err = msgp.ReadBoolBytes(bts)
   341  			if err != nil {
   342  				err = msgp.WrapError(err, "AWSRole")
   343  				return
   344  			}
   345  		case "AWSRoleWebIdentityTokenFile":
   346  			z.AWSRoleWebIdentityTokenFile, bts, err = msgp.ReadStringBytes(bts)
   347  			if err != nil {
   348  				err = msgp.WrapError(err, "AWSRoleWebIdentityTokenFile")
   349  				return
   350  			}
   351  		case "AWSRoleARN":
   352  			z.AWSRoleARN, bts, err = msgp.ReadStringBytes(bts)
   353  			if err != nil {
   354  				err = msgp.WrapError(err, "AWSRoleARN")
   355  				return
   356  			}
   357  		case "AWSRoleSessionName":
   358  			z.AWSRoleSessionName, bts, err = msgp.ReadStringBytes(bts)
   359  			if err != nil {
   360  				err = msgp.WrapError(err, "AWSRoleSessionName")
   361  				return
   362  			}
   363  		case "AWSRoleDurationSeconds":
   364  			z.AWSRoleDurationSeconds, bts, err = msgp.ReadIntBytes(bts)
   365  			if err != nil {
   366  				err = msgp.WrapError(err, "AWSRoleDurationSeconds")
   367  				return
   368  			}
   369  		default:
   370  			bts, err = msgp.Skip(bts)
   371  			if err != nil {
   372  				err = msgp.WrapError(err)
   373  				return
   374  			}
   375  		}
   376  	}
   377  	o = bts
   378  	return
   379  }
   380  
   381  // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
   382  func (z *TierS3) Msgsize() (s int) {
   383  	s = 1 + 9 + msgp.StringPrefixSize + len(z.Endpoint) + 10 + msgp.StringPrefixSize + len(z.AccessKey) + 10 + msgp.StringPrefixSize + len(z.SecretKey) + 7 + msgp.StringPrefixSize + len(z.Bucket) + 7 + msgp.StringPrefixSize + len(z.Prefix) + 7 + msgp.StringPrefixSize + len(z.Region) + 13 + msgp.StringPrefixSize + len(z.StorageClass) + 8 + msgp.BoolSize + 28 + msgp.StringPrefixSize + len(z.AWSRoleWebIdentityTokenFile) + 11 + msgp.StringPrefixSize + len(z.AWSRoleARN) + 19 + msgp.StringPrefixSize + len(z.AWSRoleSessionName) + 23 + msgp.IntSize
   384  	return
   385  }