github.com/m3db/m3@v1.5.0/src/metrics/generated/proto/policypb/policy.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: github.com/m3db/m3/src/metrics/generated/proto/policypb/policy.proto
     3  
     4  // Copyright (c) 2020 Uber Technologies, Inc.
     5  //
     6  // Permission is hereby granted, free of charge, to any person obtaining a copy
     7  // of this software and associated documentation files (the "Software"), to deal
     8  // in the Software without restriction, including without limitation the rights
     9  // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    10  // copies of the Software, and to permit persons to whom the Software is
    11  // furnished to do so, subject to the following conditions:
    12  //
    13  // The above copyright notice and this permission notice shall be included in
    14  // all copies or substantial portions of the Software.
    15  //
    16  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    17  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    18  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    19  // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    20  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    21  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    22  // THE SOFTWARE.
    23  
    24  /*
    25  	Package policypb is a generated protocol buffer package.
    26  
    27  	It is generated from these files:
    28  		github.com/m3db/m3/src/metrics/generated/proto/policypb/policy.proto
    29  
    30  	It has these top-level messages:
    31  		Resolution
    32  		Retention
    33  		StoragePolicy
    34  		Policy
    35  */
    36  package policypb
    37  
    38  import proto "github.com/gogo/protobuf/proto"
    39  import fmt "fmt"
    40  import math "math"
    41  import _ "github.com/gogo/protobuf/gogoproto"
    42  import aggregationpb "github.com/m3db/m3/src/metrics/generated/proto/aggregationpb"
    43  
    44  import io "io"
    45  
    46  // Reference imports to suppress errors if they are not otherwise used.
    47  var _ = proto.Marshal
    48  var _ = fmt.Errorf
    49  var _ = math.Inf
    50  
    51  // This is a compile-time assertion to ensure that this generated file
    52  // is compatible with the proto package it is being compiled against.
    53  // A compilation error at this line likely means your copy of the
    54  // proto package needs to be updated.
    55  const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
    56  
    57  type DropPolicy int32
    58  
    59  const (
    60  	DropPolicy_NONE               DropPolicy = 0
    61  	DropPolicy_DROP_MUST          DropPolicy = 1
    62  	DropPolicy_DROP_IF_ONLY_MATCH DropPolicy = 2
    63  )
    64  
    65  var DropPolicy_name = map[int32]string{
    66  	0: "NONE",
    67  	1: "DROP_MUST",
    68  	2: "DROP_IF_ONLY_MATCH",
    69  }
    70  var DropPolicy_value = map[string]int32{
    71  	"NONE":               0,
    72  	"DROP_MUST":          1,
    73  	"DROP_IF_ONLY_MATCH": 2,
    74  }
    75  
    76  func (x DropPolicy) String() string {
    77  	return proto.EnumName(DropPolicy_name, int32(x))
    78  }
    79  func (DropPolicy) EnumDescriptor() ([]byte, []int) { return fileDescriptorPolicy, []int{0} }
    80  
    81  type Resolution struct {
    82  	WindowSize int64 `protobuf:"varint,1,opt,name=window_size,json=windowSize,proto3" json:"window_size,omitempty"`
    83  	Precision  int64 `protobuf:"varint,2,opt,name=precision,proto3" json:"precision,omitempty"`
    84  }
    85  
    86  func (m *Resolution) Reset()                    { *m = Resolution{} }
    87  func (m *Resolution) String() string            { return proto.CompactTextString(m) }
    88  func (*Resolution) ProtoMessage()               {}
    89  func (*Resolution) Descriptor() ([]byte, []int) { return fileDescriptorPolicy, []int{0} }
    90  
    91  func (m *Resolution) GetWindowSize() int64 {
    92  	if m != nil {
    93  		return m.WindowSize
    94  	}
    95  	return 0
    96  }
    97  
    98  func (m *Resolution) GetPrecision() int64 {
    99  	if m != nil {
   100  		return m.Precision
   101  	}
   102  	return 0
   103  }
   104  
   105  type Retention struct {
   106  	Period int64 `protobuf:"varint,1,opt,name=period,proto3" json:"period,omitempty"`
   107  }
   108  
   109  func (m *Retention) Reset()                    { *m = Retention{} }
   110  func (m *Retention) String() string            { return proto.CompactTextString(m) }
   111  func (*Retention) ProtoMessage()               {}
   112  func (*Retention) Descriptor() ([]byte, []int) { return fileDescriptorPolicy, []int{1} }
   113  
   114  func (m *Retention) GetPeriod() int64 {
   115  	if m != nil {
   116  		return m.Period
   117  	}
   118  	return 0
   119  }
   120  
   121  type StoragePolicy struct {
   122  	Resolution Resolution `protobuf:"bytes,1,opt,name=resolution" json:"resolution"`
   123  	Retention  Retention  `protobuf:"bytes,2,opt,name=retention" json:"retention"`
   124  }
   125  
   126  func (m *StoragePolicy) Reset()                    { *m = StoragePolicy{} }
   127  func (m *StoragePolicy) String() string            { return proto.CompactTextString(m) }
   128  func (*StoragePolicy) ProtoMessage()               {}
   129  func (*StoragePolicy) Descriptor() ([]byte, []int) { return fileDescriptorPolicy, []int{2} }
   130  
   131  func (m *StoragePolicy) GetResolution() Resolution {
   132  	if m != nil {
   133  		return m.Resolution
   134  	}
   135  	return Resolution{}
   136  }
   137  
   138  func (m *StoragePolicy) GetRetention() Retention {
   139  	if m != nil {
   140  		return m.Retention
   141  	}
   142  	return Retention{}
   143  }
   144  
   145  type Policy struct {
   146  	StoragePolicy    *StoragePolicy                  `protobuf:"bytes,1,opt,name=storage_policy,json=storagePolicy" json:"storage_policy,omitempty"`
   147  	AggregationTypes []aggregationpb.AggregationType `protobuf:"varint,2,rep,packed,name=aggregation_types,json=aggregationTypes,enum=aggregationpb.AggregationType" json:"aggregation_types,omitempty"`
   148  }
   149  
   150  func (m *Policy) Reset()                    { *m = Policy{} }
   151  func (m *Policy) String() string            { return proto.CompactTextString(m) }
   152  func (*Policy) ProtoMessage()               {}
   153  func (*Policy) Descriptor() ([]byte, []int) { return fileDescriptorPolicy, []int{3} }
   154  
   155  func (m *Policy) GetStoragePolicy() *StoragePolicy {
   156  	if m != nil {
   157  		return m.StoragePolicy
   158  	}
   159  	return nil
   160  }
   161  
   162  func (m *Policy) GetAggregationTypes() []aggregationpb.AggregationType {
   163  	if m != nil {
   164  		return m.AggregationTypes
   165  	}
   166  	return nil
   167  }
   168  
   169  func init() {
   170  	proto.RegisterType((*Resolution)(nil), "policypb.Resolution")
   171  	proto.RegisterType((*Retention)(nil), "policypb.Retention")
   172  	proto.RegisterType((*StoragePolicy)(nil), "policypb.StoragePolicy")
   173  	proto.RegisterType((*Policy)(nil), "policypb.Policy")
   174  	proto.RegisterEnum("policypb.DropPolicy", DropPolicy_name, DropPolicy_value)
   175  }
   176  func (m *Resolution) Marshal() (dAtA []byte, err error) {
   177  	size := m.Size()
   178  	dAtA = make([]byte, size)
   179  	n, err := m.MarshalTo(dAtA)
   180  	if err != nil {
   181  		return nil, err
   182  	}
   183  	return dAtA[:n], nil
   184  }
   185  
   186  func (m *Resolution) MarshalTo(dAtA []byte) (int, error) {
   187  	var i int
   188  	_ = i
   189  	var l int
   190  	_ = l
   191  	if m.WindowSize != 0 {
   192  		dAtA[i] = 0x8
   193  		i++
   194  		i = encodeVarintPolicy(dAtA, i, uint64(m.WindowSize))
   195  	}
   196  	if m.Precision != 0 {
   197  		dAtA[i] = 0x10
   198  		i++
   199  		i = encodeVarintPolicy(dAtA, i, uint64(m.Precision))
   200  	}
   201  	return i, nil
   202  }
   203  
   204  func (m *Retention) Marshal() (dAtA []byte, err error) {
   205  	size := m.Size()
   206  	dAtA = make([]byte, size)
   207  	n, err := m.MarshalTo(dAtA)
   208  	if err != nil {
   209  		return nil, err
   210  	}
   211  	return dAtA[:n], nil
   212  }
   213  
   214  func (m *Retention) MarshalTo(dAtA []byte) (int, error) {
   215  	var i int
   216  	_ = i
   217  	var l int
   218  	_ = l
   219  	if m.Period != 0 {
   220  		dAtA[i] = 0x8
   221  		i++
   222  		i = encodeVarintPolicy(dAtA, i, uint64(m.Period))
   223  	}
   224  	return i, nil
   225  }
   226  
   227  func (m *StoragePolicy) Marshal() (dAtA []byte, err error) {
   228  	size := m.Size()
   229  	dAtA = make([]byte, size)
   230  	n, err := m.MarshalTo(dAtA)
   231  	if err != nil {
   232  		return nil, err
   233  	}
   234  	return dAtA[:n], nil
   235  }
   236  
   237  func (m *StoragePolicy) MarshalTo(dAtA []byte) (int, error) {
   238  	var i int
   239  	_ = i
   240  	var l int
   241  	_ = l
   242  	dAtA[i] = 0xa
   243  	i++
   244  	i = encodeVarintPolicy(dAtA, i, uint64(m.Resolution.Size()))
   245  	n1, err := m.Resolution.MarshalTo(dAtA[i:])
   246  	if err != nil {
   247  		return 0, err
   248  	}
   249  	i += n1
   250  	dAtA[i] = 0x12
   251  	i++
   252  	i = encodeVarintPolicy(dAtA, i, uint64(m.Retention.Size()))
   253  	n2, err := m.Retention.MarshalTo(dAtA[i:])
   254  	if err != nil {
   255  		return 0, err
   256  	}
   257  	i += n2
   258  	return i, nil
   259  }
   260  
   261  func (m *Policy) Marshal() (dAtA []byte, err error) {
   262  	size := m.Size()
   263  	dAtA = make([]byte, size)
   264  	n, err := m.MarshalTo(dAtA)
   265  	if err != nil {
   266  		return nil, err
   267  	}
   268  	return dAtA[:n], nil
   269  }
   270  
   271  func (m *Policy) MarshalTo(dAtA []byte) (int, error) {
   272  	var i int
   273  	_ = i
   274  	var l int
   275  	_ = l
   276  	if m.StoragePolicy != nil {
   277  		dAtA[i] = 0xa
   278  		i++
   279  		i = encodeVarintPolicy(dAtA, i, uint64(m.StoragePolicy.Size()))
   280  		n3, err := m.StoragePolicy.MarshalTo(dAtA[i:])
   281  		if err != nil {
   282  			return 0, err
   283  		}
   284  		i += n3
   285  	}
   286  	if len(m.AggregationTypes) > 0 {
   287  		dAtA5 := make([]byte, len(m.AggregationTypes)*10)
   288  		var j4 int
   289  		for _, num := range m.AggregationTypes {
   290  			for num >= 1<<7 {
   291  				dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80)
   292  				num >>= 7
   293  				j4++
   294  			}
   295  			dAtA5[j4] = uint8(num)
   296  			j4++
   297  		}
   298  		dAtA[i] = 0x12
   299  		i++
   300  		i = encodeVarintPolicy(dAtA, i, uint64(j4))
   301  		i += copy(dAtA[i:], dAtA5[:j4])
   302  	}
   303  	return i, nil
   304  }
   305  
   306  func encodeVarintPolicy(dAtA []byte, offset int, v uint64) int {
   307  	for v >= 1<<7 {
   308  		dAtA[offset] = uint8(v&0x7f | 0x80)
   309  		v >>= 7
   310  		offset++
   311  	}
   312  	dAtA[offset] = uint8(v)
   313  	return offset + 1
   314  }
   315  func (m *Resolution) Size() (n int) {
   316  	var l int
   317  	_ = l
   318  	if m.WindowSize != 0 {
   319  		n += 1 + sovPolicy(uint64(m.WindowSize))
   320  	}
   321  	if m.Precision != 0 {
   322  		n += 1 + sovPolicy(uint64(m.Precision))
   323  	}
   324  	return n
   325  }
   326  
   327  func (m *Retention) Size() (n int) {
   328  	var l int
   329  	_ = l
   330  	if m.Period != 0 {
   331  		n += 1 + sovPolicy(uint64(m.Period))
   332  	}
   333  	return n
   334  }
   335  
   336  func (m *StoragePolicy) Size() (n int) {
   337  	var l int
   338  	_ = l
   339  	l = m.Resolution.Size()
   340  	n += 1 + l + sovPolicy(uint64(l))
   341  	l = m.Retention.Size()
   342  	n += 1 + l + sovPolicy(uint64(l))
   343  	return n
   344  }
   345  
   346  func (m *Policy) Size() (n int) {
   347  	var l int
   348  	_ = l
   349  	if m.StoragePolicy != nil {
   350  		l = m.StoragePolicy.Size()
   351  		n += 1 + l + sovPolicy(uint64(l))
   352  	}
   353  	if len(m.AggregationTypes) > 0 {
   354  		l = 0
   355  		for _, e := range m.AggregationTypes {
   356  			l += sovPolicy(uint64(e))
   357  		}
   358  		n += 1 + sovPolicy(uint64(l)) + l
   359  	}
   360  	return n
   361  }
   362  
   363  func sovPolicy(x uint64) (n int) {
   364  	for {
   365  		n++
   366  		x >>= 7
   367  		if x == 0 {
   368  			break
   369  		}
   370  	}
   371  	return n
   372  }
   373  func sozPolicy(x uint64) (n int) {
   374  	return sovPolicy(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   375  }
   376  func (m *Resolution) Unmarshal(dAtA []byte) error {
   377  	l := len(dAtA)
   378  	iNdEx := 0
   379  	for iNdEx < l {
   380  		preIndex := iNdEx
   381  		var wire uint64
   382  		for shift := uint(0); ; shift += 7 {
   383  			if shift >= 64 {
   384  				return ErrIntOverflowPolicy
   385  			}
   386  			if iNdEx >= l {
   387  				return io.ErrUnexpectedEOF
   388  			}
   389  			b := dAtA[iNdEx]
   390  			iNdEx++
   391  			wire |= (uint64(b) & 0x7F) << shift
   392  			if b < 0x80 {
   393  				break
   394  			}
   395  		}
   396  		fieldNum := int32(wire >> 3)
   397  		wireType := int(wire & 0x7)
   398  		if wireType == 4 {
   399  			return fmt.Errorf("proto: Resolution: wiretype end group for non-group")
   400  		}
   401  		if fieldNum <= 0 {
   402  			return fmt.Errorf("proto: Resolution: illegal tag %d (wire type %d)", fieldNum, wire)
   403  		}
   404  		switch fieldNum {
   405  		case 1:
   406  			if wireType != 0 {
   407  				return fmt.Errorf("proto: wrong wireType = %d for field WindowSize", wireType)
   408  			}
   409  			m.WindowSize = 0
   410  			for shift := uint(0); ; shift += 7 {
   411  				if shift >= 64 {
   412  					return ErrIntOverflowPolicy
   413  				}
   414  				if iNdEx >= l {
   415  					return io.ErrUnexpectedEOF
   416  				}
   417  				b := dAtA[iNdEx]
   418  				iNdEx++
   419  				m.WindowSize |= (int64(b) & 0x7F) << shift
   420  				if b < 0x80 {
   421  					break
   422  				}
   423  			}
   424  		case 2:
   425  			if wireType != 0 {
   426  				return fmt.Errorf("proto: wrong wireType = %d for field Precision", wireType)
   427  			}
   428  			m.Precision = 0
   429  			for shift := uint(0); ; shift += 7 {
   430  				if shift >= 64 {
   431  					return ErrIntOverflowPolicy
   432  				}
   433  				if iNdEx >= l {
   434  					return io.ErrUnexpectedEOF
   435  				}
   436  				b := dAtA[iNdEx]
   437  				iNdEx++
   438  				m.Precision |= (int64(b) & 0x7F) << shift
   439  				if b < 0x80 {
   440  					break
   441  				}
   442  			}
   443  		default:
   444  			iNdEx = preIndex
   445  			skippy, err := skipPolicy(dAtA[iNdEx:])
   446  			if err != nil {
   447  				return err
   448  			}
   449  			if skippy < 0 {
   450  				return ErrInvalidLengthPolicy
   451  			}
   452  			if (iNdEx + skippy) > l {
   453  				return io.ErrUnexpectedEOF
   454  			}
   455  			iNdEx += skippy
   456  		}
   457  	}
   458  
   459  	if iNdEx > l {
   460  		return io.ErrUnexpectedEOF
   461  	}
   462  	return nil
   463  }
   464  func (m *Retention) Unmarshal(dAtA []byte) error {
   465  	l := len(dAtA)
   466  	iNdEx := 0
   467  	for iNdEx < l {
   468  		preIndex := iNdEx
   469  		var wire uint64
   470  		for shift := uint(0); ; shift += 7 {
   471  			if shift >= 64 {
   472  				return ErrIntOverflowPolicy
   473  			}
   474  			if iNdEx >= l {
   475  				return io.ErrUnexpectedEOF
   476  			}
   477  			b := dAtA[iNdEx]
   478  			iNdEx++
   479  			wire |= (uint64(b) & 0x7F) << shift
   480  			if b < 0x80 {
   481  				break
   482  			}
   483  		}
   484  		fieldNum := int32(wire >> 3)
   485  		wireType := int(wire & 0x7)
   486  		if wireType == 4 {
   487  			return fmt.Errorf("proto: Retention: wiretype end group for non-group")
   488  		}
   489  		if fieldNum <= 0 {
   490  			return fmt.Errorf("proto: Retention: illegal tag %d (wire type %d)", fieldNum, wire)
   491  		}
   492  		switch fieldNum {
   493  		case 1:
   494  			if wireType != 0 {
   495  				return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType)
   496  			}
   497  			m.Period = 0
   498  			for shift := uint(0); ; shift += 7 {
   499  				if shift >= 64 {
   500  					return ErrIntOverflowPolicy
   501  				}
   502  				if iNdEx >= l {
   503  					return io.ErrUnexpectedEOF
   504  				}
   505  				b := dAtA[iNdEx]
   506  				iNdEx++
   507  				m.Period |= (int64(b) & 0x7F) << shift
   508  				if b < 0x80 {
   509  					break
   510  				}
   511  			}
   512  		default:
   513  			iNdEx = preIndex
   514  			skippy, err := skipPolicy(dAtA[iNdEx:])
   515  			if err != nil {
   516  				return err
   517  			}
   518  			if skippy < 0 {
   519  				return ErrInvalidLengthPolicy
   520  			}
   521  			if (iNdEx + skippy) > l {
   522  				return io.ErrUnexpectedEOF
   523  			}
   524  			iNdEx += skippy
   525  		}
   526  	}
   527  
   528  	if iNdEx > l {
   529  		return io.ErrUnexpectedEOF
   530  	}
   531  	return nil
   532  }
   533  func (m *StoragePolicy) Unmarshal(dAtA []byte) error {
   534  	l := len(dAtA)
   535  	iNdEx := 0
   536  	for iNdEx < l {
   537  		preIndex := iNdEx
   538  		var wire uint64
   539  		for shift := uint(0); ; shift += 7 {
   540  			if shift >= 64 {
   541  				return ErrIntOverflowPolicy
   542  			}
   543  			if iNdEx >= l {
   544  				return io.ErrUnexpectedEOF
   545  			}
   546  			b := dAtA[iNdEx]
   547  			iNdEx++
   548  			wire |= (uint64(b) & 0x7F) << shift
   549  			if b < 0x80 {
   550  				break
   551  			}
   552  		}
   553  		fieldNum := int32(wire >> 3)
   554  		wireType := int(wire & 0x7)
   555  		if wireType == 4 {
   556  			return fmt.Errorf("proto: StoragePolicy: wiretype end group for non-group")
   557  		}
   558  		if fieldNum <= 0 {
   559  			return fmt.Errorf("proto: StoragePolicy: illegal tag %d (wire type %d)", fieldNum, wire)
   560  		}
   561  		switch fieldNum {
   562  		case 1:
   563  			if wireType != 2 {
   564  				return fmt.Errorf("proto: wrong wireType = %d for field Resolution", wireType)
   565  			}
   566  			var msglen int
   567  			for shift := uint(0); ; shift += 7 {
   568  				if shift >= 64 {
   569  					return ErrIntOverflowPolicy
   570  				}
   571  				if iNdEx >= l {
   572  					return io.ErrUnexpectedEOF
   573  				}
   574  				b := dAtA[iNdEx]
   575  				iNdEx++
   576  				msglen |= (int(b) & 0x7F) << shift
   577  				if b < 0x80 {
   578  					break
   579  				}
   580  			}
   581  			if msglen < 0 {
   582  				return ErrInvalidLengthPolicy
   583  			}
   584  			postIndex := iNdEx + msglen
   585  			if postIndex > l {
   586  				return io.ErrUnexpectedEOF
   587  			}
   588  			if err := m.Resolution.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   589  				return err
   590  			}
   591  			iNdEx = postIndex
   592  		case 2:
   593  			if wireType != 2 {
   594  				return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType)
   595  			}
   596  			var msglen int
   597  			for shift := uint(0); ; shift += 7 {
   598  				if shift >= 64 {
   599  					return ErrIntOverflowPolicy
   600  				}
   601  				if iNdEx >= l {
   602  					return io.ErrUnexpectedEOF
   603  				}
   604  				b := dAtA[iNdEx]
   605  				iNdEx++
   606  				msglen |= (int(b) & 0x7F) << shift
   607  				if b < 0x80 {
   608  					break
   609  				}
   610  			}
   611  			if msglen < 0 {
   612  				return ErrInvalidLengthPolicy
   613  			}
   614  			postIndex := iNdEx + msglen
   615  			if postIndex > l {
   616  				return io.ErrUnexpectedEOF
   617  			}
   618  			if err := m.Retention.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   619  				return err
   620  			}
   621  			iNdEx = postIndex
   622  		default:
   623  			iNdEx = preIndex
   624  			skippy, err := skipPolicy(dAtA[iNdEx:])
   625  			if err != nil {
   626  				return err
   627  			}
   628  			if skippy < 0 {
   629  				return ErrInvalidLengthPolicy
   630  			}
   631  			if (iNdEx + skippy) > l {
   632  				return io.ErrUnexpectedEOF
   633  			}
   634  			iNdEx += skippy
   635  		}
   636  	}
   637  
   638  	if iNdEx > l {
   639  		return io.ErrUnexpectedEOF
   640  	}
   641  	return nil
   642  }
   643  func (m *Policy) Unmarshal(dAtA []byte) error {
   644  	l := len(dAtA)
   645  	iNdEx := 0
   646  	for iNdEx < l {
   647  		preIndex := iNdEx
   648  		var wire uint64
   649  		for shift := uint(0); ; shift += 7 {
   650  			if shift >= 64 {
   651  				return ErrIntOverflowPolicy
   652  			}
   653  			if iNdEx >= l {
   654  				return io.ErrUnexpectedEOF
   655  			}
   656  			b := dAtA[iNdEx]
   657  			iNdEx++
   658  			wire |= (uint64(b) & 0x7F) << shift
   659  			if b < 0x80 {
   660  				break
   661  			}
   662  		}
   663  		fieldNum := int32(wire >> 3)
   664  		wireType := int(wire & 0x7)
   665  		if wireType == 4 {
   666  			return fmt.Errorf("proto: Policy: wiretype end group for non-group")
   667  		}
   668  		if fieldNum <= 0 {
   669  			return fmt.Errorf("proto: Policy: illegal tag %d (wire type %d)", fieldNum, wire)
   670  		}
   671  		switch fieldNum {
   672  		case 1:
   673  			if wireType != 2 {
   674  				return fmt.Errorf("proto: wrong wireType = %d for field StoragePolicy", wireType)
   675  			}
   676  			var msglen int
   677  			for shift := uint(0); ; shift += 7 {
   678  				if shift >= 64 {
   679  					return ErrIntOverflowPolicy
   680  				}
   681  				if iNdEx >= l {
   682  					return io.ErrUnexpectedEOF
   683  				}
   684  				b := dAtA[iNdEx]
   685  				iNdEx++
   686  				msglen |= (int(b) & 0x7F) << shift
   687  				if b < 0x80 {
   688  					break
   689  				}
   690  			}
   691  			if msglen < 0 {
   692  				return ErrInvalidLengthPolicy
   693  			}
   694  			postIndex := iNdEx + msglen
   695  			if postIndex > l {
   696  				return io.ErrUnexpectedEOF
   697  			}
   698  			if m.StoragePolicy == nil {
   699  				m.StoragePolicy = &StoragePolicy{}
   700  			}
   701  			if err := m.StoragePolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   702  				return err
   703  			}
   704  			iNdEx = postIndex
   705  		case 2:
   706  			if wireType == 0 {
   707  				var v aggregationpb.AggregationType
   708  				for shift := uint(0); ; shift += 7 {
   709  					if shift >= 64 {
   710  						return ErrIntOverflowPolicy
   711  					}
   712  					if iNdEx >= l {
   713  						return io.ErrUnexpectedEOF
   714  					}
   715  					b := dAtA[iNdEx]
   716  					iNdEx++
   717  					v |= (aggregationpb.AggregationType(b) & 0x7F) << shift
   718  					if b < 0x80 {
   719  						break
   720  					}
   721  				}
   722  				m.AggregationTypes = append(m.AggregationTypes, v)
   723  			} else if wireType == 2 {
   724  				var packedLen int
   725  				for shift := uint(0); ; shift += 7 {
   726  					if shift >= 64 {
   727  						return ErrIntOverflowPolicy
   728  					}
   729  					if iNdEx >= l {
   730  						return io.ErrUnexpectedEOF
   731  					}
   732  					b := dAtA[iNdEx]
   733  					iNdEx++
   734  					packedLen |= (int(b) & 0x7F) << shift
   735  					if b < 0x80 {
   736  						break
   737  					}
   738  				}
   739  				if packedLen < 0 {
   740  					return ErrInvalidLengthPolicy
   741  				}
   742  				postIndex := iNdEx + packedLen
   743  				if postIndex > l {
   744  					return io.ErrUnexpectedEOF
   745  				}
   746  				for iNdEx < postIndex {
   747  					var v aggregationpb.AggregationType
   748  					for shift := uint(0); ; shift += 7 {
   749  						if shift >= 64 {
   750  							return ErrIntOverflowPolicy
   751  						}
   752  						if iNdEx >= l {
   753  							return io.ErrUnexpectedEOF
   754  						}
   755  						b := dAtA[iNdEx]
   756  						iNdEx++
   757  						v |= (aggregationpb.AggregationType(b) & 0x7F) << shift
   758  						if b < 0x80 {
   759  							break
   760  						}
   761  					}
   762  					m.AggregationTypes = append(m.AggregationTypes, v)
   763  				}
   764  			} else {
   765  				return fmt.Errorf("proto: wrong wireType = %d for field AggregationTypes", wireType)
   766  			}
   767  		default:
   768  			iNdEx = preIndex
   769  			skippy, err := skipPolicy(dAtA[iNdEx:])
   770  			if err != nil {
   771  				return err
   772  			}
   773  			if skippy < 0 {
   774  				return ErrInvalidLengthPolicy
   775  			}
   776  			if (iNdEx + skippy) > l {
   777  				return io.ErrUnexpectedEOF
   778  			}
   779  			iNdEx += skippy
   780  		}
   781  	}
   782  
   783  	if iNdEx > l {
   784  		return io.ErrUnexpectedEOF
   785  	}
   786  	return nil
   787  }
   788  func skipPolicy(dAtA []byte) (n int, err error) {
   789  	l := len(dAtA)
   790  	iNdEx := 0
   791  	for iNdEx < l {
   792  		var wire uint64
   793  		for shift := uint(0); ; shift += 7 {
   794  			if shift >= 64 {
   795  				return 0, ErrIntOverflowPolicy
   796  			}
   797  			if iNdEx >= l {
   798  				return 0, io.ErrUnexpectedEOF
   799  			}
   800  			b := dAtA[iNdEx]
   801  			iNdEx++
   802  			wire |= (uint64(b) & 0x7F) << shift
   803  			if b < 0x80 {
   804  				break
   805  			}
   806  		}
   807  		wireType := int(wire & 0x7)
   808  		switch wireType {
   809  		case 0:
   810  			for shift := uint(0); ; shift += 7 {
   811  				if shift >= 64 {
   812  					return 0, ErrIntOverflowPolicy
   813  				}
   814  				if iNdEx >= l {
   815  					return 0, io.ErrUnexpectedEOF
   816  				}
   817  				iNdEx++
   818  				if dAtA[iNdEx-1] < 0x80 {
   819  					break
   820  				}
   821  			}
   822  			return iNdEx, nil
   823  		case 1:
   824  			iNdEx += 8
   825  			return iNdEx, nil
   826  		case 2:
   827  			var length int
   828  			for shift := uint(0); ; shift += 7 {
   829  				if shift >= 64 {
   830  					return 0, ErrIntOverflowPolicy
   831  				}
   832  				if iNdEx >= l {
   833  					return 0, io.ErrUnexpectedEOF
   834  				}
   835  				b := dAtA[iNdEx]
   836  				iNdEx++
   837  				length |= (int(b) & 0x7F) << shift
   838  				if b < 0x80 {
   839  					break
   840  				}
   841  			}
   842  			iNdEx += length
   843  			if length < 0 {
   844  				return 0, ErrInvalidLengthPolicy
   845  			}
   846  			return iNdEx, nil
   847  		case 3:
   848  			for {
   849  				var innerWire uint64
   850  				var start int = iNdEx
   851  				for shift := uint(0); ; shift += 7 {
   852  					if shift >= 64 {
   853  						return 0, ErrIntOverflowPolicy
   854  					}
   855  					if iNdEx >= l {
   856  						return 0, io.ErrUnexpectedEOF
   857  					}
   858  					b := dAtA[iNdEx]
   859  					iNdEx++
   860  					innerWire |= (uint64(b) & 0x7F) << shift
   861  					if b < 0x80 {
   862  						break
   863  					}
   864  				}
   865  				innerWireType := int(innerWire & 0x7)
   866  				if innerWireType == 4 {
   867  					break
   868  				}
   869  				next, err := skipPolicy(dAtA[start:])
   870  				if err != nil {
   871  					return 0, err
   872  				}
   873  				iNdEx = start + next
   874  			}
   875  			return iNdEx, nil
   876  		case 4:
   877  			return iNdEx, nil
   878  		case 5:
   879  			iNdEx += 4
   880  			return iNdEx, nil
   881  		default:
   882  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   883  		}
   884  	}
   885  	panic("unreachable")
   886  }
   887  
   888  var (
   889  	ErrInvalidLengthPolicy = fmt.Errorf("proto: negative length found during unmarshaling")
   890  	ErrIntOverflowPolicy   = fmt.Errorf("proto: integer overflow")
   891  )
   892  
   893  func init() {
   894  	proto.RegisterFile("github.com/m3db/m3/src/metrics/generated/proto/policypb/policy.proto", fileDescriptorPolicy)
   895  }
   896  
   897  var fileDescriptorPolicy = []byte{
   898  	// 420 bytes of a gzipped FileDescriptorProto
   899  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0x5d, 0x6b, 0x13, 0x41,
   900  	0x14, 0xcd, 0xa4, 0x25, 0x34, 0x37, 0xa4, 0xac, 0xa3, 0xd4, 0x50, 0x64, 0x5b, 0xd6, 0x97, 0x22,
   901  	0xb8, 0x0b, 0xc9, 0x43, 0x41, 0x50, 0x68, 0x8d, 0x62, 0xa9, 0xdd, 0x94, 0x4d, 0x7c, 0xd0, 0x97,
   902  	0x65, 0x3f, 0xc6, 0x71, 0xa0, 0xbb, 0x33, 0xcc, 0x4c, 0x28, 0xe9, 0xb3, 0x3f, 0xc0, 0x17, 0xff,
   903  	0x53, 0x1f, 0xfd, 0x05, 0x22, 0xf1, 0x8f, 0x48, 0x66, 0x27, 0xee, 0xee, 0xa3, 0xbe, 0xdd, 0x73,
   904  	0xee, 0x3d, 0xe7, 0x1e, 0xee, 0x0c, 0x4c, 0x29, 0xd3, 0x5f, 0x96, 0xa9, 0x9f, 0xf1, 0x22, 0x28,
   905  	0x26, 0x79, 0x1a, 0x14, 0x93, 0x40, 0xc9, 0x2c, 0x28, 0x88, 0x96, 0x2c, 0x53, 0x01, 0x25, 0x25,
   906  	0x91, 0x89, 0x26, 0x79, 0x20, 0x24, 0xd7, 0x3c, 0x10, 0xfc, 0x86, 0x65, 0x2b, 0x91, 0xda, 0xc2,
   907  	0x37, 0x2c, 0xde, 0xdb, 0xd2, 0x87, 0xcf, 0x1b, 0x7e, 0x94, 0x53, 0x5e, 0xc9, 0xd2, 0xe5, 0x67,
   908  	0x83, 0x2a, 0x8f, 0x4d, 0x55, 0x09, 0x0f, 0xc3, 0x7f, 0x5c, 0x9f, 0x50, 0x2a, 0x09, 0x4d, 0x34,
   909  	0xe3, 0xa5, 0x48, 0x9b, 0xa8, 0xf2, 0xf3, 0x2e, 0x01, 0x22, 0xa2, 0xf8, 0xcd, 0x72, 0xc3, 0xe1,
   910  	0x23, 0x18, 0xdc, 0xb2, 0x32, 0xe7, 0xb7, 0xb1, 0x62, 0x77, 0x64, 0x84, 0x8e, 0xd1, 0xc9, 0x4e,
   911  	0x04, 0x15, 0x35, 0x67, 0x77, 0x04, 0x3f, 0x81, 0xbe, 0x90, 0x24, 0x63, 0x8a, 0xf1, 0x72, 0xd4,
   912  	0x35, 0xed, 0x9a, 0xf0, 0x9e, 0x42, 0x3f, 0x22, 0x9a, 0x94, 0xc6, 0xeb, 0x00, 0x7a, 0x82, 0x48,
   913  	0xc6, 0x73, 0x6b, 0x63, 0x91, 0xf7, 0x15, 0xc1, 0x70, 0xae, 0xb9, 0x4c, 0x28, 0xb9, 0x36, 0x47,
   914  	0xc0, 0x2f, 0x00, 0xe4, 0xdf, 0x0c, 0x66, 0x7a, 0x30, 0x7e, 0xe4, 0x6f, 0x2f, 0xe4, 0xd7, 0xf9,
   915  	0xce, 0x77, 0xef, 0x7f, 0x1e, 0x75, 0xa2, 0xc6, 0x34, 0x3e, 0x85, 0xbe, 0xdc, 0xae, 0x34, 0x81,
   916  	0x06, 0xe3, 0x87, 0x4d, 0xa9, 0x6d, 0x59, 0x65, 0x3d, 0xeb, 0x7d, 0x47, 0xd0, 0xb3, 0xfb, 0x5f,
   917  	0xc1, 0xbe, 0xaa, 0x02, 0xc5, 0x95, 0xd2, 0x66, 0x78, 0x5c, 0x1b, 0xb5, 0x02, 0x47, 0x43, 0xd5,
   918  	0xca, 0x7f, 0x09, 0x0f, 0x1a, 0x87, 0x8d, 0xf5, 0x4a, 0x10, 0x35, 0xea, 0x1e, 0xef, 0x9c, 0xec,
   919  	0x8f, 0x5d, 0xbf, 0xf5, 0x00, 0xfe, 0x59, 0x8d, 0x16, 0x2b, 0x41, 0x22, 0x27, 0x69, 0x13, 0xea,
   920  	0xd9, 0x4b, 0x80, 0xa9, 0xe4, 0xc2, 0x5a, 0xef, 0xc1, 0x6e, 0x38, 0x0b, 0xdf, 0x38, 0x1d, 0x3c,
   921  	0x84, 0xfe, 0x34, 0x9a, 0x5d, 0xc7, 0x57, 0x1f, 0xe6, 0x0b, 0x07, 0xe1, 0x03, 0xc0, 0x06, 0x5e,
   922  	0xbc, 0x8d, 0x67, 0xe1, 0xfb, 0x8f, 0xf1, 0xd5, 0xd9, 0xe2, 0xf5, 0x3b, 0xa7, 0x7b, 0x7e, 0x71,
   923  	0xbf, 0x76, 0xd1, 0x8f, 0xb5, 0x8b, 0x7e, 0xad, 0x5d, 0xf4, 0xed, 0xb7, 0xdb, 0xf9, 0x74, 0xfa,
   924  	0x9f, 0x1f, 0x36, 0xed, 0x19, 0x3c, 0xf9, 0x13, 0x00, 0x00, 0xff, 0xff, 0x16, 0x63, 0x9d, 0x5c,
   925  	0xf2, 0x02, 0x00, 0x00,
   926  }