diff --git a/Makefile b/Makefile index e1ddf023c60..54bae78752e 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ all: generate # setup ######################## -apitools_img := gcr.io/istio-testing/api-build-tools:2019-07-30 +apitools_img := gcr.io/istio-testing/api-build-tools:2019-07-31 websitetools_img := gcr.io/istio-testing/website-tools:2019-07-25 cue_img := gcr.io/istio-testing/cue:2019-07-23 pwd := $(shell pwd) diff --git a/authentication/v1alpha1/policy.pb.go b/authentication/v1alpha1/policy.pb.go index 4589d0fd434..9110c212760 100644 --- a/authentication/v1alpha1/policy.pb.go +++ b/authentication/v1alpha1/policy.pb.go @@ -10,6 +10,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -106,7 +107,7 @@ func (m *StringMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_StringMatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -310,7 +311,7 @@ func (m *MutualTls) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_MutualTls.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -475,7 +476,7 @@ func (m *Jwt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Jwt.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -572,7 +573,7 @@ func (m *Jwt_TriggerRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_Jwt_TriggerRule.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -634,7 +635,7 @@ func (m *PeerAuthenticationMethod) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_PeerAuthenticationMethod.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -789,7 +790,7 @@ func (m *OriginAuthenticationMethod) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_OriginAuthenticationMethod.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -943,7 +944,7 @@ func (m *Policy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Policy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1050,7 +1051,7 @@ func (m *TargetSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_TargetSelector.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1117,7 +1118,7 @@ func (m *PortSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_PortSelector.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1317,7 +1318,7 @@ var fileDescriptor_30ec3f7cef93301a = []byte{ func (m *StringMatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1325,59 +1326,87 @@ func (m *StringMatch) Marshal() (dAtA []byte, err error) { } func (m *StringMatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StringMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.MatchType != nil { - nn1, err := m.MatchType.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.MatchType.Size() + i -= size + if _, err := m.MatchType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn1 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *StringMatch_Exact) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0xa - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *StringMatch_Exact) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Exact) + copy(dAtA[i:], m.Exact) i = encodeVarintPolicy(dAtA, i, uint64(len(m.Exact))) - i += copy(dAtA[i:], m.Exact) - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *StringMatch_Prefix) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *StringMatch_Prefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) i = encodeVarintPolicy(dAtA, i, uint64(len(m.Prefix))) - i += copy(dAtA[i:], m.Prefix) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *StringMatch_Suffix) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x1a - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *StringMatch_Suffix) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Suffix) + copy(dAtA[i:], m.Suffix) i = encodeVarintPolicy(dAtA, i, uint64(len(m.Suffix))) - i += copy(dAtA[i:], m.Suffix) - return i, nil + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil } func (m *StringMatch_Regex) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x22 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *StringMatch_Regex) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Regex) + copy(dAtA[i:], m.Regex) i = encodeVarintPolicy(dAtA, i, uint64(len(m.Regex))) - i += copy(dAtA[i:], m.Regex) - return i, nil + i-- + dAtA[i] = 0x22 + return len(dAtA) - i, nil } func (m *MutualTls) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1385,35 +1414,41 @@ func (m *MutualTls) Marshal() (dAtA []byte, err error) { } func (m *MutualTls) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MutualTls) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Mode != 0 { + i = encodeVarintPolicy(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x10 + } if m.AllowTls { - dAtA[i] = 0x8 - i++ + i-- if m.AllowTls { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.Mode != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintPolicy(dAtA, i, uint64(m.Mode)) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *Jwt) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1421,95 +1456,88 @@ func (m *Jwt) Marshal() (dAtA []byte, err error) { } func (m *Jwt) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Jwt) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Issuer) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintPolicy(dAtA, i, uint64(len(m.Issuer))) - i += copy(dAtA[i:], m.Issuer) - } - if len(m.Audiences) > 0 { - for _, s := range m.Audiences { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.JwksUri) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintPolicy(dAtA, i, uint64(len(m.JwksUri))) - i += copy(dAtA[i:], m.JwksUri) + if len(m.Jwks) > 0 { + i -= len(m.Jwks) + copy(dAtA[i:], m.Jwks) + i = encodeVarintPolicy(dAtA, i, uint64(len(m.Jwks))) + i-- + dAtA[i] = 0x52 } - if len(m.JwtHeaders) > 0 { - for _, s := range m.JwtHeaders { - dAtA[i] = 0x32 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if len(m.TriggerRules) > 0 { + for iNdEx := len(m.TriggerRules) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TriggerRules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPolicy(dAtA, i, uint64(size)) } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i-- + dAtA[i] = 0x4a } } if len(m.JwtParams) > 0 { - for _, s := range m.JwtParams { + for iNdEx := len(m.JwtParams) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.JwtParams[iNdEx]) + copy(dAtA[i:], m.JwtParams[iNdEx]) + i = encodeVarintPolicy(dAtA, i, uint64(len(m.JwtParams[iNdEx]))) + i-- dAtA[i] = 0x3a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if len(m.TriggerRules) > 0 { - for _, msg := range m.TriggerRules { - dAtA[i] = 0x4a - i++ - i = encodeVarintPolicy(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + if len(m.JwtHeaders) > 0 { + for iNdEx := len(m.JwtHeaders) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.JwtHeaders[iNdEx]) + copy(dAtA[i:], m.JwtHeaders[iNdEx]) + i = encodeVarintPolicy(dAtA, i, uint64(len(m.JwtHeaders[iNdEx]))) + i-- + dAtA[i] = 0x32 } } - if len(m.Jwks) > 0 { - dAtA[i] = 0x52 - i++ - i = encodeVarintPolicy(dAtA, i, uint64(len(m.Jwks))) - i += copy(dAtA[i:], m.Jwks) + if len(m.JwksUri) > 0 { + i -= len(m.JwksUri) + copy(dAtA[i:], m.JwksUri) + i = encodeVarintPolicy(dAtA, i, uint64(len(m.JwksUri))) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Audiences) > 0 { + for iNdEx := len(m.Audiences) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Audiences[iNdEx]) + copy(dAtA[i:], m.Audiences[iNdEx]) + i = encodeVarintPolicy(dAtA, i, uint64(len(m.Audiences[iNdEx]))) + i-- + dAtA[i] = 0x12 + } } - return i, nil + if len(m.Issuer) > 0 { + i -= len(m.Issuer) + copy(dAtA[i:], m.Issuer) + i = encodeVarintPolicy(dAtA, i, uint64(len(m.Issuer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Jwt_TriggerRule) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1517,44 +1545,54 @@ func (m *Jwt_TriggerRule) Marshal() (dAtA []byte, err error) { } func (m *Jwt_TriggerRule) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Jwt_TriggerRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ExcludedPaths) > 0 { - for _, msg := range m.ExcludedPaths { - dAtA[i] = 0xa - i++ - i = encodeVarintPolicy(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.IncludedPaths) > 0 { - for _, msg := range m.IncludedPaths { - dAtA[i] = 0x12 - i++ - i = encodeVarintPolicy(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.IncludedPaths) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.IncludedPaths[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPolicy(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ExcludedPaths) > 0 { + for iNdEx := len(m.ExcludedPaths) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ExcludedPaths[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPolicy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *PeerAuthenticationMethod) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1562,55 +1600,75 @@ func (m *PeerAuthenticationMethod) Marshal() (dAtA []byte, err error) { } func (m *PeerAuthenticationMethod) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PeerAuthenticationMethod) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Params != nil { - nn2, err := m.Params.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Params.Size() + i -= size + if _, err := m.Params.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn2 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *PeerAuthenticationMethod_Mtls) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *PeerAuthenticationMethod_Mtls) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Mtls != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintPolicy(dAtA, i, uint64(m.Mtls.Size())) - n3, err := m.Mtls.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Mtls.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPolicy(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *PeerAuthenticationMethod_Jwt) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *PeerAuthenticationMethod_Jwt) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Jwt != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintPolicy(dAtA, i, uint64(m.Jwt.Size())) - n4, err := m.Jwt.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Jwt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPolicy(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *OriginAuthenticationMethod) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1618,30 +1676,38 @@ func (m *OriginAuthenticationMethod) Marshal() (dAtA []byte, err error) { } func (m *OriginAuthenticationMethod) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OriginAuthenticationMethod) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Jwt != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintPolicy(dAtA, i, uint64(m.Jwt.Size())) - n5, err := m.Jwt.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Jwt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPolicy(dAtA, i, uint64(size)) } - i += n5 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Policy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1649,81 +1715,93 @@ func (m *Policy) Marshal() (dAtA []byte, err error) { } func (m *Policy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Policy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Targets) > 0 { - for _, msg := range m.Targets { - dAtA[i] = 0xa - i++ - i = encodeVarintPolicy(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Peers) > 0 { - for _, msg := range m.Peers { - dAtA[i] = 0x12 - i++ - i = encodeVarintPolicy(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.PrincipalBinding != 0 { + i = encodeVarintPolicy(dAtA, i, uint64(m.PrincipalBinding)) + i-- + dAtA[i] = 0x30 } - if m.PeerIsOptional { - dAtA[i] = 0x18 - i++ - if m.PeerIsOptional { + if m.OriginIsOptional { + i-- + if m.OriginIsOptional { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x28 } if len(m.Origins) > 0 { - for _, msg := range m.Origins { - dAtA[i] = 0x22 - i++ - i = encodeVarintPolicy(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Origins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Origins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPolicy(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x22 } } - if m.OriginIsOptional { - dAtA[i] = 0x28 - i++ - if m.OriginIsOptional { + if m.PeerIsOptional { + i-- + if m.PeerIsOptional { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - if m.PrincipalBinding != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintPolicy(dAtA, i, uint64(m.PrincipalBinding)) + if len(m.Peers) > 0 { + for iNdEx := len(m.Peers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Peers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPolicy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Targets) > 0 { + for iNdEx := len(m.Targets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Targets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPolicy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *TargetSelector) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1731,55 +1809,66 @@ func (m *TargetSelector) Marshal() (dAtA []byte, err error) { } func (m *TargetSelector) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TargetSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintPolicy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Ports) > 0 { - for _, msg := range m.Ports { - dAtA[i] = 0x12 - i++ - i = encodeVarintPolicy(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ + for k := range m.Labels { v := m.Labels[k] - mapSize := 1 + len(k) + sovPolicy(uint64(len(k))) + 1 + len(v) + sovPolicy(uint64(len(v))) - i = encodeVarintPolicy(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintPolicy(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) i = encodeVarintPolicy(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + i-- + dAtA[i] = 0xa + i = encodeVarintPolicy(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Ports) > 0 { + for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPolicy(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintPolicy(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintPolicy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *PortSelector) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1787,46 +1876,65 @@ func (m *PortSelector) Marshal() (dAtA []byte, err error) { } func (m *PortSelector) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PortSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Port != nil { - nn6, err := m.Port.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Port.Size() + i -= size + if _, err := m.Port.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn6 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *PortSelector_Number) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x8 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *PortSelector_Number) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintPolicy(dAtA, i, uint64(m.Number)) - return i, nil + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil } func (m *PortSelector_Name) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *PortSelector_Name) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintPolicy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func encodeVarintPolicy(dAtA []byte, offset int, v uint64) int { + offset -= sovPolicy(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *StringMatch) Size() (n int) { if m == nil { @@ -2133,14 +2241,7 @@ func (m *PortSelector_Name) Size() (n int) { } func sovPolicy(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozPolicy(x uint64) (n int) { return sovPolicy(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/envoy/config/filter/http/authn/v2alpha1/config.pb.go b/envoy/config/filter/http/authn/v2alpha1/config.pb.go index f2bce73daf2..e669bf7b9c7 100644 --- a/envoy/config/filter/http/authn/v2alpha1/config.pb.go +++ b/envoy/config/filter/http/authn/v2alpha1/config.pb.go @@ -9,6 +9,7 @@ import ( io "io" v1alpha1 "istio.io/api/authentication/v1alpha1" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -58,7 +59,7 @@ func (m *FilterConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_FilterConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -136,7 +137,7 @@ var fileDescriptor_b4b13c85ef974588 = []byte{ func (m *FilterConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -144,61 +145,73 @@ func (m *FilterConfig) Marshal() (dAtA []byte, err error) { } func (m *FilterConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FilterConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Policy != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.Policy.Size())) - n1, err := m.Policy.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.SkipValidateTrustDomain { + i-- + if m.SkipValidateTrustDomain { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } - i += n1 + i-- + dAtA[i] = 0x18 } if len(m.JwtOutputPayloadLocations) > 0 { - for k, _ := range m.JwtOutputPayloadLocations { - dAtA[i] = 0x12 - i++ + for k := range m.JwtOutputPayloadLocations { v := m.JwtOutputPayloadLocations[k] - mapSize := 1 + len(k) + sovConfig(uint64(len(k))) + 1 + len(v) + sovConfig(uint64(len(v))) - i = encodeVarintConfig(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintConfig(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) i = encodeVarintConfig(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + i-- + dAtA[i] = 0xa + i = encodeVarintConfig(dAtA, i, uint64(baseI-i)) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) } } - if m.SkipValidateTrustDomain { - dAtA[i] = 0x18 - i++ - if m.SkipValidateTrustDomain { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if m.Policy != nil { + { + size, err := m.Policy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) } - i++ - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintConfig(dAtA []byte, offset int, v uint64) int { + offset -= sovConfig(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *FilterConfig) Size() (n int) { if m == nil { @@ -228,14 +241,7 @@ func (m *FilterConfig) Size() (n int) { } func sovConfig(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozConfig(x uint64) (n int) { return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/envoy/config/filter/http/jwt_auth/v2alpha1/config.pb.go b/envoy/config/filter/http/jwt_auth/v2alpha1/config.pb.go index d05358fc7ea..ce38dbe30e5 100644 --- a/envoy/config/filter/http/jwt_auth/v2alpha1/config.pb.go +++ b/envoy/config/filter/http/jwt_auth/v2alpha1/config.pb.go @@ -9,6 +9,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -63,7 +64,7 @@ func (m *HttpUri) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_HttpUri.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -200,7 +201,7 @@ func (m *DataSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DataSource.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -454,7 +455,7 @@ func (m *JwtRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_JwtRule.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -659,7 +660,7 @@ func (m *RemoteJwks) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RemoteJwks.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -719,7 +720,7 @@ func (m *JwtHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_JwtHeader.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -779,7 +780,7 @@ func (m *JwtAuthentication) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_JwtAuthentication.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -875,7 +876,7 @@ var fileDescriptor_7c36de3e06e3b641 = []byte{ func (m *HttpUri) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -883,51 +884,67 @@ func (m *HttpUri) Marshal() (dAtA []byte, err error) { } func (m *HttpUri) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HttpUri) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Uri) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.Uri))) - i += copy(dAtA[i:], m.Uri) - } - if m.HttpUpstreamType != nil { - nn1, err := m.HttpUpstreamType.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn1 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Timeout != nil { + { + size, err := m.Timeout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.Timeout.Size())) - n2, err := m.Timeout.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + } + if m.HttpUpstreamType != nil { + { + size := m.HttpUpstreamType.Size() + i -= size + if _, err := m.HttpUpstreamType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += n2 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Uri) > 0 { + i -= len(m.Uri) + copy(dAtA[i:], m.Uri) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Uri))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HttpUri_Cluster) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *HttpUri_Cluster) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Cluster) + copy(dAtA[i:], m.Cluster) i = encodeVarintConfig(dAtA, i, uint64(len(m.Cluster))) - i += copy(dAtA[i:], m.Cluster) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *DataSource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -935,53 +952,76 @@ func (m *DataSource) Marshal() (dAtA []byte, err error) { } func (m *DataSource) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DataSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Specifier != nil { - nn3, err := m.Specifier.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Specifier.Size() + i -= size + if _, err := m.Specifier.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn3 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *DataSource_Filename) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0xa - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *DataSource_Filename) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Filename) + copy(dAtA[i:], m.Filename) i = encodeVarintConfig(dAtA, i, uint64(len(m.Filename))) - i += copy(dAtA[i:], m.Filename) - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *DataSource_InlineBytes) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *DataSource_InlineBytes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.InlineBytes != nil { - dAtA[i] = 0x12 - i++ + i -= len(m.InlineBytes) + copy(dAtA[i:], m.InlineBytes) i = encodeVarintConfig(dAtA, i, uint64(len(m.InlineBytes))) - i += copy(dAtA[i:], m.InlineBytes) + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *DataSource_InlineString) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x1a - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *DataSource_InlineString) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.InlineString) + copy(dAtA[i:], m.InlineString) i = encodeVarintConfig(dAtA, i, uint64(len(m.InlineString))) - i += copy(dAtA[i:], m.InlineString) - return i, nil + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil } func (m *JwtRule) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -989,119 +1029,131 @@ func (m *JwtRule) Marshal() (dAtA []byte, err error) { } func (m *JwtRule) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JwtRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Issuer) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.Issuer))) - i += copy(dAtA[i:], m.Issuer) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Audiences) > 0 { - for _, s := range m.Audiences { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.ForwardPayloadHeader) > 0 { + i -= len(m.ForwardPayloadHeader) + copy(dAtA[i:], m.ForwardPayloadHeader) + i = encodeVarintConfig(dAtA, i, uint64(len(m.ForwardPayloadHeader))) + i-- + dAtA[i] = 0x42 + } + if len(m.FromParams) > 0 { + for iNdEx := len(m.FromParams) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.FromParams[iNdEx]) + copy(dAtA[i:], m.FromParams[iNdEx]) + i = encodeVarintConfig(dAtA, i, uint64(len(m.FromParams[iNdEx]))) + i-- + dAtA[i] = 0x3a } } - if m.JwksSourceSpecifier != nil { - nn4, err := m.JwksSourceSpecifier.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.FromHeaders) > 0 { + for iNdEx := len(m.FromHeaders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FromHeaders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 } - i += nn4 } if m.Forward { - dAtA[i] = 0x28 - i++ + i-- if m.Forward { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x28 } - if len(m.FromHeaders) > 0 { - for _, msg := range m.FromHeaders { - dAtA[i] = 0x32 - i++ - i = encodeVarintConfig(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { + if m.JwksSourceSpecifier != nil { + { + size := m.JwksSourceSpecifier.Size() + i -= size + if _, err := m.JwksSourceSpecifier.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i += n } } - if len(m.FromParams) > 0 { - for _, s := range m.FromParams { - dAtA[i] = 0x3a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.Audiences) > 0 { + for iNdEx := len(m.Audiences) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Audiences[iNdEx]) + copy(dAtA[i:], m.Audiences[iNdEx]) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Audiences[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - if len(m.ForwardPayloadHeader) > 0 { - dAtA[i] = 0x42 - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.ForwardPayloadHeader))) - i += copy(dAtA[i:], m.ForwardPayloadHeader) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Issuer) > 0 { + i -= len(m.Issuer) + copy(dAtA[i:], m.Issuer) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Issuer))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *JwtRule_RemoteJwks) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *JwtRule_RemoteJwks) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.RemoteJwks != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.RemoteJwks.Size())) - n5, err := m.RemoteJwks.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.RemoteJwks.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *JwtRule_LocalJwks) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *JwtRule_LocalJwks) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.LocalJwks != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.LocalJwks.Size())) - n6, err := m.LocalJwks.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.LocalJwks.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *RemoteJwks) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1109,40 +1161,50 @@ func (m *RemoteJwks) Marshal() (dAtA []byte, err error) { } func (m *RemoteJwks) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoteJwks) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.HttpUri != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.HttpUri.Size())) - n7, err := m.HttpUri.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.CacheDuration != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.CacheDuration.Size())) - n8, err := m.CacheDuration.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.CacheDuration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.HttpUri != nil { + { + size, err := m.HttpUri.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *JwtHeader) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1150,32 +1212,40 @@ func (m *JwtHeader) Marshal() (dAtA []byte, err error) { } func (m *JwtHeader) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JwtHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.ValuePrefix) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.ValuePrefix) + copy(dAtA[i:], m.ValuePrefix) i = encodeVarintConfig(dAtA, i, uint64(len(m.ValuePrefix))) - i += copy(dAtA[i:], m.ValuePrefix) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *JwtAuthentication) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1183,46 +1253,56 @@ func (m *JwtAuthentication) Marshal() (dAtA []byte, err error) { } func (m *JwtAuthentication) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JwtAuthentication) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Rules) > 0 { - for _, msg := range m.Rules { - dAtA[i] = 0xa - i++ - i = encodeVarintConfig(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.AllowMissingOrFailed { - dAtA[i] = 0x10 - i++ + i-- if m.AllowMissingOrFailed { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Rules) > 0 { + for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func encodeVarintConfig(dAtA []byte, offset int, v uint64) int { + offset -= sovConfig(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *HttpUri) Size() (n int) { if m == nil { @@ -1434,14 +1514,7 @@ func (m *JwtAuthentication) Size() (n int) { } func sovConfig(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozConfig(x uint64) (n int) { return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/envoy/config/filter/network/tcp_cluster_rewrite/v2alpha1/config.pb.go b/envoy/config/filter/network/tcp_cluster_rewrite/v2alpha1/config.pb.go index f0e9caa049c..1ab369c24de 100644 --- a/envoy/config/filter/network/tcp_cluster_rewrite/v2alpha1/config.pb.go +++ b/envoy/config/filter/network/tcp_cluster_rewrite/v2alpha1/config.pb.go @@ -8,6 +8,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -46,7 +47,7 @@ func (m *TcpClusterRewrite) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_TcpClusterRewrite.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -108,7 +109,7 @@ var fileDescriptor_3df0613c72936227 = []byte{ func (m *TcpClusterRewrite) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -116,36 +117,46 @@ func (m *TcpClusterRewrite) Marshal() (dAtA []byte, err error) { } func (m *TcpClusterRewrite) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TcpClusterRewrite) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ClusterPattern) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.ClusterPattern))) - i += copy(dAtA[i:], m.ClusterPattern) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.ClusterReplacement) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.ClusterReplacement) + copy(dAtA[i:], m.ClusterReplacement) i = encodeVarintConfig(dAtA, i, uint64(len(m.ClusterReplacement))) - i += copy(dAtA[i:], m.ClusterReplacement) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ClusterPattern) > 0 { + i -= len(m.ClusterPattern) + copy(dAtA[i:], m.ClusterPattern) + i = encodeVarintConfig(dAtA, i, uint64(len(m.ClusterPattern))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintConfig(dAtA []byte, offset int, v uint64) int { + offset -= sovConfig(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *TcpClusterRewrite) Size() (n int) { if m == nil { @@ -168,14 +179,7 @@ func (m *TcpClusterRewrite) Size() (n int) { } func sovConfig(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozConfig(x uint64) (n int) { return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/go.mod b/go.mod index 7371c1b6139..4dc9a2a13bb 100644 --- a/go.mod +++ b/go.mod @@ -2,10 +2,8 @@ module istio.io/api go 1.12 -replace github.com/gogo/protobuf => github.com/istio/gogo-protobuf v1.2.2 - require ( github.com/gogo/googleapis v1.2.0 - github.com/gogo/protobuf v1.2.1 + github.com/gogo/protobuf v1.2.2-0.20190730201129-28a6bbf47e48 google.golang.org/grpc v1.21.0 ) diff --git a/go.sum b/go.sum index 9fb6b9bf4f6..405f9540550 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,10 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/gogo/googleapis v1.2.0 h1:Z0v3OJDotX9ZBpdz2V+AI7F4fITSZhVE5mg6GQppwMM= github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= +github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.2.2-0.20190730201129-28a6bbf47e48 h1:X+zN6RZXsvnrSJaAIQhZezPfAfvsqihKKR8oiLHid34= +github.com/gogo/protobuf v1.2.2-0.20190730201129-28a6bbf47e48/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -11,6 +15,9 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/istio/gogo-protobuf v1.2.2-0.20190726125433-4c9abdb3090c h1:nZ1jQm7wyjt21Zc6c1jtf3RVH375/Omgzq+INkXOkWg= github.com/istio/gogo-protobuf v1.2.2-0.20190726125433-4c9abdb3090c/go.mod h1:vfjn3j3y5/f0PSoVc2mvjpkYi6onwEz0eC1iLQrg8yY= +github.com/istio/gogo-protobuf v1.2.2 h1:owVNB2poNF89y6PVv7cqvbiEc64Oxmisu8DElon23wM= +github.com/istio/gogo-protobuf v1.2.2/go.mod h1:vfjn3j3y5/f0PSoVc2mvjpkYi6onwEz0eC1iLQrg8yY= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -24,6 +31,7 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= diff --git a/mcp/v1alpha1/mcp.pb.go b/mcp/v1alpha1/mcp.pb.go index c20686b0b42..d04fad8c5cb 100644 --- a/mcp/v1alpha1/mcp.pb.go +++ b/mcp/v1alpha1/mcp.pb.go @@ -11,8 +11,11 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -55,7 +58,7 @@ func (m *SinkNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SinkNode.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -136,7 +139,7 @@ func (m *MeshConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_MeshConfigRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -230,7 +233,7 @@ func (m *MeshConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_MeshConfigResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -324,7 +327,7 @@ func (m *IncrementalMeshConfigRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_IncrementalMeshConfigRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -424,7 +427,7 @@ func (m *IncrementalMeshConfigResponse) XXX_Marshal(b []byte, deterministic bool return xxx_messageInfo_IncrementalMeshConfigResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -527,7 +530,7 @@ func (m *RequestResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_RequestResources.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -651,7 +654,7 @@ func (m *Resources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Resources.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1191,6 +1194,17 @@ type AggregatedMeshConfigServiceServer interface { IncrementalAggregatedResources(AggregatedMeshConfigService_IncrementalAggregatedResourcesServer) error } +// UnimplementedAggregatedMeshConfigServiceServer can be embedded to have forward compatible implementations. +type UnimplementedAggregatedMeshConfigServiceServer struct { +} + +func (*UnimplementedAggregatedMeshConfigServiceServer) StreamAggregatedResources(srv AggregatedMeshConfigService_StreamAggregatedResourcesServer) error { + return status.Errorf(codes.Unimplemented, "method StreamAggregatedResources not implemented") +} +func (*UnimplementedAggregatedMeshConfigServiceServer) IncrementalAggregatedResources(srv AggregatedMeshConfigService_IncrementalAggregatedResourcesServer) error { + return status.Errorf(codes.Unimplemented, "method IncrementalAggregatedResources not implemented") +} + func RegisterAggregatedMeshConfigServiceServer(s *grpc.Server, srv AggregatedMeshConfigServiceServer) { s.RegisterService(&_AggregatedMeshConfigService_serviceDesc, srv) } @@ -1325,6 +1339,14 @@ type ResourceSourceServer interface { EstablishResourceStream(ResourceSource_EstablishResourceStreamServer) error } +// UnimplementedResourceSourceServer can be embedded to have forward compatible implementations. +type UnimplementedResourceSourceServer struct { +} + +func (*UnimplementedResourceSourceServer) EstablishResourceStream(srv ResourceSource_EstablishResourceStreamServer) error { + return status.Errorf(codes.Unimplemented, "method EstablishResourceStream not implemented") +} + func RegisterResourceSourceServer(s *grpc.Server, srv ResourceSourceServer) { s.RegisterService(&_ResourceSource_serviceDesc, srv) } @@ -1427,6 +1449,14 @@ type ResourceSinkServer interface { EstablishResourceStream(ResourceSink_EstablishResourceStreamServer) error } +// UnimplementedResourceSinkServer can be embedded to have forward compatible implementations. +type UnimplementedResourceSinkServer struct { +} + +func (*UnimplementedResourceSinkServer) EstablishResourceStream(srv ResourceSink_EstablishResourceStreamServer) error { + return status.Errorf(codes.Unimplemented, "method EstablishResourceStream not implemented") +} + func RegisterResourceSinkServer(s *grpc.Server, srv ResourceSinkServer) { s.RegisterService(&_ResourceSink_serviceDesc, srv) } @@ -1475,7 +1505,7 @@ var _ResourceSink_serviceDesc = grpc.ServiceDesc{ func (m *SinkNode) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1483,43 +1513,52 @@ func (m *SinkNode) Marshal() (dAtA []byte, err error) { } func (m *SinkNode) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SinkNode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Id) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(m.Id))) - i += copy(dAtA[i:], m.Id) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Annotations) > 0 { - for k, _ := range m.Annotations { - dAtA[i] = 0x12 - i++ + for k := range m.Annotations { v := m.Annotations[k] - mapSize := 1 + len(k) + sovMcp(uint64(len(k))) + 1 + len(v) + sovMcp(uint64(len(v))) - i = encodeVarintMcp(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintMcp(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) i = encodeVarintMcp(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + i-- + dAtA[i] = 0xa + i = encodeVarintMcp(dAtA, i, uint64(baseI-i)) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintMcp(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MeshConfigRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1527,58 +1566,71 @@ func (m *MeshConfigRequest) Marshal() (dAtA []byte, err error) { } func (m *MeshConfigRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MeshConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.VersionInfo) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(m.VersionInfo))) - i += copy(dAtA[i:], m.VersionInfo) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.SinkNode != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintMcp(dAtA, i, uint64(m.SinkNode.Size())) - n1, err := m.SinkNode.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ErrorDetail != nil { + { + size, err := m.ErrorDetail.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMcp(dAtA, i, uint64(size)) } - i += n1 - } - if len(m.TypeUrl) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(m.TypeUrl))) - i += copy(dAtA[i:], m.TypeUrl) + i-- + dAtA[i] = 0x2a } if len(m.ResponseNonce) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.ResponseNonce) + copy(dAtA[i:], m.ResponseNonce) i = encodeVarintMcp(dAtA, i, uint64(len(m.ResponseNonce))) - i += copy(dAtA[i:], m.ResponseNonce) + i-- + dAtA[i] = 0x22 } - if m.ErrorDetail != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintMcp(dAtA, i, uint64(m.ErrorDetail.Size())) - n2, err := m.ErrorDetail.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.TypeUrl) > 0 { + i -= len(m.TypeUrl) + copy(dAtA[i:], m.TypeUrl) + i = encodeVarintMcp(dAtA, i, uint64(len(m.TypeUrl))) + i-- + dAtA[i] = 0x1a + } + if m.SinkNode != nil { + { + size, err := m.SinkNode.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMcp(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.VersionInfo) > 0 { + i -= len(m.VersionInfo) + copy(dAtA[i:], m.VersionInfo) + i = encodeVarintMcp(dAtA, i, uint64(len(m.VersionInfo))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MeshConfigResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1586,50 +1638,61 @@ func (m *MeshConfigResponse) Marshal() (dAtA []byte, err error) { } func (m *MeshConfigResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MeshConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.VersionInfo) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(m.VersionInfo))) - i += copy(dAtA[i:], m.VersionInfo) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - dAtA[i] = 0x12 - i++ - i = encodeVarintMcp(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if len(m.Nonce) > 0 { + i -= len(m.Nonce) + copy(dAtA[i:], m.Nonce) + i = encodeVarintMcp(dAtA, i, uint64(len(m.Nonce))) + i-- + dAtA[i] = 0x22 } if len(m.TypeUrl) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.TypeUrl) + copy(dAtA[i:], m.TypeUrl) i = encodeVarintMcp(dAtA, i, uint64(len(m.TypeUrl))) - i += copy(dAtA[i:], m.TypeUrl) + i-- + dAtA[i] = 0x1a } - if len(m.Nonce) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(m.Nonce))) - i += copy(dAtA[i:], m.Nonce) + if len(m.Resources) > 0 { + for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMcp(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.VersionInfo) > 0 { + i -= len(m.VersionInfo) + copy(dAtA[i:], m.VersionInfo) + i = encodeVarintMcp(dAtA, i, uint64(len(m.VersionInfo))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *IncrementalMeshConfigRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1637,69 +1700,83 @@ func (m *IncrementalMeshConfigRequest) Marshal() (dAtA []byte, err error) { } func (m *IncrementalMeshConfigRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IncrementalMeshConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.SinkNode != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintMcp(dAtA, i, uint64(m.SinkNode.Size())) - n3, err := m.SinkNode.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ErrorDetail != nil { + { + size, err := m.ErrorDetail.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMcp(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x2a } - if len(m.TypeUrl) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(m.TypeUrl))) - i += copy(dAtA[i:], m.TypeUrl) + if len(m.ResponseNonce) > 0 { + i -= len(m.ResponseNonce) + copy(dAtA[i:], m.ResponseNonce) + i = encodeVarintMcp(dAtA, i, uint64(len(m.ResponseNonce))) + i-- + dAtA[i] = 0x22 } if len(m.InitialResourceVersions) > 0 { - for k, _ := range m.InitialResourceVersions { - dAtA[i] = 0x1a - i++ + for k := range m.InitialResourceVersions { v := m.InitialResourceVersions[k] - mapSize := 1 + len(k) + sovMcp(uint64(len(k))) + 1 + len(v) + sovMcp(uint64(len(v))) - i = encodeVarintMcp(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintMcp(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintMcp(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintMcp(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - if len(m.ResponseNonce) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(m.ResponseNonce))) - i += copy(dAtA[i:], m.ResponseNonce) + if len(m.TypeUrl) > 0 { + i -= len(m.TypeUrl) + copy(dAtA[i:], m.TypeUrl) + i = encodeVarintMcp(dAtA, i, uint64(len(m.TypeUrl))) + i-- + dAtA[i] = 0x12 } - if m.ErrorDetail != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintMcp(dAtA, i, uint64(m.ErrorDetail.Size())) - n4, err := m.ErrorDetail.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.SinkNode != nil { + { + size, err := m.SinkNode.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMcp(dAtA, i, uint64(size)) } - i += n4 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *IncrementalMeshConfigResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1707,59 +1784,63 @@ func (m *IncrementalMeshConfigResponse) Marshal() (dAtA []byte, err error) { } func (m *IncrementalMeshConfigResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IncrementalMeshConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SystemVersionInfo) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(m.SystemVersionInfo))) - i += copy(dAtA[i:], m.SystemVersionInfo) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - dAtA[i] = 0x12 - i++ - i = encodeVarintMcp(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if len(m.Nonce) > 0 { + i -= len(m.Nonce) + copy(dAtA[i:], m.Nonce) + i = encodeVarintMcp(dAtA, i, uint64(len(m.Nonce))) + i-- + dAtA[i] = 0x22 } if len(m.RemovedResources) > 0 { - for _, s := range m.RemovedResources { + for iNdEx := len(m.RemovedResources) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RemovedResources[iNdEx]) + copy(dAtA[i:], m.RemovedResources[iNdEx]) + i = encodeVarintMcp(dAtA, i, uint64(len(m.RemovedResources[iNdEx]))) + i-- dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if len(m.Nonce) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(m.Nonce))) - i += copy(dAtA[i:], m.Nonce) + if len(m.Resources) > 0 { + for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMcp(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.SystemVersionInfo) > 0 { + i -= len(m.SystemVersionInfo) + copy(dAtA[i:], m.SystemVersionInfo) + i = encodeVarintMcp(dAtA, i, uint64(len(m.SystemVersionInfo))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RequestResources) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1767,79 +1848,93 @@ func (m *RequestResources) Marshal() (dAtA []byte, err error) { } func (m *RequestResources) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.SinkNode != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintMcp(dAtA, i, uint64(m.SinkNode.Size())) - n5, err := m.SinkNode.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Collection) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(m.Collection))) - i += copy(dAtA[i:], m.Collection) + if m.Incremental { + i-- + if m.Incremental { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 } - if len(m.InitialResourceVersions) > 0 { - for k, _ := range m.InitialResourceVersions { - dAtA[i] = 0x1a - i++ - v := m.InitialResourceVersions[k] - mapSize := 1 + len(k) + sovMcp(uint64(len(k))) + 1 + len(v) + sovMcp(uint64(len(v))) - i = encodeVarintMcp(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + if m.ErrorDetail != nil { + { + size, err := m.ErrorDetail.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMcp(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x2a } if len(m.ResponseNonce) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.ResponseNonce) + copy(dAtA[i:], m.ResponseNonce) i = encodeVarintMcp(dAtA, i, uint64(len(m.ResponseNonce))) - i += copy(dAtA[i:], m.ResponseNonce) + i-- + dAtA[i] = 0x22 } - if m.ErrorDetail != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintMcp(dAtA, i, uint64(m.ErrorDetail.Size())) - n6, err := m.ErrorDetail.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.InitialResourceVersions) > 0 { + for k := range m.InitialResourceVersions { + v := m.InitialResourceVersions[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintMcp(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintMcp(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintMcp(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } - i += n6 } - if m.Incremental { - dAtA[i] = 0x30 - i++ - if m.Incremental { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ + if len(m.Collection) > 0 { + i -= len(m.Collection) + copy(dAtA[i:], m.Collection) + i = encodeVarintMcp(dAtA, i, uint64(len(m.Collection))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.SinkNode != nil { + { + size, err := m.SinkNode.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMcp(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Resources) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1847,79 +1942,86 @@ func (m *Resources) Marshal() (dAtA []byte, err error) { } func (m *Resources) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Resources) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SystemVersionInfo) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(m.SystemVersionInfo))) - i += copy(dAtA[i:], m.SystemVersionInfo) - } - if len(m.Collection) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(m.Collection))) - i += copy(dAtA[i:], m.Collection) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - dAtA[i] = 0x1a - i++ - i = encodeVarintMcp(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + if m.Incremental { + i-- + if m.Incremental { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i-- + dAtA[i] = 0x30 + } + if len(m.Nonce) > 0 { + i -= len(m.Nonce) + copy(dAtA[i:], m.Nonce) + i = encodeVarintMcp(dAtA, i, uint64(len(m.Nonce))) + i-- + dAtA[i] = 0x2a } if len(m.RemovedResources) > 0 { - for _, s := range m.RemovedResources { + for iNdEx := len(m.RemovedResources) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RemovedResources[iNdEx]) + copy(dAtA[i:], m.RemovedResources[iNdEx]) + i = encodeVarintMcp(dAtA, i, uint64(len(m.RemovedResources[iNdEx]))) + i-- dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if len(m.Nonce) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintMcp(dAtA, i, uint64(len(m.Nonce))) - i += copy(dAtA[i:], m.Nonce) - } - if m.Incremental { - dAtA[i] = 0x30 - i++ - if m.Incremental { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if len(m.Resources) > 0 { + for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMcp(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - i++ } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Collection) > 0 { + i -= len(m.Collection) + copy(dAtA[i:], m.Collection) + i = encodeVarintMcp(dAtA, i, uint64(len(m.Collection))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.SystemVersionInfo) > 0 { + i -= len(m.SystemVersionInfo) + copy(dAtA[i:], m.SystemVersionInfo) + i = encodeVarintMcp(dAtA, i, uint64(len(m.SystemVersionInfo))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func encodeVarintMcp(dAtA []byte, offset int, v uint64) int { + offset -= sovMcp(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *SinkNode) Size() (n int) { if m == nil { @@ -2154,14 +2256,7 @@ func (m *Resources) Size() (n int) { } func sovMcp(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozMcp(x uint64) (n int) { return sovMcp(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/mcp/v1alpha1/metadata.pb.go b/mcp/v1alpha1/metadata.pb.go index 3526a98e1df..29bd9f3f9ff 100644 --- a/mcp/v1alpha1/metadata.pb.go +++ b/mcp/v1alpha1/metadata.pb.go @@ -11,6 +11,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -89,7 +90,7 @@ func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Metadata.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -228,7 +229,7 @@ func (this *Metadata) Equal(that interface{}) bool { func (m *Metadata) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -236,80 +237,96 @@ func (m *Metadata) Marshal() (dAtA []byte, err error) { } func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintMetadata(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.CreateTime != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintMetadata(dAtA, i, uint64(m.CreateTime.Size())) - n1, err := m.CreateTime.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Annotations) > 0 { + for k := range m.Annotations { + v := m.Annotations[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintMetadata(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintMetadata(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintMetadata(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a } - i += n1 - } - if len(m.Version) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintMetadata(dAtA, i, uint64(len(m.Version))) - i += copy(dAtA[i:], m.Version) } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x22 - i++ + for k := range m.Labels { v := m.Labels[k] - mapSize := 1 + len(k) + sovMetadata(uint64(len(k))) + 1 + len(v) + sovMetadata(uint64(len(v))) - i = encodeVarintMetadata(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintMetadata(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintMetadata(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintMetadata(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintMetadata(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 } } - if len(m.Annotations) > 0 { - for k, _ := range m.Annotations { - dAtA[i] = 0x2a - i++ - v := m.Annotations[k] - mapSize := 1 + len(k) + sovMetadata(uint64(len(k))) + 1 + len(v) + sovMetadata(uint64(len(v))) - i = encodeVarintMetadata(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintMetadata(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintMetadata(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x1a + } + if m.CreateTime != nil { + { + size, err := m.CreateTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetadata(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintMetadata(dAtA []byte, offset int, v uint64) int { + offset -= sovMetadata(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Metadata) Size() (n int) { if m == nil { @@ -352,14 +369,7 @@ func (m *Metadata) Size() (n int) { } func sovMetadata(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozMetadata(x uint64) (n int) { return sovMetadata(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/mcp/v1alpha1/resource.pb.go b/mcp/v1alpha1/resource.pb.go index 53c10d90d11..946f913e598 100644 --- a/mcp/v1alpha1/resource.pb.go +++ b/mcp/v1alpha1/resource.pb.go @@ -13,6 +13,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -52,7 +53,7 @@ func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Resource.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -141,7 +142,7 @@ func (this *Resource) Equal(that interface{}) bool { func (m *Resource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -149,44 +150,56 @@ func (m *Resource) Marshal() (dAtA []byte, err error) { } func (m *Resource) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Metadata != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintResource(dAtA, i, uint64(m.Metadata.Size())) - n1, err := m.Metadata.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Body != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintResource(dAtA, i, uint64(m.Body.Size())) - n2, err := m.Body.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Body.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResource(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResource(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintResource(dAtA []byte, offset int, v uint64) int { + offset -= sovResource(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Resource) Size() (n int) { if m == nil { @@ -209,14 +222,7 @@ func (m *Resource) Size() (n int) { } func sovResource(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozResource(x uint64) (n int) { return sovResource(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/mesh/v1alpha1/config.pb.go b/mesh/v1alpha1/config.pb.go index 71c54c1e4c9..11aaeb7b6ec 100644 --- a/mesh/v1alpha1/config.pb.go +++ b/mesh/v1alpha1/config.pb.go @@ -12,6 +12,7 @@ import ( io "io" v1alpha3 "istio.io/api/networking/v1alpha3" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -374,7 +375,7 @@ func (m *MeshConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_MeshConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -691,7 +692,7 @@ func (m *MeshConfig_OutboundTrafficPolicy) XXX_Marshal(b []byte, deterministic b return xxx_messageInfo_MeshConfig_OutboundTrafficPolicy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -748,7 +749,7 @@ func (m *ConfigSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_ConfigSource.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -858,7 +859,7 @@ func (m *LocalityLoadBalancerSetting) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_LocalityLoadBalancerSetting.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -926,7 +927,7 @@ func (m *LocalityLoadBalancerSetting_Distribute) XXX_Marshal(b []byte, determini return xxx_messageInfo_LocalityLoadBalancerSetting_Distribute.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -991,7 +992,7 @@ func (m *LocalityLoadBalancerSetting_Failover) XXX_Marshal(b []byte, determinist return xxx_messageInfo_LocalityLoadBalancerSetting_Failover.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1150,7 +1151,7 @@ var fileDescriptor_b5c7ece76d5d5022 = []byte{ func (m *MeshConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1158,402 +1159,420 @@ func (m *MeshConfig) Marshal() (dAtA []byte, err error) { } func (m *MeshConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MeshConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.MixerCheckServer) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.MixerCheckServer))) - i += copy(dAtA[i:], m.MixerCheckServer) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.MixerReportServer) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.MixerReportServer))) - i += copy(dAtA[i:], m.MixerReportServer) + if m.H2UpgradePolicy != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.H2UpgradePolicy)) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xc8 } - if m.DisablePolicyChecks { - dAtA[i] = 0x18 - i++ - if m.DisablePolicyChecks { + if m.EnableEnvoyAccessLogService { + i-- + if m.EnableEnvoyAccessLogService { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.ProxyListenPort != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.ProxyListenPort)) - } - if m.ProxyHttpPort != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.ProxyHttpPort)) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xc0 } - if m.ConnectTimeout != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.ConnectTimeout.Size())) - n1, err := m.ConnectTimeout.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ReportBatchMaxTime != nil { + { + size, err := m.ReportBatchMaxTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) } - i += n1 - } - if len(m.IngressClass) > 0 { - dAtA[i] = 0x3a - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.IngressClass))) - i += copy(dAtA[i:], m.IngressClass) - } - if len(m.IngressService) > 0 { - dAtA[i] = 0x42 - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.IngressService))) - i += copy(dAtA[i:], m.IngressService) - } - if m.IngressControllerMode != 0 { - dAtA[i] = 0x48 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.IngressControllerMode)) - } - if m.AuthPolicy != 0 { - dAtA[i] = 0x50 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.AuthPolicy)) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xba } - if m.RdsRefreshDelay != nil { - dAtA[i] = 0x5a - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.RdsRefreshDelay.Size())) - n2, err := m.RdsRefreshDelay.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 + if m.ReportBatchMaxEntries != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.ReportBatchMaxEntries)) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xb0 } - if m.EnableTracing { - dAtA[i] = 0x60 - i++ - if m.EnableTracing { + if m.DisableReportBatch { + i-- + if m.DisableReportBatch { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if len(m.AccessLogFile) > 0 { - dAtA[i] = 0x6a - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.AccessLogFile))) - i += copy(dAtA[i:], m.AccessLogFile) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xa8 } - if m.DefaultConfig != nil { - dAtA[i] = 0x72 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.DefaultConfig.Size())) - n3, err := m.DefaultConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.DnsRefreshRate != nil { + { + size, err := m.DnsRefreshRate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) } - i += n3 - } - if len(m.MixerAddress) > 0 { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.MixerAddress))) - i += copy(dAtA[i:], m.MixerAddress) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xa2 } - if m.OutboundTrafficPolicy != nil { - dAtA[i] = 0x8a - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.OutboundTrafficPolicy.Size())) - n4, err := m.OutboundTrafficPolicy.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.LocalityLbSetting != nil { + { + size, err := m.LocalityLbSetting.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x9a } - if m.EnableClientSidePolicyCheck { - dAtA[i] = 0x98 - i++ - dAtA[i] = 0x1 - i++ - if m.EnableClientSidePolicyCheck { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ + if len(m.RootNamespace) > 0 { + i -= len(m.RootNamespace) + copy(dAtA[i:], m.RootNamespace) + i = encodeVarintConfig(dAtA, i, uint64(len(m.RootNamespace))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x92 } - if len(m.SdsUdsPath) > 0 { - dAtA[i] = 0xa2 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.SdsUdsPath))) - i += copy(dAtA[i:], m.SdsUdsPath) + if len(m.DefaultDestinationRuleExportTo) > 0 { + for iNdEx := len(m.DefaultDestinationRuleExportTo) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DefaultDestinationRuleExportTo[iNdEx]) + copy(dAtA[i:], m.DefaultDestinationRuleExportTo[iNdEx]) + i = encodeVarintConfig(dAtA, i, uint64(len(m.DefaultDestinationRuleExportTo[iNdEx]))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x8a + } } - if m.SdsRefreshDelay != nil { - dAtA[i] = 0xaa - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.SdsRefreshDelay.Size())) - n5, err := m.SdsRefreshDelay.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.DefaultVirtualServiceExportTo) > 0 { + for iNdEx := len(m.DefaultVirtualServiceExportTo) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DefaultVirtualServiceExportTo[iNdEx]) + copy(dAtA[i:], m.DefaultVirtualServiceExportTo[iNdEx]) + i = encodeVarintConfig(dAtA, i, uint64(len(m.DefaultVirtualServiceExportTo[iNdEx]))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x82 } - i += n5 } - if len(m.ConfigSources) > 0 { - for _, msg := range m.ConfigSources { - dAtA[i] = 0xb2 - i++ + if len(m.DefaultServiceExportTo) > 0 { + for iNdEx := len(m.DefaultServiceExportTo) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DefaultServiceExportTo[iNdEx]) + copy(dAtA[i:], m.DefaultServiceExportTo[iNdEx]) + i = encodeVarintConfig(dAtA, i, uint64(len(m.DefaultServiceExportTo[iNdEx]))) + i-- dAtA[i] = 0x1 - i++ - i = encodeVarintConfig(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + i-- + dAtA[i] = 0xfa } } - if m.EnableSdsTokenMount { - dAtA[i] = 0xb8 - i++ - dAtA[i] = 0x1 - i++ - if m.EnableSdsTokenMount { + if m.SidecarToTelemetrySessionAffinity { + i-- + if m.SidecarToTelemetrySessionAffinity { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if len(m.AccessLogFormat) > 0 { - dAtA[i] = 0xc2 - i++ + i-- dAtA[i] = 0x1 - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.AccessLogFormat))) - i += copy(dAtA[i:], m.AccessLogFormat) + i-- + dAtA[i] = 0xf0 } - if m.PolicyCheckFailOpen { - dAtA[i] = 0xc8 - i++ - dAtA[i] = 0x1 - i++ - if m.PolicyCheckFailOpen { + if m.SdsUseK8SSaJwt { + i-- + if m.SdsUseK8SSaJwt { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xe8 } - if len(m.TrustDomain) > 0 { - dAtA[i] = 0xd2 - i++ + if m.TcpKeepalive != nil { + { + size, err := m.TcpKeepalive.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1 - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.TrustDomain))) - i += copy(dAtA[i:], m.TrustDomain) + i-- + dAtA[i] = 0xe2 } if m.AccessLogEncoding != 0 { - dAtA[i] = 0xd8 - i++ - dAtA[i] = 0x1 - i++ i = encodeVarintConfig(dAtA, i, uint64(m.AccessLogEncoding)) - } - if m.TcpKeepalive != nil { - dAtA[i] = 0xe2 - i++ + i-- dAtA[i] = 0x1 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.TcpKeepalive.Size())) - n6, err := m.TcpKeepalive.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 + i-- + dAtA[i] = 0xd8 } - if m.SdsUseK8SSaJwt { - dAtA[i] = 0xe8 - i++ + if len(m.TrustDomain) > 0 { + i -= len(m.TrustDomain) + copy(dAtA[i:], m.TrustDomain) + i = encodeVarintConfig(dAtA, i, uint64(len(m.TrustDomain))) + i-- dAtA[i] = 0x1 - i++ - if m.SdsUseK8SSaJwt { + i-- + dAtA[i] = 0xd2 + } + if m.PolicyCheckFailOpen { + i-- + if m.PolicyCheckFailOpen { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc8 } - if m.SidecarToTelemetrySessionAffinity { - dAtA[i] = 0xf0 - i++ + if len(m.AccessLogFormat) > 0 { + i -= len(m.AccessLogFormat) + copy(dAtA[i:], m.AccessLogFormat) + i = encodeVarintConfig(dAtA, i, uint64(len(m.AccessLogFormat))) + i-- dAtA[i] = 0x1 - i++ - if m.SidecarToTelemetrySessionAffinity { + i-- + dAtA[i] = 0xc2 + } + if m.EnableSdsTokenMount { + i-- + if m.EnableSdsTokenMount { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb8 } - if len(m.DefaultServiceExportTo) > 0 { - for _, s := range m.DefaultServiceExportTo { - dAtA[i] = 0xfa - i++ - dAtA[i] = 0x1 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if len(m.ConfigSources) > 0 { + for iNdEx := len(m.ConfigSources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ConfigSources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 } } - if len(m.DefaultVirtualServiceExportTo) > 0 { - for _, s := range m.DefaultVirtualServiceExportTo { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x2 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if m.SdsRefreshDelay != nil { + { + size, err := m.SdsRefreshDelay.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa } - if len(m.DefaultDestinationRuleExportTo) > 0 { - for _, s := range m.DefaultDestinationRuleExportTo { - dAtA[i] = 0x8a - i++ - dAtA[i] = 0x2 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if len(m.SdsUdsPath) > 0 { + i -= len(m.SdsUdsPath) + copy(dAtA[i:], m.SdsUdsPath) + i = encodeVarintConfig(dAtA, i, uint64(len(m.SdsUdsPath))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if m.EnableClientSidePolicyCheck { + i-- + if m.EnableClientSidePolicyCheck { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + } + if m.OutboundTrafficPolicy != nil { + { + size, err := m.OutboundTrafficPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a } - if len(m.RootNamespace) > 0 { - dAtA[i] = 0x92 - i++ - dAtA[i] = 0x2 - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.RootNamespace))) - i += copy(dAtA[i:], m.RootNamespace) + if len(m.MixerAddress) > 0 { + i -= len(m.MixerAddress) + copy(dAtA[i:], m.MixerAddress) + i = encodeVarintConfig(dAtA, i, uint64(len(m.MixerAddress))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 } - if m.LocalityLbSetting != nil { - dAtA[i] = 0x9a - i++ - dAtA[i] = 0x2 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.LocalityLbSetting.Size())) - n7, err := m.LocalityLbSetting.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.DefaultConfig != nil { + { + size, err := m.DefaultConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x72 } - if m.DnsRefreshRate != nil { - dAtA[i] = 0xa2 - i++ - dAtA[i] = 0x2 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.DnsRefreshRate.Size())) - n8, err := m.DnsRefreshRate.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n8 + if len(m.AccessLogFile) > 0 { + i -= len(m.AccessLogFile) + copy(dAtA[i:], m.AccessLogFile) + i = encodeVarintConfig(dAtA, i, uint64(len(m.AccessLogFile))) + i-- + dAtA[i] = 0x6a } - if m.DisableReportBatch { - dAtA[i] = 0xa8 - i++ - dAtA[i] = 0x2 - i++ - if m.DisableReportBatch { + if m.EnableTracing { + i-- + if m.EnableTracing { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x60 } - if m.ReportBatchMaxEntries != 0 { - dAtA[i] = 0xb0 - i++ - dAtA[i] = 0x2 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.ReportBatchMaxEntries)) + if m.RdsRefreshDelay != nil { + { + size, err := m.RdsRefreshDelay.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a } - if m.ReportBatchMaxTime != nil { - dAtA[i] = 0xba - i++ - dAtA[i] = 0x2 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.ReportBatchMaxTime.Size())) - n9, err := m.ReportBatchMaxTime.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AuthPolicy != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.AuthPolicy)) + i-- + dAtA[i] = 0x50 + } + if m.IngressControllerMode != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.IngressControllerMode)) + i-- + dAtA[i] = 0x48 + } + if len(m.IngressService) > 0 { + i -= len(m.IngressService) + copy(dAtA[i:], m.IngressService) + i = encodeVarintConfig(dAtA, i, uint64(len(m.IngressService))) + i-- + dAtA[i] = 0x42 + } + if len(m.IngressClass) > 0 { + i -= len(m.IngressClass) + copy(dAtA[i:], m.IngressClass) + i = encodeVarintConfig(dAtA, i, uint64(len(m.IngressClass))) + i-- + dAtA[i] = 0x3a + } + if m.ConnectTimeout != nil { + { + size, err := m.ConnectTimeout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x32 } - if m.EnableEnvoyAccessLogService { - dAtA[i] = 0xc0 - i++ - dAtA[i] = 0x2 - i++ - if m.EnableEnvoyAccessLogService { + if m.ProxyHttpPort != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.ProxyHttpPort)) + i-- + dAtA[i] = 0x28 + } + if m.ProxyListenPort != 0 { + i = encodeVarintConfig(dAtA, i, uint64(m.ProxyListenPort)) + i-- + dAtA[i] = 0x20 + } + if m.DisablePolicyChecks { + i-- + if m.DisablePolicyChecks { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - if m.H2UpgradePolicy != 0 { - dAtA[i] = 0xc8 - i++ - dAtA[i] = 0x2 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.H2UpgradePolicy)) + if len(m.MixerReportServer) > 0 { + i -= len(m.MixerReportServer) + copy(dAtA[i:], m.MixerReportServer) + i = encodeVarintConfig(dAtA, i, uint64(len(m.MixerReportServer))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.MixerCheckServer) > 0 { + i -= len(m.MixerCheckServer) + copy(dAtA[i:], m.MixerCheckServer) + i = encodeVarintConfig(dAtA, i, uint64(len(m.MixerCheckServer))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MeshConfig_OutboundTrafficPolicy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1561,25 +1580,31 @@ func (m *MeshConfig_OutboundTrafficPolicy) Marshal() (dAtA []byte, err error) { } func (m *MeshConfig_OutboundTrafficPolicy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MeshConfig_OutboundTrafficPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Mode != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintConfig(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigSource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1587,36 +1612,45 @@ func (m *ConfigSource) Marshal() (dAtA []byte, err error) { } func (m *ConfigSource) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Address) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.Address))) - i += copy(dAtA[i:], m.Address) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.TlsSettings != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintConfig(dAtA, i, uint64(m.TlsSettings.Size())) - n10, err := m.TlsSettings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.TlsSettings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *LocalityLoadBalancerSetting) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1624,44 +1658,54 @@ func (m *LocalityLoadBalancerSetting) Marshal() (dAtA []byte, err error) { } func (m *LocalityLoadBalancerSetting) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LocalityLoadBalancerSetting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Distribute) > 0 { - for _, msg := range m.Distribute { - dAtA[i] = 0xa - i++ - i = encodeVarintConfig(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Failover) > 0 { - for _, msg := range m.Failover { - dAtA[i] = 0x12 - i++ - i = encodeVarintConfig(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Failover) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Failover[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Distribute) > 0 { + for iNdEx := len(m.Distribute) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Distribute[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *LocalityLoadBalancerSetting_Distribute) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1669,42 +1713,50 @@ func (m *LocalityLoadBalancerSetting_Distribute) Marshal() (dAtA []byte, err err } func (m *LocalityLoadBalancerSetting_Distribute) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LocalityLoadBalancerSetting_Distribute) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.From) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.From))) - i += copy(dAtA[i:], m.From) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.To) > 0 { - for k, _ := range m.To { - dAtA[i] = 0x12 - i++ + for k := range m.To { v := m.To[k] - mapSize := 1 + len(k) + sovConfig(uint64(len(k))) + 1 + sovConfig(uint64(v)) - i = encodeVarintConfig(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x10 - i++ + baseI := i i = encodeVarintConfig(dAtA, i, uint64(v)) + i-- + dAtA[i] = 0x10 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintConfig(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintConfig(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.From) > 0 { + i -= len(m.From) + copy(dAtA[i:], m.From) + i = encodeVarintConfig(dAtA, i, uint64(len(m.From))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *LocalityLoadBalancerSetting_Failover) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1712,36 +1764,46 @@ func (m *LocalityLoadBalancerSetting_Failover) Marshal() (dAtA []byte, err error } func (m *LocalityLoadBalancerSetting_Failover) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LocalityLoadBalancerSetting_Failover) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.From) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintConfig(dAtA, i, uint64(len(m.From))) - i += copy(dAtA[i:], m.From) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.To) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.To) + copy(dAtA[i:], m.To) i = encodeVarintConfig(dAtA, i, uint64(len(m.To))) - i += copy(dAtA[i:], m.To) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.From) > 0 { + i -= len(m.From) + copy(dAtA[i:], m.From) + i = encodeVarintConfig(dAtA, i, uint64(len(m.From))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintConfig(dAtA []byte, offset int, v uint64) int { + offset -= sovConfig(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *MeshConfig) Size() (n int) { if m == nil { @@ -2007,14 +2069,7 @@ func (m *LocalityLoadBalancerSetting_Failover) Size() (n int) { } func sovConfig(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozConfig(x uint64) (n int) { return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/mesh/v1alpha1/network.pb.go b/mesh/v1alpha1/network.pb.go index 3518e1121db..b20e20244db 100644 --- a/mesh/v1alpha1/network.pb.go +++ b/mesh/v1alpha1/network.pb.go @@ -8,6 +8,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -52,7 +53,7 @@ func (m *Network) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Network.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -129,7 +130,7 @@ func (m *Network_NetworkEndpoints) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_Network_NetworkEndpoints.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -282,7 +283,7 @@ func (m *Network_IstioNetworkGateway) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_Network_IstioNetworkGateway.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -462,7 +463,7 @@ func (m *MeshNetworks) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_MeshNetworks.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -531,7 +532,7 @@ var fileDescriptor_a15df2a96e10cd86 = []byte{ func (m *Network) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -539,44 +540,54 @@ func (m *Network) Marshal() (dAtA []byte, err error) { } func (m *Network) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Endpoints) > 0 { - for _, msg := range m.Endpoints { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetwork(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Gateways) > 0 { - for _, msg := range m.Gateways { - dAtA[i] = 0x1a - i++ - i = encodeVarintNetwork(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Gateways) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Gateways[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetwork(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Endpoints) > 0 { + for iNdEx := len(m.Endpoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Endpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetwork(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } } - return i, nil + return len(dAtA) - i, nil } func (m *Network_NetworkEndpoints) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -584,43 +595,61 @@ func (m *Network_NetworkEndpoints) Marshal() (dAtA []byte, err error) { } func (m *Network_NetworkEndpoints) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Network_NetworkEndpoints) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Ne != nil { - nn1, err := m.Ne.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Ne.Size() + i -= size + if _, err := m.Ne.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn1 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *Network_NetworkEndpoints_FromCidr) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0xa - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Network_NetworkEndpoints_FromCidr) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.FromCidr) + copy(dAtA[i:], m.FromCidr) i = encodeVarintNetwork(dAtA, i, uint64(len(m.FromCidr))) - i += copy(dAtA[i:], m.FromCidr) - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *Network_NetworkEndpoints_FromRegistry) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Network_NetworkEndpoints_FromRegistry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.FromRegistry) + copy(dAtA[i:], m.FromRegistry) i = encodeVarintNetwork(dAtA, i, uint64(len(m.FromRegistry))) - i += copy(dAtA[i:], m.FromRegistry) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *Network_IstioNetworkGateway) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -628,54 +657,73 @@ func (m *Network_IstioNetworkGateway) Marshal() (dAtA []byte, err error) { } func (m *Network_IstioNetworkGateway) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Network_IstioNetworkGateway) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Gw != nil { - nn2, err := m.Gw.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn2 - } - if m.Port != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintNetwork(dAtA, i, uint64(m.Port)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Locality) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.Locality) + copy(dAtA[i:], m.Locality) i = encodeVarintNetwork(dAtA, i, uint64(len(m.Locality))) - i += copy(dAtA[i:], m.Locality) + i-- + dAtA[i] = 0x22 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Port != 0 { + i = encodeVarintNetwork(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x18 + } + if m.Gw != nil { + { + size := m.Gw.Size() + i -= size + if _, err := m.Gw.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return i, nil + return len(dAtA) - i, nil } func (m *Network_IstioNetworkGateway_RegistryServiceName) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0xa - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Network_IstioNetworkGateway_RegistryServiceName) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.RegistryServiceName) + copy(dAtA[i:], m.RegistryServiceName) i = encodeVarintNetwork(dAtA, i, uint64(len(m.RegistryServiceName))) - i += copy(dAtA[i:], m.RegistryServiceName) - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *Network_IstioNetworkGateway_Address) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Network_IstioNetworkGateway_Address) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Address) + copy(dAtA[i:], m.Address) i = encodeVarintNetwork(dAtA, i, uint64(len(m.Address))) - i += copy(dAtA[i:], m.Address) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *MeshNetworks) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -683,52 +731,58 @@ func (m *MeshNetworks) Marshal() (dAtA []byte, err error) { } func (m *MeshNetworks) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MeshNetworks) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Networks) > 0 { - for k, _ := range m.Networks { - dAtA[i] = 0xa - i++ + for k := range m.Networks { v := m.Networks[k] - msgSize := 0 + baseI := i if v != nil { - msgSize = v.Size() - msgSize += 1 + sovNetwork(uint64(msgSize)) - } - mapSize := 1 + len(k) + sovNetwork(uint64(len(k))) + msgSize - i = encodeVarintNetwork(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintNetwork(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - if v != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetwork(dAtA, i, uint64(v.Size())) - n3, err := v.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetwork(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x12 } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintNetwork(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintNetwork(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintNetwork(dAtA []byte, offset int, v uint64) int { + offset -= sovNetwork(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Network) Size() (n int) { if m == nil { @@ -857,14 +911,7 @@ func (m *MeshNetworks) Size() (n int) { } func sovNetwork(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozNetwork(x uint64) (n int) { return sovNetwork(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/mesh/v1alpha1/proxy.pb.go b/mesh/v1alpha1/proxy.pb.go index dc37a1873cc..d7b117ce049 100644 --- a/mesh/v1alpha1/proxy.pb.go +++ b/mesh/v1alpha1/proxy.pb.go @@ -9,6 +9,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -121,7 +122,7 @@ func (m *Tracing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Tracing.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -334,7 +335,7 @@ func (m *Tracing_Zipkin) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_Tracing_Zipkin.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -389,7 +390,7 @@ func (m *Tracing_Lightstep) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_Tracing_Lightstep.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -459,7 +460,7 @@ func (m *Tracing_Datadog) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_Tracing_Datadog.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -522,7 +523,7 @@ func (m *Tracing_Stackdriver) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_Tracing_Stackdriver.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -596,7 +597,7 @@ func (m *SDS) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SDS.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -722,7 +723,7 @@ func (m *ProxyConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_ProxyConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -992,7 +993,7 @@ var fileDescriptor_5efecd978cf3d28d = []byte{ func (m *Tracing) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1000,83 +1001,115 @@ func (m *Tracing) Marshal() (dAtA []byte, err error) { } func (m *Tracing) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Tracing) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Tracer != nil { - nn1, err := m.Tracer.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Tracer.Size() + i -= size + if _, err := m.Tracer.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn1 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *Tracing_Zipkin_) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Tracing_Zipkin_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Zipkin != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.Zipkin.Size())) - n2, err := m.Zipkin.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Zipkin.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProxy(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Tracing_Lightstep_) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Tracing_Lightstep_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Lightstep != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.Lightstep.Size())) - n3, err := m.Lightstep.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Lightstep.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProxy(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *Tracing_Datadog_) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Tracing_Datadog_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Datadog != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.Datadog.Size())) - n4, err := m.Datadog.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Datadog.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProxy(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *Tracing_Stackdriver_) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Tracing_Stackdriver_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Stackdriver != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.Stackdriver.Size())) - n5, err := m.Stackdriver.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Stackdriver.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProxy(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *Tracing_Zipkin) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1084,26 +1117,33 @@ func (m *Tracing_Zipkin) Marshal() (dAtA []byte, err error) { } func (m *Tracing_Zipkin) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Tracing_Zipkin) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Address) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Address) + copy(dAtA[i:], m.Address) i = encodeVarintProxy(dAtA, i, uint64(len(m.Address))) - i += copy(dAtA[i:], m.Address) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Tracing_Lightstep) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1111,48 +1151,57 @@ func (m *Tracing_Lightstep) Marshal() (dAtA []byte, err error) { } func (m *Tracing_Lightstep) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Tracing_Lightstep) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Address) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintProxy(dAtA, i, uint64(len(m.Address))) - i += copy(dAtA[i:], m.Address) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.AccessToken) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintProxy(dAtA, i, uint64(len(m.AccessToken))) - i += copy(dAtA[i:], m.AccessToken) + if len(m.CacertPath) > 0 { + i -= len(m.CacertPath) + copy(dAtA[i:], m.CacertPath) + i = encodeVarintProxy(dAtA, i, uint64(len(m.CacertPath))) + i-- + dAtA[i] = 0x22 } if m.Secure { - dAtA[i] = 0x18 - i++ + i-- if m.Secure { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - if len(m.CacertPath) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintProxy(dAtA, i, uint64(len(m.CacertPath))) - i += copy(dAtA[i:], m.CacertPath) + if len(m.AccessToken) > 0 { + i -= len(m.AccessToken) + copy(dAtA[i:], m.AccessToken) + i = encodeVarintProxy(dAtA, i, uint64(len(m.AccessToken))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintProxy(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Tracing_Datadog) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1160,26 +1209,33 @@ func (m *Tracing_Datadog) Marshal() (dAtA []byte, err error) { } func (m *Tracing_Datadog) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Tracing_Datadog) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Address) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Address) + copy(dAtA[i:], m.Address) i = encodeVarintProxy(dAtA, i, uint64(len(m.Address))) - i += copy(dAtA[i:], m.Address) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Tracing_Stackdriver) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1187,60 +1243,72 @@ func (m *Tracing_Stackdriver) Marshal() (dAtA []byte, err error) { } func (m *Tracing_Stackdriver) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Tracing_Stackdriver) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Debug { - dAtA[i] = 0x8 - i++ - if m.Debug { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.MaxNumberOfAttributes != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.MaxNumberOfAttributes.Size())) - n6, err := m.MaxNumberOfAttributes.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.MaxNumberOfMessageEvents != nil { + { + size, err := m.MaxNumberOfMessageEvents.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProxy(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x22 } if m.MaxNumberOfAnnotations != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.MaxNumberOfAnnotations.Size())) - n7, err := m.MaxNumberOfAnnotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.MaxNumberOfAnnotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProxy(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x1a } - if m.MaxNumberOfMessageEvents != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.MaxNumberOfMessageEvents.Size())) - n8, err := m.MaxNumberOfMessageEvents.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.MaxNumberOfAttributes != nil { + { + size, err := m.MaxNumberOfAttributes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProxy(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Debug { + i-- + if m.Debug { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *SDS) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1248,36 +1316,43 @@ func (m *SDS) Marshal() (dAtA []byte, err error) { } func (m *SDS) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SDS) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.K8SSaJwtPath) > 0 { + i -= len(m.K8SSaJwtPath) + copy(dAtA[i:], m.K8SSaJwtPath) + i = encodeVarintProxy(dAtA, i, uint64(len(m.K8SSaJwtPath))) + i-- + dAtA[i] = 0x12 + } if m.Enabled { - dAtA[i] = 0x8 - i++ + i-- if m.Enabled { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if len(m.K8SSaJwtPath) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintProxy(dAtA, i, uint64(len(m.K8SSaJwtPath))) - i += copy(dAtA[i:], m.K8SSaJwtPath) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ProxyConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1285,189 +1360,220 @@ func (m *ProxyConfig) Marshal() (dAtA []byte, err error) { } func (m *ProxyConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProxyConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ConfigPath) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintProxy(dAtA, i, uint64(len(m.ConfigPath))) - i += copy(dAtA[i:], m.ConfigPath) - } - if len(m.BinaryPath) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintProxy(dAtA, i, uint64(len(m.BinaryPath))) - i += copy(dAtA[i:], m.BinaryPath) - } - if len(m.ServiceCluster) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintProxy(dAtA, i, uint64(len(m.ServiceCluster))) - i += copy(dAtA[i:], m.ServiceCluster) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.DrainDuration != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.DrainDuration.Size())) - n9, err := m.DrainDuration.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 + if len(m.EnvoyAccessLogServiceAddress) > 0 { + i -= len(m.EnvoyAccessLogServiceAddress) + copy(dAtA[i:], m.EnvoyAccessLogServiceAddress) + i = encodeVarintProxy(dAtA, i, uint64(len(m.EnvoyAccessLogServiceAddress))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 } - if m.ParentShutdownDuration != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.ParentShutdownDuration.Size())) - n10, err := m.ParentShutdownDuration.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Sds != nil { + { + size, err := m.Sds.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProxy(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa } - if len(m.DiscoveryAddress) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintProxy(dAtA, i, uint64(len(m.DiscoveryAddress))) - i += copy(dAtA[i:], m.DiscoveryAddress) + if len(m.EnvoyMetricsServiceAddress) > 0 { + i -= len(m.EnvoyMetricsServiceAddress) + copy(dAtA[i:], m.EnvoyMetricsServiceAddress) + i = encodeVarintProxy(dAtA, i, uint64(len(m.EnvoyMetricsServiceAddress))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 } - if m.DiscoveryRefreshDelay != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.DiscoveryRefreshDelay.Size())) - n11, err := m.DiscoveryRefreshDelay.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Tracing != nil { + { + size, err := m.Tracing.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProxy(dAtA, i, uint64(size)) } - i += n11 + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a } - if len(m.ZipkinAddress) > 0 { - dAtA[i] = 0x42 - i++ - i = encodeVarintProxy(dAtA, i, uint64(len(m.ZipkinAddress))) - i += copy(dAtA[i:], m.ZipkinAddress) + if m.InterceptionMode != 0 { + i = encodeVarintProxy(dAtA, i, uint64(m.InterceptionMode)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 } - if m.ConnectTimeout != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.ConnectTimeout.Size())) - n12, err := m.ConnectTimeout.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n12 + if len(m.ProxyBootstrapTemplatePath) > 0 { + i -= len(m.ProxyBootstrapTemplatePath) + copy(dAtA[i:], m.ProxyBootstrapTemplatePath) + i = encodeVarintProxy(dAtA, i, uint64(len(m.ProxyBootstrapTemplatePath))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a } - if len(m.StatsdUdpAddress) > 0 { - dAtA[i] = 0x52 - i++ - i = encodeVarintProxy(dAtA, i, uint64(len(m.StatsdUdpAddress))) - i += copy(dAtA[i:], m.StatsdUdpAddress) + if m.Concurrency != 0 { + i = encodeVarintProxy(dAtA, i, uint64(m.Concurrency)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 } - if m.ProxyAdminPort != 0 { - dAtA[i] = 0x58 - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.ProxyAdminPort)) + if m.StatNameLength != 0 { + i = encodeVarintProxy(dAtA, i, uint64(m.StatNameLength)) + i-- + dAtA[i] = 0x78 } - if len(m.AvailabilityZone) > 0 { - dAtA[i] = 0x62 - i++ - i = encodeVarintProxy(dAtA, i, uint64(len(m.AvailabilityZone))) - i += copy(dAtA[i:], m.AvailabilityZone) + if len(m.CustomConfigFile) > 0 { + i -= len(m.CustomConfigFile) + copy(dAtA[i:], m.CustomConfigFile) + i = encodeVarintProxy(dAtA, i, uint64(len(m.CustomConfigFile))) + i-- + dAtA[i] = 0x72 } if m.ControlPlaneAuthPolicy != 0 { - dAtA[i] = 0x68 - i++ i = encodeVarintProxy(dAtA, i, uint64(m.ControlPlaneAuthPolicy)) + i-- + dAtA[i] = 0x68 } - if len(m.CustomConfigFile) > 0 { - dAtA[i] = 0x72 - i++ - i = encodeVarintProxy(dAtA, i, uint64(len(m.CustomConfigFile))) - i += copy(dAtA[i:], m.CustomConfigFile) + if len(m.AvailabilityZone) > 0 { + i -= len(m.AvailabilityZone) + copy(dAtA[i:], m.AvailabilityZone) + i = encodeVarintProxy(dAtA, i, uint64(len(m.AvailabilityZone))) + i-- + dAtA[i] = 0x62 } - if m.StatNameLength != 0 { - dAtA[i] = 0x78 - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.StatNameLength)) + if m.ProxyAdminPort != 0 { + i = encodeVarintProxy(dAtA, i, uint64(m.ProxyAdminPort)) + i-- + dAtA[i] = 0x58 } - if m.Concurrency != 0 { - dAtA[i] = 0x80 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.Concurrency)) + if len(m.StatsdUdpAddress) > 0 { + i -= len(m.StatsdUdpAddress) + copy(dAtA[i:], m.StatsdUdpAddress) + i = encodeVarintProxy(dAtA, i, uint64(len(m.StatsdUdpAddress))) + i-- + dAtA[i] = 0x52 } - if len(m.ProxyBootstrapTemplatePath) > 0 { - dAtA[i] = 0x8a - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintProxy(dAtA, i, uint64(len(m.ProxyBootstrapTemplatePath))) - i += copy(dAtA[i:], m.ProxyBootstrapTemplatePath) + if m.ConnectTimeout != nil { + { + size, err := m.ConnectTimeout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a } - if m.InterceptionMode != 0 { - dAtA[i] = 0x90 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.InterceptionMode)) + if len(m.ZipkinAddress) > 0 { + i -= len(m.ZipkinAddress) + copy(dAtA[i:], m.ZipkinAddress) + i = encodeVarintProxy(dAtA, i, uint64(len(m.ZipkinAddress))) + i-- + dAtA[i] = 0x42 } - if m.Tracing != nil { - dAtA[i] = 0x9a - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.Tracing.Size())) - n13, err := m.Tracing.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.DiscoveryRefreshDelay != nil { + { + size, err := m.DiscoveryRefreshDelay.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProxy(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0x3a } - if len(m.EnvoyMetricsServiceAddress) > 0 { - dAtA[i] = 0xa2 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintProxy(dAtA, i, uint64(len(m.EnvoyMetricsServiceAddress))) - i += copy(dAtA[i:], m.EnvoyMetricsServiceAddress) + if len(m.DiscoveryAddress) > 0 { + i -= len(m.DiscoveryAddress) + copy(dAtA[i:], m.DiscoveryAddress) + i = encodeVarintProxy(dAtA, i, uint64(len(m.DiscoveryAddress))) + i-- + dAtA[i] = 0x32 } - if m.Sds != nil { - dAtA[i] = 0xaa - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintProxy(dAtA, i, uint64(m.Sds.Size())) - n14, err := m.Sds.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ParentShutdownDuration != nil { + { + size, err := m.ParentShutdownDuration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProxy(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0x2a } - if len(m.EnvoyAccessLogServiceAddress) > 0 { - dAtA[i] = 0xb2 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintProxy(dAtA, i, uint64(len(m.EnvoyAccessLogServiceAddress))) - i += copy(dAtA[i:], m.EnvoyAccessLogServiceAddress) + if m.DrainDuration != nil { + { + size, err := m.DrainDuration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ServiceCluster) > 0 { + i -= len(m.ServiceCluster) + copy(dAtA[i:], m.ServiceCluster) + i = encodeVarintProxy(dAtA, i, uint64(len(m.ServiceCluster))) + i-- + dAtA[i] = 0x1a + } + if len(m.BinaryPath) > 0 { + i -= len(m.BinaryPath) + copy(dAtA[i:], m.BinaryPath) + i = encodeVarintProxy(dAtA, i, uint64(len(m.BinaryPath))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.ConfigPath) > 0 { + i -= len(m.ConfigPath) + copy(dAtA[i:], m.ConfigPath) + i = encodeVarintProxy(dAtA, i, uint64(len(m.ConfigPath))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func encodeVarintProxy(dAtA []byte, offset int, v uint64) int { + offset -= sovProxy(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Tracing) Size() (n int) { if m == nil { @@ -1733,14 +1839,7 @@ func (m *ProxyConfig) Size() (n int) { } func sovProxy(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozProxy(x uint64) (n int) { return sovProxy(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/mixer/adapter/model/v1beta1/check.pb.go b/mixer/adapter/model/v1beta1/check.pb.go index 93d0e8b1503..5bece9b1361 100644 --- a/mixer/adapter/model/v1beta1/check.pb.go +++ b/mixer/adapter/model/v1beta1/check.pb.go @@ -12,6 +12,7 @@ import ( github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" time "time" @@ -53,7 +54,7 @@ func (m *CheckResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_CheckResult.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -108,7 +109,7 @@ var fileDescriptor_b5cd393dc2a446fd = []byte{ func (m *CheckResult) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -116,42 +117,51 @@ func (m *CheckResult) Marshal() (dAtA []byte, err error) { } func (m *CheckResult) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CheckResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintCheck(dAtA, i, uint64(m.Status.Size())) - n1, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - dAtA[i] = 0x12 - i++ - i = encodeVarintCheck(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.ValidDuration))) - n2, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ValidDuration, dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 if m.ValidUseCount != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintCheck(dAtA, i, uint64(m.ValidUseCount)) + i-- + dAtA[i] = 0x18 + } + n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ValidDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ValidDuration):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintCheck(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x12 + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCheck(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func encodeVarintCheck(dAtA []byte, offset int, v uint64) int { + offset -= sovCheck(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *CheckResult) Size() (n int) { if m == nil { @@ -170,14 +180,7 @@ func (m *CheckResult) Size() (n int) { } func sovCheck(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozCheck(x uint64) (n int) { return sovCheck(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -187,8 +190,8 @@ func (this *CheckResult) String() string { return "nil" } s := strings.Join([]string{`&CheckResult{`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "Status", "rpc.Status", 1), `&`, ``, 1) + `,`, - `ValidDuration:` + strings.Replace(strings.Replace(this.ValidDuration.String(), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "rpc.Status", 1), `&`, ``, 1) + `,`, + `ValidDuration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ValidDuration), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, `ValidUseCount:` + fmt.Sprintf("%v", this.ValidUseCount) + `,`, `}`, }, "") diff --git a/mixer/adapter/model/v1beta1/info.pb.go b/mixer/adapter/model/v1beta1/info.pb.go index 230fdaf47ba..0ccabc15325 100644 --- a/mixer/adapter/model/v1beta1/info.pb.go +++ b/mixer/adapter/model/v1beta1/info.pb.go @@ -8,6 +8,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -68,7 +69,7 @@ func (m *Info) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Info.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -217,7 +218,7 @@ func valueToGoStringInfo(v interface{}, typ string) string { func (m *Info) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -225,64 +226,68 @@ func (m *Info) Marshal() (dAtA []byte, err error) { } func (m *Info) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Info) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintInfo(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.SessionBased { + i-- + if m.SessionBased { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 } - if len(m.Description) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintInfo(dAtA, i, uint64(len(m.Description))) - i += copy(dAtA[i:], m.Description) + if len(m.Config) > 0 { + i -= len(m.Config) + copy(dAtA[i:], m.Config) + i = encodeVarintInfo(dAtA, i, uint64(len(m.Config))) + i-- + dAtA[i] = 0x22 } if len(m.Templates) > 0 { - for _, s := range m.Templates { + for iNdEx := len(m.Templates) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Templates[iNdEx]) + copy(dAtA[i:], m.Templates[iNdEx]) + i = encodeVarintInfo(dAtA, i, uint64(len(m.Templates[iNdEx]))) + i-- dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if len(m.Config) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintInfo(dAtA, i, uint64(len(m.Config))) - i += copy(dAtA[i:], m.Config) + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintInfo(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 } - if m.SessionBased { - dAtA[i] = 0x28 - i++ - if m.SessionBased { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintInfo(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintInfo(dAtA []byte, offset int, v uint64) int { + offset -= sovInfo(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Info) Size() (n int) { if m == nil { @@ -315,14 +320,7 @@ func (m *Info) Size() (n int) { } func sovInfo(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozInfo(x uint64) (n int) { return sovInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/mixer/adapter/model/v1beta1/infrastructure_backend.pb.go b/mixer/adapter/model/v1beta1/infrastructure_backend.pb.go index 0cfdf0b5788..941dd92e107 100644 --- a/mixer/adapter/model/v1beta1/infrastructure_backend.pb.go +++ b/mixer/adapter/model/v1beta1/infrastructure_backend.pb.go @@ -14,8 +14,11 @@ import ( github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" types "github.com/gogo/protobuf/types" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -52,7 +55,7 @@ func (m *CreateSessionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_CreateSessionRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -106,7 +109,7 @@ func (m *CreateSessionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_CreateSessionResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -160,7 +163,7 @@ func (m *ValidateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_ValidateRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -212,7 +215,7 @@ func (m *ValidateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_ValidateResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -257,7 +260,7 @@ func (m *CloseSessionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_CloseSessionRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -302,7 +305,7 @@ func (m *CloseSessionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_CloseSessionResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -759,6 +762,20 @@ type InfrastructureBackendServer interface { CloseSession(context.Context, *CloseSessionRequest) (*CloseSessionResponse, error) } +// UnimplementedInfrastructureBackendServer can be embedded to have forward compatible implementations. +type UnimplementedInfrastructureBackendServer struct { +} + +func (*UnimplementedInfrastructureBackendServer) Validate(ctx context.Context, req *ValidateRequest) (*ValidateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Validate not implemented") +} +func (*UnimplementedInfrastructureBackendServer) CreateSession(ctx context.Context, req *CreateSessionRequest) (*CreateSessionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateSession not implemented") +} +func (*UnimplementedInfrastructureBackendServer) CloseSession(ctx context.Context, req *CloseSessionRequest) (*CloseSessionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CloseSession not implemented") +} + func RegisterInfrastructureBackendServer(s *grpc.Server, srv InfrastructureBackendServer) { s.RegisterService(&_InfrastructureBackend_serviceDesc, srv) } @@ -841,7 +858,7 @@ var _InfrastructureBackend_serviceDesc = grpc.ServiceDesc{ func (m *CreateSessionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -849,55 +866,60 @@ func (m *CreateSessionRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateSessionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateSessionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.AdapterConfig != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintInfrastructureBackend(dAtA, i, uint64(m.AdapterConfig.Size())) - n1, err := m.AdapterConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - } if len(m.InferredTypes) > 0 { - for k, _ := range m.InferredTypes { - dAtA[i] = 0x12 - i++ + for k := range m.InferredTypes { v := m.InferredTypes[k] - msgSize := 0 + baseI := i if v != nil { - msgSize = v.Size() - msgSize += 1 + sovInfrastructureBackend(uint64(msgSize)) + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintInfrastructureBackend(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - mapSize := 1 + len(k) + sovInfrastructureBackend(uint64(len(k))) + msgSize - i = encodeVarintInfrastructureBackend(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ + i -= len(k) + copy(dAtA[i:], k) i = encodeVarintInfrastructureBackend(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - if v != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintInfrastructureBackend(dAtA, i, uint64(v.Size())) - n2, err := v.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 + i-- + dAtA[i] = 0xa + i = encodeVarintInfrastructureBackend(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.AdapterConfig != nil { + { + size, err := m.AdapterConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintInfrastructureBackend(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateSessionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -905,33 +927,41 @@ func (m *CreateSessionResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateSessionResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateSessionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SessionId) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintInfrastructureBackend(dAtA, i, uint64(len(m.SessionId))) - i += copy(dAtA[i:], m.SessionId) - } if m.Status != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintInfrastructureBackend(dAtA, i, uint64(m.Status.Size())) - n3, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintInfrastructureBackend(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.SessionId) > 0 { + i -= len(m.SessionId) + copy(dAtA[i:], m.SessionId) + i = encodeVarintInfrastructureBackend(dAtA, i, uint64(len(m.SessionId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *ValidateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -939,55 +969,60 @@ func (m *ValidateRequest) Marshal() (dAtA []byte, err error) { } func (m *ValidateRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.AdapterConfig != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintInfrastructureBackend(dAtA, i, uint64(m.AdapterConfig.Size())) - n4, err := m.AdapterConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 - } if len(m.InferredTypes) > 0 { - for k, _ := range m.InferredTypes { - dAtA[i] = 0x12 - i++ + for k := range m.InferredTypes { v := m.InferredTypes[k] - msgSize := 0 + baseI := i if v != nil { - msgSize = v.Size() - msgSize += 1 + sovInfrastructureBackend(uint64(msgSize)) + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintInfrastructureBackend(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - mapSize := 1 + len(k) + sovInfrastructureBackend(uint64(len(k))) + msgSize - i = encodeVarintInfrastructureBackend(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ + i -= len(k) + copy(dAtA[i:], k) i = encodeVarintInfrastructureBackend(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - if v != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintInfrastructureBackend(dAtA, i, uint64(v.Size())) - n5, err := v.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 + i-- + dAtA[i] = 0xa + i = encodeVarintInfrastructureBackend(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.AdapterConfig != nil { + { + size, err := m.AdapterConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintInfrastructureBackend(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ValidateResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -995,27 +1030,34 @@ func (m *ValidateResponse) Marshal() (dAtA []byte, err error) { } func (m *ValidateResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Status != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintInfrastructureBackend(dAtA, i, uint64(m.Status.Size())) - n6, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintInfrastructureBackend(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CloseSessionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1023,23 +1065,29 @@ func (m *CloseSessionRequest) Marshal() (dAtA []byte, err error) { } func (m *CloseSessionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CloseSessionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.SessionId) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.SessionId) + copy(dAtA[i:], m.SessionId) i = encodeVarintInfrastructureBackend(dAtA, i, uint64(len(m.SessionId))) - i += copy(dAtA[i:], m.SessionId) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CloseSessionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1047,31 +1095,40 @@ func (m *CloseSessionResponse) Marshal() (dAtA []byte, err error) { } func (m *CloseSessionResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CloseSessionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Status != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintInfrastructureBackend(dAtA, i, uint64(m.Status.Size())) - n7, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintInfrastructureBackend(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintInfrastructureBackend(dAtA []byte, offset int, v uint64) int { + offset -= sovInfrastructureBackend(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *CreateSessionRequest) Size() (n int) { if m == nil { @@ -1182,14 +1239,7 @@ func (m *CloseSessionResponse) Size() (n int) { } func sovInfrastructureBackend(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozInfrastructureBackend(x uint64) (n int) { return sovInfrastructureBackend(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/mixer/adapter/model/v1beta1/quota.pb.go b/mixer/adapter/model/v1beta1/quota.pb.go index be242b6f0b6..5f605257f72 100644 --- a/mixer/adapter/model/v1beta1/quota.pb.go +++ b/mixer/adapter/model/v1beta1/quota.pb.go @@ -13,6 +13,7 @@ import ( github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" time "time" @@ -49,7 +50,7 @@ func (m *QuotaRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_QuotaRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -89,7 +90,7 @@ func (m *QuotaRequest_QuotaParams) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_QuotaRequest_QuotaParams.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -127,7 +128,7 @@ func (m *QuotaResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_QuotaResult.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -170,7 +171,7 @@ func (m *QuotaResult_Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_QuotaResult_Result.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -240,7 +241,7 @@ var fileDescriptor_f07acf62b4429357 = []byte{ func (m *QuotaRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -248,43 +249,46 @@ func (m *QuotaRequest) Marshal() (dAtA []byte, err error) { } func (m *QuotaRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuotaRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Quotas) > 0 { - for k, _ := range m.Quotas { - dAtA[i] = 0xa - i++ + for k := range m.Quotas { v := m.Quotas[k] - msgSize := 0 - if (&v) != nil { - msgSize = (&v).Size() - msgSize += 1 + sovQuota(uint64(msgSize)) + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuota(dAtA, i, uint64(size)) } - mapSize := 1 + len(k) + sovQuota(uint64(len(k))) + msgSize - i = encodeVarintQuota(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintQuota(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintQuota(dAtA, i, uint64((&v).Size())) - n1, err := (&v).MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuota(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuota(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *QuotaRequest_QuotaParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -292,32 +296,37 @@ func (m *QuotaRequest_QuotaParams) Marshal() (dAtA []byte, err error) { } func (m *QuotaRequest_QuotaParams) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuotaRequest_QuotaParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Amount != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintQuota(dAtA, i, uint64(m.Amount)) - } if m.BestEffort { - dAtA[i] = 0x10 - i++ + i-- if m.BestEffort { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - return i, nil + if m.Amount != 0 { + i = encodeVarintQuota(dAtA, i, uint64(m.Amount)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *QuotaResult) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -325,43 +334,46 @@ func (m *QuotaResult) Marshal() (dAtA []byte, err error) { } func (m *QuotaResult) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuotaResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Quotas) > 0 { - for k, _ := range m.Quotas { - dAtA[i] = 0xa - i++ + for k := range m.Quotas { v := m.Quotas[k] - msgSize := 0 - if (&v) != nil { - msgSize = (&v).Size() - msgSize += 1 + sovQuota(uint64(msgSize)) + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuota(dAtA, i, uint64(size)) } - mapSize := 1 + len(k) + sovQuota(uint64(len(k))) + msgSize - i = encodeVarintQuota(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintQuota(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintQuota(dAtA, i, uint64((&v).Size())) - n2, err := (&v).MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuota(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuota(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *QuotaResult_Result) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -369,42 +381,51 @@ func (m *QuotaResult_Result) Marshal() (dAtA []byte, err error) { } func (m *QuotaResult_Result) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuotaResult_Result) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0x12 - i++ - i = encodeVarintQuota(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.ValidDuration))) - n3, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ValidDuration, dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuota(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x22 if m.GrantedAmount != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintQuota(dAtA, i, uint64(m.GrantedAmount)) + i-- + dAtA[i] = 0x18 } - dAtA[i] = 0x22 - i++ - i = encodeVarintQuota(dAtA, i, uint64(m.Status.Size())) - n4, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + n4, err4 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ValidDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ValidDuration):]) + if err4 != nil { + return 0, err4 } - i += n4 - return i, nil + i -= n4 + i = encodeVarintQuota(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func encodeVarintQuota(dAtA []byte, offset int, v uint64) int { + offset -= sovQuota(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *QuotaRequest) Size() (n int) { if m == nil { @@ -474,14 +495,7 @@ func (m *QuotaResult_Result) Size() (n int) { } func sovQuota(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozQuota(x uint64) (n int) { return sovQuota(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -542,9 +556,9 @@ func (this *QuotaResult_Result) String() string { return "nil" } s := strings.Join([]string{`&QuotaResult_Result{`, - `ValidDuration:` + strings.Replace(strings.Replace(this.ValidDuration.String(), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, + `ValidDuration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ValidDuration), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, `GrantedAmount:` + fmt.Sprintf("%v", this.GrantedAmount) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "Status", "rpc.Status", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "rpc.Status", 1), `&`, ``, 1) + `,`, `}`, }, "") return s diff --git a/mixer/adapter/model/v1beta1/report.pb.go b/mixer/adapter/model/v1beta1/report.pb.go index 3ca2dca28e6..a7a6bd995ca 100644 --- a/mixer/adapter/model/v1beta1/report.pb.go +++ b/mixer/adapter/model/v1beta1/report.pb.go @@ -9,6 +9,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -41,7 +42,7 @@ func (m *ReportResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_ReportResult.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -87,7 +88,7 @@ var fileDescriptor_abc732328b315eb4 = []byte{ func (m *ReportResult) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -95,21 +96,28 @@ func (m *ReportResult) Marshal() (dAtA []byte, err error) { } func (m *ReportResult) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReportResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func encodeVarintReport(dAtA []byte, offset int, v uint64) int { + offset -= sovReport(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *ReportResult) Size() (n int) { if m == nil { @@ -121,14 +129,7 @@ func (m *ReportResult) Size() (n int) { } func sovReport(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozReport(x uint64) (n int) { return sovReport(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/mixer/adapter/model/v1beta1/template.pb.go b/mixer/adapter/model/v1beta1/template.pb.go index ac853940e78..6921e1f62a8 100644 --- a/mixer/adapter/model/v1beta1/template.pb.go +++ b/mixer/adapter/model/v1beta1/template.pb.go @@ -8,6 +8,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -42,7 +43,7 @@ func (m *Template) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Template.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -138,7 +139,7 @@ func valueToGoStringTemplate(v interface{}, typ string) string { func (m *Template) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -146,27 +147,35 @@ func (m *Template) Marshal() (dAtA []byte, err error) { } func (m *Template) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Template) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Descriptor_) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Descriptor_) + copy(dAtA[i:], m.Descriptor_) i = encodeVarintTemplate(dAtA, i, uint64(len(m.Descriptor_))) - i += copy(dAtA[i:], m.Descriptor_) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintTemplate(dAtA []byte, offset int, v uint64) int { + offset -= sovTemplate(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Template) Size() (n int) { if m == nil { @@ -182,14 +191,7 @@ func (m *Template) Size() (n int) { } func sovTemplate(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozTemplate(x uint64) (n int) { return sovTemplate(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/mixer/v1/attributes.pb.go b/mixer/v1/attributes.pb.go index 4b772b82d7d..a4a4257e6a5 100644 --- a/mixer/v1/attributes.pb.go +++ b/mixer/v1/attributes.pb.go @@ -13,6 +13,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" time "time" @@ -80,7 +81,7 @@ func (m *Attributes) XXX_Unmarshal(b []byte) error { } func (m *Attributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -124,7 +125,7 @@ func (m *Attributes_AttributeValue) XXX_Unmarshal(b []byte) error { } func (m *Attributes_AttributeValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -430,7 +431,7 @@ func (m *Attributes_StringMap) XXX_Unmarshal(b []byte) error { } func (m *Attributes_StringMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -486,7 +487,7 @@ func (m *CompressedAttributes) XXX_Unmarshal(b []byte) error { } func (m *CompressedAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -521,7 +522,7 @@ func (m *StringMap) XXX_Unmarshal(b []byte) error { } func (m *StringMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -618,7 +619,7 @@ var fileDescriptor_6504964367320bd3 = []byte{ func (m *Attributes) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -626,50 +627,53 @@ func (m *Attributes) Marshal() (dAtA []byte, err error) { } func (m *Attributes) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Attributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Attributes) > 0 { keysForAttributes := make([]string, 0, len(m.Attributes)) - for k, _ := range m.Attributes { + for k := range m.Attributes { keysForAttributes = append(keysForAttributes, string(k)) } github_com_gogo_protobuf_sortkeys.Strings(keysForAttributes) - for _, k := range keysForAttributes { - dAtA[i] = 0xa - i++ - v := m.Attributes[string(k)] - msgSize := 0 - if v != nil { - msgSize = v.Size() - msgSize += 1 + sovAttributes(uint64(msgSize)) - } - mapSize := 1 + len(k) + sovAttributes(uint64(len(k))) + msgSize - i = encodeVarintAttributes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintAttributes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + for iNdEx := len(keysForAttributes) - 1; iNdEx >= 0; iNdEx-- { + v := m.Attributes[string(keysForAttributes[iNdEx])] + baseI := i if v != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintAttributes(dAtA, i, uint64(v.Size())) - n1, err := v.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAttributes(dAtA, i, uint64(size)) } - i += n1 + i-- + dAtA[i] = 0x12 } + i -= len(keysForAttributes[iNdEx]) + copy(dAtA[i:], keysForAttributes[iNdEx]) + i = encodeVarintAttributes(dAtA, i, uint64(len(keysForAttributes[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintAttributes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *Attributes_AttributeValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -677,111 +681,158 @@ func (m *Attributes_AttributeValue) Marshal() (dAtA []byte, err error) { } func (m *Attributes_AttributeValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Attributes_AttributeValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Value != nil { - nn2, err := m.Value.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Value.Size() + i -= size + if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn2 } - return i, nil + return len(dAtA) - i, nil } func (m *Attributes_AttributeValue_StringValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Attributes_AttributeValue_StringValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.StringValue) + copy(dAtA[i:], m.StringValue) i = encodeVarintAttributes(dAtA, i, uint64(len(m.StringValue))) - i += copy(dAtA[i:], m.StringValue) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *Attributes_AttributeValue_Int64Value) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x18 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Attributes_AttributeValue_Int64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintAttributes(dAtA, i, uint64(m.Int64Value)) - return i, nil + i-- + dAtA[i] = 0x18 + return len(dAtA) - i, nil } func (m *Attributes_AttributeValue_DoubleValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x21 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Attributes_AttributeValue_DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DoubleValue)))) - i += 8 - return i, nil + i-- + dAtA[i] = 0x21 + return len(dAtA) - i, nil } func (m *Attributes_AttributeValue_BoolValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x28 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Attributes_AttributeValue_BoolValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i-- if m.BoolValue { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - return i, nil + i-- + dAtA[i] = 0x28 + return len(dAtA) - i, nil } func (m *Attributes_AttributeValue_BytesValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Attributes_AttributeValue_BytesValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.BytesValue != nil { - dAtA[i] = 0x32 - i++ + i -= len(m.BytesValue) + copy(dAtA[i:], m.BytesValue) i = encodeVarintAttributes(dAtA, i, uint64(len(m.BytesValue))) - i += copy(dAtA[i:], m.BytesValue) + i-- + dAtA[i] = 0x32 } - return i, nil + return len(dAtA) - i, nil } func (m *Attributes_AttributeValue_TimestampValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Attributes_AttributeValue_TimestampValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.TimestampValue != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintAttributes(dAtA, i, uint64(m.TimestampValue.Size())) - n3, err := m.TimestampValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.TimestampValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAttributes(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x3a } - return i, nil + return len(dAtA) - i, nil } func (m *Attributes_AttributeValue_DurationValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Attributes_AttributeValue_DurationValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.DurationValue != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintAttributes(dAtA, i, uint64(m.DurationValue.Size())) - n4, err := m.DurationValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.DurationValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAttributes(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x42 } - return i, nil + return len(dAtA) - i, nil } func (m *Attributes_AttributeValue_StringMapValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Attributes_AttributeValue_StringMapValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.StringMapValue != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintAttributes(dAtA, i, uint64(m.StringMapValue.Size())) - n5, err := m.StringMapValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.StringMapValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAttributes(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0x4a } - return i, nil + return len(dAtA) - i, nil } func (m *Attributes_StringMap) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -789,39 +840,46 @@ func (m *Attributes_StringMap) Marshal() (dAtA []byte, err error) { } func (m *Attributes_StringMap) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Attributes_StringMap) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Entries) > 0 { keysForEntries := make([]string, 0, len(m.Entries)) - for k, _ := range m.Entries { + for k := range m.Entries { keysForEntries = append(keysForEntries, string(k)) } github_com_gogo_protobuf_sortkeys.Strings(keysForEntries) - for _, k := range keysForEntries { + for iNdEx := len(keysForEntries) - 1; iNdEx >= 0; iNdEx-- { + v := m.Entries[string(keysForEntries[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintAttributes(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForEntries[iNdEx]) + copy(dAtA[i:], keysForEntries[iNdEx]) + i = encodeVarintAttributes(dAtA, i, uint64(len(keysForEntries[iNdEx]))) + i-- dAtA[i] = 0xa - i++ - v := m.Entries[string(k)] - mapSize := 1 + len(k) + sovAttributes(uint64(len(k))) + 1 + len(v) + sovAttributes(uint64(len(v))) - i = encodeVarintAttributes(dAtA, i, uint64(mapSize)) + i = encodeVarintAttributes(dAtA, i, uint64(baseI-i)) + i-- dAtA[i] = 0xa - i++ - i = encodeVarintAttributes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintAttributes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) } } - return i, nil + return len(dAtA) - i, nil } func (m *CompressedAttributes) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -829,235 +887,218 @@ func (m *CompressedAttributes) Marshal() (dAtA []byte, err error) { } func (m *CompressedAttributes) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompressedAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Words) > 0 { - for _, s := range m.Words { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if len(m.StringMaps) > 0 { + keysForStringMaps := make([]int32, 0, len(m.StringMaps)) + for k := range m.StringMaps { + keysForStringMaps = append(keysForStringMaps, int32(k)) + } + github_com_gogo_protobuf_sortkeys.Int32s(keysForStringMaps) + for iNdEx := len(keysForStringMaps) - 1; iNdEx >= 0; iNdEx-- { + v := m.StringMaps[int32(keysForStringMaps[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAttributes(dAtA, i, uint64(size)) } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i-- + dAtA[i] = 0x12 + i = encodeVarintAttributes(dAtA, i, uint64((uint32(keysForStringMaps[iNdEx])<<1)^uint32((keysForStringMaps[iNdEx]>>31)))) + i-- + dAtA[i] = 0x8 + i = encodeVarintAttributes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a } } - if len(m.Strings) > 0 { - keysForStrings := make([]int32, 0, len(m.Strings)) - for k, _ := range m.Strings { - keysForStrings = append(keysForStrings, int32(k)) + if len(m.Bytes) > 0 { + keysForBytes := make([]int32, 0, len(m.Bytes)) + for k := range m.Bytes { + keysForBytes = append(keysForBytes, int32(k)) } - github_com_gogo_protobuf_sortkeys.Int32s(keysForStrings) - for _, k := range keysForStrings { - dAtA[i] = 0x12 - i++ - v := m.Strings[int32(k)] - mapSize := 1 + sozAttributes(uint64(k)) + 1 + sozAttributes(uint64(v)) - i = encodeVarintAttributes(dAtA, i, uint64(mapSize)) + github_com_gogo_protobuf_sortkeys.Int32s(keysForBytes) + for iNdEx := len(keysForBytes) - 1; iNdEx >= 0; iNdEx-- { + v := m.Bytes[int32(keysForBytes[iNdEx])] + baseI := i + if len(v) > 0 { + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintAttributes(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + } + i = encodeVarintAttributes(dAtA, i, uint64((uint32(keysForBytes[iNdEx])<<1)^uint32((keysForBytes[iNdEx]>>31)))) + i-- dAtA[i] = 0x8 - i++ - i = encodeVarintAttributes(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) - dAtA[i] = 0x10 - i++ - i = encodeVarintAttributes(dAtA, i, uint64((uint32(v)<<1)^uint32((v>>31)))) + i = encodeVarintAttributes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 } } - if len(m.Int64S) > 0 { - keysForInt64S := make([]int32, 0, len(m.Int64S)) - for k, _ := range m.Int64S { - keysForInt64S = append(keysForInt64S, int32(k)) + if len(m.Durations) > 0 { + keysForDurations := make([]int32, 0, len(m.Durations)) + for k := range m.Durations { + keysForDurations = append(keysForDurations, int32(k)) } - github_com_gogo_protobuf_sortkeys.Int32s(keysForInt64S) - for _, k := range keysForInt64S { - dAtA[i] = 0x1a - i++ - v := m.Int64S[int32(k)] - mapSize := 1 + sozAttributes(uint64(k)) + 1 + sovAttributes(uint64(v)) - i = encodeVarintAttributes(dAtA, i, uint64(mapSize)) + github_com_gogo_protobuf_sortkeys.Int32s(keysForDurations) + for iNdEx := len(keysForDurations) - 1; iNdEx >= 0; iNdEx-- { + v := m.Durations[int32(keysForDurations[iNdEx])] + baseI := i + n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo((*(&v)), dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration((*(&v))):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintAttributes(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x12 + i = encodeVarintAttributes(dAtA, i, uint64((uint32(keysForDurations[iNdEx])<<1)^uint32((keysForDurations[iNdEx]>>31)))) + i-- dAtA[i] = 0x8 - i++ - i = encodeVarintAttributes(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) - dAtA[i] = 0x10 - i++ - i = encodeVarintAttributes(dAtA, i, uint64(v)) + i = encodeVarintAttributes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a } } - if len(m.Doubles) > 0 { - keysForDoubles := make([]int32, 0, len(m.Doubles)) - for k, _ := range m.Doubles { - keysForDoubles = append(keysForDoubles, int32(k)) + if len(m.Timestamps) > 0 { + keysForTimestamps := make([]int32, 0, len(m.Timestamps)) + for k := range m.Timestamps { + keysForTimestamps = append(keysForTimestamps, int32(k)) } - github_com_gogo_protobuf_sortkeys.Int32s(keysForDoubles) - for _, k := range keysForDoubles { - dAtA[i] = 0x22 - i++ - v := m.Doubles[int32(k)] - mapSize := 1 + sozAttributes(uint64(k)) + 1 + 8 - i = encodeVarintAttributes(dAtA, i, uint64(mapSize)) + github_com_gogo_protobuf_sortkeys.Int32s(keysForTimestamps) + for iNdEx := len(keysForTimestamps) - 1; iNdEx >= 0; iNdEx-- { + v := m.Timestamps[int32(keysForTimestamps[iNdEx])] + baseI := i + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo((*(&v)), dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime((*(&v))):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintAttributes(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x12 + i = encodeVarintAttributes(dAtA, i, uint64((uint32(keysForTimestamps[iNdEx])<<1)^uint32((keysForTimestamps[iNdEx]>>31)))) + i-- dAtA[i] = 0x8 - i++ - i = encodeVarintAttributes(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) - dAtA[i] = 0x11 - i++ - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(v)))) - i += 8 + i = encodeVarintAttributes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 } } if len(m.Bools) > 0 { keysForBools := make([]int32, 0, len(m.Bools)) - for k, _ := range m.Bools { + for k := range m.Bools { keysForBools = append(keysForBools, int32(k)) } github_com_gogo_protobuf_sortkeys.Int32s(keysForBools) - for _, k := range keysForBools { - dAtA[i] = 0x2a - i++ - v := m.Bools[int32(k)] - mapSize := 1 + sozAttributes(uint64(k)) + 1 + 1 - i = encodeVarintAttributes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0x8 - i++ - i = encodeVarintAttributes(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) - dAtA[i] = 0x10 - i++ + for iNdEx := len(keysForBools) - 1; iNdEx >= 0; iNdEx-- { + v := m.Bools[int32(keysForBools[iNdEx])] + baseI := i + i-- if v { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - } - if len(m.Timestamps) > 0 { - keysForTimestamps := make([]int32, 0, len(m.Timestamps)) - for k, _ := range m.Timestamps { - keysForTimestamps = append(keysForTimestamps, int32(k)) - } - github_com_gogo_protobuf_sortkeys.Int32s(keysForTimestamps) - for _, k := range keysForTimestamps { - dAtA[i] = 0x32 - i++ - v := m.Timestamps[int32(k)] - msgSize := 0 - if (&v) != nil { - msgSize = github_com_gogo_protobuf_types.SizeOfStdTime(*(&v)) - msgSize += 1 + sovAttributes(uint64(msgSize)) - } - mapSize := 1 + sozAttributes(uint64(k)) + msgSize - i = encodeVarintAttributes(dAtA, i, uint64(mapSize)) + i-- + dAtA[i] = 0x10 + i = encodeVarintAttributes(dAtA, i, uint64((uint32(keysForBools[iNdEx])<<1)^uint32((keysForBools[iNdEx]>>31)))) + i-- dAtA[i] = 0x8 - i++ - i = encodeVarintAttributes(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) - dAtA[i] = 0x12 - i++ - i = encodeVarintAttributes(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(*(&v)))) - n6, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(*(&v), dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 + i = encodeVarintAttributes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a } } - if len(m.Durations) > 0 { - keysForDurations := make([]int32, 0, len(m.Durations)) - for k, _ := range m.Durations { - keysForDurations = append(keysForDurations, int32(k)) + if len(m.Doubles) > 0 { + keysForDoubles := make([]int32, 0, len(m.Doubles)) + for k := range m.Doubles { + keysForDoubles = append(keysForDoubles, int32(k)) } - github_com_gogo_protobuf_sortkeys.Int32s(keysForDurations) - for _, k := range keysForDurations { - dAtA[i] = 0x3a - i++ - v := m.Durations[int32(k)] - msgSize := 0 - if (&v) != nil { - msgSize = github_com_gogo_protobuf_types.SizeOfStdDuration(*(&v)) - msgSize += 1 + sovAttributes(uint64(msgSize)) - } - mapSize := 1 + sozAttributes(uint64(k)) + msgSize - i = encodeVarintAttributes(dAtA, i, uint64(mapSize)) + github_com_gogo_protobuf_sortkeys.Int32s(keysForDoubles) + for iNdEx := len(keysForDoubles) - 1; iNdEx >= 0; iNdEx-- { + v := m.Doubles[int32(keysForDoubles[iNdEx])] + baseI := i + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(v)))) + i-- + dAtA[i] = 0x11 + i = encodeVarintAttributes(dAtA, i, uint64((uint32(keysForDoubles[iNdEx])<<1)^uint32((keysForDoubles[iNdEx]>>31)))) + i-- dAtA[i] = 0x8 - i++ - i = encodeVarintAttributes(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) - dAtA[i] = 0x12 - i++ - i = encodeVarintAttributes(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*(&v)))) - n7, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*(&v), dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 + i = encodeVarintAttributes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 } } - if len(m.Bytes) > 0 { - keysForBytes := make([]int32, 0, len(m.Bytes)) - for k, _ := range m.Bytes { - keysForBytes = append(keysForBytes, int32(k)) + if len(m.Int64S) > 0 { + keysForInt64S := make([]int32, 0, len(m.Int64S)) + for k := range m.Int64S { + keysForInt64S = append(keysForInt64S, int32(k)) } - github_com_gogo_protobuf_sortkeys.Int32s(keysForBytes) - for _, k := range keysForBytes { - dAtA[i] = 0x42 - i++ - v := m.Bytes[int32(k)] - byteSize := 0 - if len(v) > 0 { - byteSize = 1 + len(v) + sovAttributes(uint64(len(v))) - } - mapSize := 1 + sozAttributes(uint64(k)) + byteSize - i = encodeVarintAttributes(dAtA, i, uint64(mapSize)) + github_com_gogo_protobuf_sortkeys.Int32s(keysForInt64S) + for iNdEx := len(keysForInt64S) - 1; iNdEx >= 0; iNdEx-- { + v := m.Int64S[int32(keysForInt64S[iNdEx])] + baseI := i + i = encodeVarintAttributes(dAtA, i, uint64(v)) + i-- + dAtA[i] = 0x10 + i = encodeVarintAttributes(dAtA, i, uint64((uint32(keysForInt64S[iNdEx])<<1)^uint32((keysForInt64S[iNdEx]>>31)))) + i-- dAtA[i] = 0x8 - i++ - i = encodeVarintAttributes(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) - if len(v) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintAttributes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } + i = encodeVarintAttributes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - if len(m.StringMaps) > 0 { - keysForStringMaps := make([]int32, 0, len(m.StringMaps)) - for k, _ := range m.StringMaps { - keysForStringMaps = append(keysForStringMaps, int32(k)) + if len(m.Strings) > 0 { + keysForStrings := make([]int32, 0, len(m.Strings)) + for k := range m.Strings { + keysForStrings = append(keysForStrings, int32(k)) } - github_com_gogo_protobuf_sortkeys.Int32s(keysForStringMaps) - for _, k := range keysForStringMaps { - dAtA[i] = 0x4a - i++ - v := m.StringMaps[int32(k)] - msgSize := 0 - if (&v) != nil { - msgSize = (&v).Size() - msgSize += 1 + sovAttributes(uint64(msgSize)) - } - mapSize := 1 + sozAttributes(uint64(k)) + msgSize - i = encodeVarintAttributes(dAtA, i, uint64(mapSize)) + github_com_gogo_protobuf_sortkeys.Int32s(keysForStrings) + for iNdEx := len(keysForStrings) - 1; iNdEx >= 0; iNdEx-- { + v := m.Strings[int32(keysForStrings[iNdEx])] + baseI := i + i = encodeVarintAttributes(dAtA, i, uint64((uint32(v)<<1)^uint32((v>>31)))) + i-- + dAtA[i] = 0x10 + i = encodeVarintAttributes(dAtA, i, uint64((uint32(keysForStrings[iNdEx])<<1)^uint32((keysForStrings[iNdEx]>>31)))) + i-- dAtA[i] = 0x8 - i++ - i = encodeVarintAttributes(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) + i = encodeVarintAttributes(dAtA, i, uint64(baseI-i)) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintAttributes(dAtA, i, uint64((&v).Size())) - n8, err := (&v).MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n8 } } - return i, nil + if len(m.Words) > 0 { + for iNdEx := len(m.Words) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Words[iNdEx]) + copy(dAtA[i:], m.Words[iNdEx]) + i = encodeVarintAttributes(dAtA, i, uint64(len(m.Words[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *StringMap) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1065,41 +1106,48 @@ func (m *StringMap) Marshal() (dAtA []byte, err error) { } func (m *StringMap) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StringMap) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Entries) > 0 { keysForEntries := make([]int32, 0, len(m.Entries)) - for k, _ := range m.Entries { + for k := range m.Entries { keysForEntries = append(keysForEntries, int32(k)) } github_com_gogo_protobuf_sortkeys.Int32s(keysForEntries) - for _, k := range keysForEntries { - dAtA[i] = 0xa - i++ - v := m.Entries[int32(k)] - mapSize := 1 + sozAttributes(uint64(k)) + 1 + sozAttributes(uint64(v)) - i = encodeVarintAttributes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0x8 - i++ - i = encodeVarintAttributes(dAtA, i, uint64((uint32(k)<<1)^uint32((k>>31)))) - dAtA[i] = 0x10 - i++ + for iNdEx := len(keysForEntries) - 1; iNdEx >= 0; iNdEx-- { + v := m.Entries[int32(keysForEntries[iNdEx])] + baseI := i i = encodeVarintAttributes(dAtA, i, uint64((uint32(v)<<1)^uint32((v>>31)))) + i-- + dAtA[i] = 0x10 + i = encodeVarintAttributes(dAtA, i, uint64((uint32(keysForEntries[iNdEx])<<1)^uint32((keysForEntries[iNdEx]>>31)))) + i-- + dAtA[i] = 0x8 + i = encodeVarintAttributes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func encodeVarintAttributes(dAtA []byte, offset int, v uint64) int { + offset -= sovAttributes(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Attributes) Size() (n int) { if m == nil { @@ -1341,14 +1389,7 @@ func (m *StringMap) Size() (n int) { } func sovAttributes(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozAttributes(x uint64) (n int) { return sovAttributes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/mixer/v1/config/client/api_spec.pb.go b/mixer/v1/config/client/api_spec.pb.go index 479e8e3c52d..7f77a92569b 100644 --- a/mixer/v1/config/client/api_spec.pb.go +++ b/mixer/v1/config/client/api_spec.pb.go @@ -10,6 +10,7 @@ import ( io "io" v1 "istio.io/api/mixer/v1" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -109,7 +110,7 @@ func (m *HTTPAPISpec) XXX_Unmarshal(b []byte) error { } func (m *HTTPAPISpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -165,7 +166,7 @@ func (m *HTTPAPISpecPattern) XXX_Unmarshal(b []byte) error { } func (m *HTTPAPISpecPattern) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -309,7 +310,7 @@ func (m *APIKey) XXX_Unmarshal(b []byte) error { } func (m *APIKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -484,7 +485,7 @@ func (m *HTTPAPISpecReference) XXX_Unmarshal(b []byte) error { } func (m *HTTPAPISpecReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -539,7 +540,7 @@ func (m *HTTPAPISpecBinding) XXX_Unmarshal(b []byte) error { } func (m *HTTPAPISpecBinding) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -609,7 +610,7 @@ var fileDescriptor_fb6b15fd2f44b459 = []byte{ func (m *HTTPAPISpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -617,51 +618,62 @@ func (m *HTTPAPISpec) Marshal() (dAtA []byte, err error) { } func (m *HTTPAPISpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPAPISpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Attributes != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintApiSpec(dAtA, i, uint64(m.Attributes.Size())) - n1, err := m.Attributes.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.ApiKeys) > 0 { + for iNdEx := len(m.ApiKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ApiKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApiSpec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - i += n1 } if len(m.Patterns) > 0 { - for _, msg := range m.Patterns { - dAtA[i] = 0x12 - i++ - i = encodeVarintApiSpec(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Patterns) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Patterns[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApiSpec(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if len(m.ApiKeys) > 0 { - for _, msg := range m.ApiKeys { - dAtA[i] = 0x1a - i++ - i = encodeVarintApiSpec(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.Attributes != nil { + { + size, err := m.Attributes.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintApiSpec(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HTTPAPISpecPattern) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -669,56 +681,76 @@ func (m *HTTPAPISpecPattern) Marshal() (dAtA []byte, err error) { } func (m *HTTPAPISpecPattern) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPAPISpecPattern) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Attributes != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintApiSpec(dAtA, i, uint64(m.Attributes.Size())) - n2, err := m.Attributes.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Pattern != nil { + { + size := m.Pattern.Size() + i -= size + if _, err := m.Pattern.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += n2 } if len(m.HttpMethod) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.HttpMethod) + copy(dAtA[i:], m.HttpMethod) i = encodeVarintApiSpec(dAtA, i, uint64(len(m.HttpMethod))) - i += copy(dAtA[i:], m.HttpMethod) + i-- + dAtA[i] = 0x12 } - if m.Pattern != nil { - nn3, err := m.Pattern.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Attributes != nil { + { + size, err := m.Attributes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApiSpec(dAtA, i, uint64(size)) } - i += nn3 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HTTPAPISpecPattern_UriTemplate) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x1a - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *HTTPAPISpecPattern_UriTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.UriTemplate) + copy(dAtA[i:], m.UriTemplate) i = encodeVarintApiSpec(dAtA, i, uint64(len(m.UriTemplate))) - i += copy(dAtA[i:], m.UriTemplate) - return i, nil + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil } func (m *HTTPAPISpecPattern_Regex) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x22 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *HTTPAPISpecPattern_Regex) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Regex) + copy(dAtA[i:], m.Regex) i = encodeVarintApiSpec(dAtA, i, uint64(len(m.Regex))) - i += copy(dAtA[i:], m.Regex) - return i, nil + i-- + dAtA[i] = 0x22 + return len(dAtA) - i, nil } func (m *APIKey) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -726,48 +758,70 @@ func (m *APIKey) Marshal() (dAtA []byte, err error) { } func (m *APIKey) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *APIKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Key != nil { - nn4, err := m.Key.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Key.Size() + i -= size + if _, err := m.Key.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn4 } - return i, nil + return len(dAtA) - i, nil } func (m *APIKey_Query) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0xa - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *APIKey_Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Query) + copy(dAtA[i:], m.Query) i = encodeVarintApiSpec(dAtA, i, uint64(len(m.Query))) - i += copy(dAtA[i:], m.Query) - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *APIKey_Header) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *APIKey_Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Header) + copy(dAtA[i:], m.Header) i = encodeVarintApiSpec(dAtA, i, uint64(len(m.Header))) - i += copy(dAtA[i:], m.Header) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *APIKey_Cookie) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x1a - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *APIKey_Cookie) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Cookie) + copy(dAtA[i:], m.Cookie) i = encodeVarintApiSpec(dAtA, i, uint64(len(m.Cookie))) - i += copy(dAtA[i:], m.Cookie) - return i, nil + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil } func (m *HTTPAPISpecReference) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -775,29 +829,36 @@ func (m *HTTPAPISpecReference) Marshal() (dAtA []byte, err error) { } func (m *HTTPAPISpecReference) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPAPISpecReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintApiSpec(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } if len(m.Namespace) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) i = encodeVarintApiSpec(dAtA, i, uint64(len(m.Namespace))) - i += copy(dAtA[i:], m.Namespace) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintApiSpec(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *HTTPAPISpecBinding) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -805,45 +866,56 @@ func (m *HTTPAPISpecBinding) Marshal() (dAtA []byte, err error) { } func (m *HTTPAPISpecBinding) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPAPISpecBinding) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Services) > 0 { - for _, msg := range m.Services { - dAtA[i] = 0xa - i++ - i = encodeVarintApiSpec(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.ApiSpecs) > 0 { + for iNdEx := len(m.ApiSpecs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ApiSpecs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApiSpec(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if len(m.ApiSpecs) > 0 { - for _, msg := range m.ApiSpecs { - dAtA[i] = 0x12 - i++ - i = encodeVarintApiSpec(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Services) > 0 { + for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Services[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApiSpec(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func encodeVarintApiSpec(dAtA []byte, offset int, v uint64) int { + offset -= sovApiSpec(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *HTTPAPISpec) Size() (n int) { if m == nil { @@ -991,14 +1063,7 @@ func (m *HTTPAPISpecBinding) Size() (n int) { } func sovApiSpec(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozApiSpec(x uint64) (n int) { return sovApiSpec(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1007,10 +1072,20 @@ func (this *HTTPAPISpec) String() string { if this == nil { return "nil" } + repeatedStringForPatterns := "[]*HTTPAPISpecPattern{" + for _, f := range this.Patterns { + repeatedStringForPatterns += strings.Replace(f.String(), "HTTPAPISpecPattern", "HTTPAPISpecPattern", 1) + "," + } + repeatedStringForPatterns += "}" + repeatedStringForApiKeys := "[]*APIKey{" + for _, f := range this.ApiKeys { + repeatedStringForApiKeys += strings.Replace(f.String(), "APIKey", "APIKey", 1) + "," + } + repeatedStringForApiKeys += "}" s := strings.Join([]string{`&HTTPAPISpec{`, `Attributes:` + strings.Replace(fmt.Sprintf("%v", this.Attributes), "Attributes", "v1.Attributes", 1) + `,`, - `Patterns:` + strings.Replace(fmt.Sprintf("%v", this.Patterns), "HTTPAPISpecPattern", "HTTPAPISpecPattern", 1) + `,`, - `ApiKeys:` + strings.Replace(fmt.Sprintf("%v", this.ApiKeys), "APIKey", "APIKey", 1) + `,`, + `Patterns:` + repeatedStringForPatterns + `,`, + `ApiKeys:` + repeatedStringForApiKeys + `,`, `}`, }, "") return s @@ -1102,9 +1177,19 @@ func (this *HTTPAPISpecBinding) String() string { if this == nil { return "nil" } + repeatedStringForServices := "[]*IstioService{" + for _, f := range this.Services { + repeatedStringForServices += strings.Replace(fmt.Sprintf("%v", f), "IstioService", "IstioService", 1) + "," + } + repeatedStringForServices += "}" + repeatedStringForApiSpecs := "[]*HTTPAPISpecReference{" + for _, f := range this.ApiSpecs { + repeatedStringForApiSpecs += strings.Replace(f.String(), "HTTPAPISpecReference", "HTTPAPISpecReference", 1) + "," + } + repeatedStringForApiSpecs += "}" s := strings.Join([]string{`&HTTPAPISpecBinding{`, - `Services:` + strings.Replace(fmt.Sprintf("%v", this.Services), "IstioService", "IstioService", 1) + `,`, - `ApiSpecs:` + strings.Replace(fmt.Sprintf("%v", this.ApiSpecs), "HTTPAPISpecReference", "HTTPAPISpecReference", 1) + `,`, + `Services:` + repeatedStringForServices + `,`, + `ApiSpecs:` + repeatedStringForApiSpecs + `,`, `}`, }, "") return s diff --git a/mixer/v1/config/client/client_config.pb.go b/mixer/v1/config/client/client_config.pb.go index f3ba90e5bd8..bd5e95274b5 100644 --- a/mixer/v1/config/client/client_config.pb.go +++ b/mixer/v1/config/client/client_config.pb.go @@ -14,6 +14,7 @@ import ( io "io" v1 "istio.io/api/mixer/v1" math "math" + math_bits "math/bits" reflect "reflect" strconv "strconv" strings "strings" @@ -78,7 +79,7 @@ func (m *NetworkFailPolicy) XXX_Unmarshal(b []byte) error { } func (m *NetworkFailPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -141,7 +142,7 @@ func (m *ServiceConfig) XXX_Unmarshal(b []byte) error { } func (m *ServiceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -217,7 +218,7 @@ func (m *TransportConfig) XXX_Unmarshal(b []byte) error { } func (m *TransportConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -265,7 +266,7 @@ func (m *HttpClientConfig) XXX_Unmarshal(b []byte) error { } func (m *HttpClientConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -314,7 +315,7 @@ func (m *TcpClientConfig) XXX_Unmarshal(b []byte) error { } func (m *TcpClientConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -423,7 +424,7 @@ func (x NetworkFailPolicy_FailPolicy) String() string { func (m *NetworkFailPolicy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -431,47 +432,56 @@ func (m *NetworkFailPolicy) Marshal() (dAtA []byte, err error) { } func (m *NetworkFailPolicy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NetworkFailPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Policy != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.Policy)) - } - if m.MaxRetry != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.MaxRetry)) + if m.MaxRetryWait != nil { + { + size, err := m.MaxRetryWait.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } if m.BaseRetryWait != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.BaseRetryWait.Size())) - n1, err := m.BaseRetryWait.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.BaseRetryWait.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) } - i += n1 + i-- + dAtA[i] = 0x1a } - if m.MaxRetryWait != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.MaxRetryWait.Size())) - n2, err := m.MaxRetryWait.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 + if m.MaxRetry != 0 { + i = encodeVarintClientConfig(dAtA, i, uint64(m.MaxRetry)) + i-- + dAtA[i] = 0x10 + } + if m.Policy != 0 { + i = encodeVarintClientConfig(dAtA, i, uint64(m.Policy)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ServiceConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -479,91 +489,106 @@ func (m *ServiceConfig) Marshal() (dAtA []byte, err error) { } func (m *ServiceConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.DisableCheckCalls { - dAtA[i] = 0x8 - i++ - if m.DisableCheckCalls { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if m.ForwardAttributes != nil { + { + size, err := m.ForwardAttributes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) } - i++ + i-- + dAtA[i] = 0x42 } - if m.DisableReportCalls { - dAtA[i] = 0x10 - i++ - if m.DisableReportCalls { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if m.NetworkFailPolicy != nil { + { + size, err := m.NetworkFailPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) } - i++ + i-- + dAtA[i] = 0x3a } - if m.MixerAttributes != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.MixerAttributes.Size())) - n3, err := m.MixerAttributes.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.QuotaSpec) > 0 { + for iNdEx := len(m.QuotaSpec) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.QuotaSpec[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a } - i += n3 } if len(m.HttpApiSpec) > 0 { - for _, msg := range m.HttpApiSpec { - dAtA[i] = 0x22 - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.HttpApiSpec) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.HttpApiSpec[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x22 } } - if len(m.QuotaSpec) > 0 { - for _, msg := range m.QuotaSpec { - dAtA[i] = 0x2a - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.MixerAttributes != nil { + { + size, err := m.MixerAttributes.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a } - if m.NetworkFailPolicy != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.NetworkFailPolicy.Size())) - n4, err := m.NetworkFailPolicy.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.DisableReportCalls { + i-- + if m.DisableReportCalls { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } - i += n4 + i-- + dAtA[i] = 0x10 } - if m.ForwardAttributes != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.ForwardAttributes.Size())) - n5, err := m.ForwardAttributes.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.DisableCheckCalls { + i-- + if m.DisableCheckCalls { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } - i += n5 + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *TransportConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -571,104 +596,119 @@ func (m *TransportConfig) Marshal() (dAtA []byte, err error) { } func (m *TransportConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransportConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.DisableCheckCache { - dAtA[i] = 0x8 - i++ - if m.DisableCheckCache { + if m.ReportBatchMaxTime != nil { + { + size, err := m.ReportBatchMaxTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.ReportBatchMaxEntries != 0 { + i = encodeVarintClientConfig(dAtA, i, uint64(m.ReportBatchMaxEntries)) + i-- + dAtA[i] = 0x48 + } + if m.AttributesForMixerProxy != nil { + { + size, err := m.AttributesForMixerProxy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.ReportCluster) > 0 { + i -= len(m.ReportCluster) + copy(dAtA[i:], m.ReportCluster) + i = encodeVarintClientConfig(dAtA, i, uint64(len(m.ReportCluster))) + i-- + dAtA[i] = 0x3a + } + if len(m.CheckCluster) > 0 { + i -= len(m.CheckCluster) + copy(dAtA[i:], m.CheckCluster) + i = encodeVarintClientConfig(dAtA, i, uint64(len(m.CheckCluster))) + i-- + dAtA[i] = 0x32 + } + if m.StatsUpdateInterval != nil { + { + size, err := m.StatsUpdateInterval.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.NetworkFailPolicy != nil { + { + size, err := m.NetworkFailPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.DisableReportBatch { + i-- + if m.DisableReportBatch { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } if m.DisableQuotaCache { - dAtA[i] = 0x10 - i++ + i-- if m.DisableQuotaCache { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - if m.DisableReportBatch { - dAtA[i] = 0x18 - i++ - if m.DisableReportBatch { + if m.DisableCheckCache { + i-- + if m.DisableCheckCache { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.NetworkFailPolicy != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.NetworkFailPolicy.Size())) - n6, err := m.NetworkFailPolicy.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 - } - if m.StatsUpdateInterval != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.StatsUpdateInterval.Size())) - n7, err := m.StatsUpdateInterval.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 - } - if len(m.CheckCluster) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(len(m.CheckCluster))) - i += copy(dAtA[i:], m.CheckCluster) - } - if len(m.ReportCluster) > 0 { - dAtA[i] = 0x3a - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(len(m.ReportCluster))) - i += copy(dAtA[i:], m.ReportCluster) - } - if m.AttributesForMixerProxy != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.AttributesForMixerProxy.Size())) - n8, err := m.AttributesForMixerProxy.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n8 - } - if m.ReportBatchMaxEntries != 0 { - dAtA[i] = 0x48 - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.ReportBatchMaxEntries)) - } - if m.ReportBatchMaxTime != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.ReportBatchMaxTime.Size())) - n9, err := m.ReportBatchMaxTime.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *HttpClientConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -676,86 +716,96 @@ func (m *HttpClientConfig) Marshal() (dAtA []byte, err error) { } func (m *HttpClientConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HttpClientConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Transport != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.Transport.Size())) - n10, err := m.Transport.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ForwardAttributes != nil { + { + size, err := m.ForwardAttributes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.MixerAttributes != nil { + { + size, err := m.MixerAttributes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0x22 + } + if len(m.DefaultDestinationService) > 0 { + i -= len(m.DefaultDestinationService) + copy(dAtA[i:], m.DefaultDestinationService) + i = encodeVarintClientConfig(dAtA, i, uint64(len(m.DefaultDestinationService))) + i-- + dAtA[i] = 0x1a } if len(m.ServiceConfigs) > 0 { keysForServiceConfigs := make([]string, 0, len(m.ServiceConfigs)) - for k, _ := range m.ServiceConfigs { + for k := range m.ServiceConfigs { keysForServiceConfigs = append(keysForServiceConfigs, string(k)) } github_com_gogo_protobuf_sortkeys.Strings(keysForServiceConfigs) - for _, k := range keysForServiceConfigs { - dAtA[i] = 0x12 - i++ - v := m.ServiceConfigs[string(k)] - msgSize := 0 - if v != nil { - msgSize = v.Size() - msgSize += 1 + sovClientConfig(uint64(msgSize)) - } - mapSize := 1 + len(k) + sovClientConfig(uint64(len(k))) + msgSize - i = encodeVarintClientConfig(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + for iNdEx := len(keysForServiceConfigs) - 1; iNdEx >= 0; iNdEx-- { + v := m.ServiceConfigs[string(keysForServiceConfigs[iNdEx])] + baseI := i if v != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(v.Size())) - n11, err := v.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) } - i += n11 + i-- + dAtA[i] = 0x12 } + i -= len(keysForServiceConfigs[iNdEx]) + copy(dAtA[i:], keysForServiceConfigs[iNdEx]) + i = encodeVarintClientConfig(dAtA, i, uint64(len(keysForServiceConfigs[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintClientConfig(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - if len(m.DefaultDestinationService) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(len(m.DefaultDestinationService))) - i += copy(dAtA[i:], m.DefaultDestinationService) - } - if m.MixerAttributes != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.MixerAttributes.Size())) - n12, err := m.MixerAttributes.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n12 - } - if m.ForwardAttributes != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.ForwardAttributes.Size())) - n13, err := m.ForwardAttributes.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Transport != nil { + { + size, err := m.Transport.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *TcpClientConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -763,81 +813,96 @@ func (m *TcpClientConfig) Marshal() (dAtA []byte, err error) { } func (m *TcpClientConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TcpClientConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Transport != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.Transport.Size())) - n14, err := m.Transport.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ReportInterval != nil { + { + size, err := m.ReportInterval.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0x32 } - if m.MixerAttributes != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.MixerAttributes.Size())) - n15, err := m.MixerAttributes.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ConnectionQuotaSpec != nil { + { + size, err := m.ConnectionQuotaSpec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) } - i += n15 + i-- + dAtA[i] = 0x2a } - if m.DisableCheckCalls { - dAtA[i] = 0x18 - i++ - if m.DisableCheckCalls { + if m.DisableReportCalls { + i-- + if m.DisableReportCalls { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.DisableReportCalls { + i-- dAtA[i] = 0x20 - i++ - if m.DisableReportCalls { + } + if m.DisableCheckCalls { + i-- + if m.DisableCheckCalls { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - if m.ConnectionQuotaSpec != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.ConnectionQuotaSpec.Size())) - n16, err := m.ConnectionQuotaSpec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.MixerAttributes != nil { + { + size, err := m.MixerAttributes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) } - i += n16 + i-- + dAtA[i] = 0x12 } - if m.ReportInterval != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintClientConfig(dAtA, i, uint64(m.ReportInterval.Size())) - n17, err := m.ReportInterval.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Transport != nil { + { + size, err := m.Transport.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClientConfig(dAtA, i, uint64(size)) } - i += n17 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintClientConfig(dAtA []byte, offset int, v uint64) int { + offset -= sovClientConfig(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *NetworkFailPolicy) Size() (n int) { if m == nil { @@ -1016,14 +1081,7 @@ func (m *TcpClientConfig) Size() (n int) { } func sovClientConfig(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozClientConfig(x uint64) (n int) { return sovClientConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1045,13 +1103,23 @@ func (this *ServiceConfig) String() string { if this == nil { return "nil" } + repeatedStringForHttpApiSpec := "[]*HTTPAPISpec{" + for _, f := range this.HttpApiSpec { + repeatedStringForHttpApiSpec += strings.Replace(fmt.Sprintf("%v", f), "HTTPAPISpec", "HTTPAPISpec", 1) + "," + } + repeatedStringForHttpApiSpec += "}" + repeatedStringForQuotaSpec := "[]*QuotaSpec{" + for _, f := range this.QuotaSpec { + repeatedStringForQuotaSpec += strings.Replace(fmt.Sprintf("%v", f), "QuotaSpec", "QuotaSpec", 1) + "," + } + repeatedStringForQuotaSpec += "}" s := strings.Join([]string{`&ServiceConfig{`, `DisableCheckCalls:` + fmt.Sprintf("%v", this.DisableCheckCalls) + `,`, `DisableReportCalls:` + fmt.Sprintf("%v", this.DisableReportCalls) + `,`, `MixerAttributes:` + strings.Replace(fmt.Sprintf("%v", this.MixerAttributes), "Attributes", "v1.Attributes", 1) + `,`, - `HttpApiSpec:` + strings.Replace(fmt.Sprintf("%v", this.HttpApiSpec), "HTTPAPISpec", "HTTPAPISpec", 1) + `,`, - `QuotaSpec:` + strings.Replace(fmt.Sprintf("%v", this.QuotaSpec), "QuotaSpec", "QuotaSpec", 1) + `,`, - `NetworkFailPolicy:` + strings.Replace(fmt.Sprintf("%v", this.NetworkFailPolicy), "NetworkFailPolicy", "NetworkFailPolicy", 1) + `,`, + `HttpApiSpec:` + repeatedStringForHttpApiSpec + `,`, + `QuotaSpec:` + repeatedStringForQuotaSpec + `,`, + `NetworkFailPolicy:` + strings.Replace(this.NetworkFailPolicy.String(), "NetworkFailPolicy", "NetworkFailPolicy", 1) + `,`, `ForwardAttributes:` + strings.Replace(fmt.Sprintf("%v", this.ForwardAttributes), "Attributes", "v1.Attributes", 1) + `,`, `}`, }, "") @@ -1065,7 +1133,7 @@ func (this *TransportConfig) String() string { `DisableCheckCache:` + fmt.Sprintf("%v", this.DisableCheckCache) + `,`, `DisableQuotaCache:` + fmt.Sprintf("%v", this.DisableQuotaCache) + `,`, `DisableReportBatch:` + fmt.Sprintf("%v", this.DisableReportBatch) + `,`, - `NetworkFailPolicy:` + strings.Replace(fmt.Sprintf("%v", this.NetworkFailPolicy), "NetworkFailPolicy", "NetworkFailPolicy", 1) + `,`, + `NetworkFailPolicy:` + strings.Replace(this.NetworkFailPolicy.String(), "NetworkFailPolicy", "NetworkFailPolicy", 1) + `,`, `StatsUpdateInterval:` + strings.Replace(fmt.Sprintf("%v", this.StatsUpdateInterval), "Duration", "types.Duration", 1) + `,`, `CheckCluster:` + fmt.Sprintf("%v", this.CheckCluster) + `,`, `ReportCluster:` + fmt.Sprintf("%v", this.ReportCluster) + `,`, @@ -1091,7 +1159,7 @@ func (this *HttpClientConfig) String() string { } mapStringForServiceConfigs += "}" s := strings.Join([]string{`&HttpClientConfig{`, - `Transport:` + strings.Replace(fmt.Sprintf("%v", this.Transport), "TransportConfig", "TransportConfig", 1) + `,`, + `Transport:` + strings.Replace(this.Transport.String(), "TransportConfig", "TransportConfig", 1) + `,`, `ServiceConfigs:` + mapStringForServiceConfigs + `,`, `DefaultDestinationService:` + fmt.Sprintf("%v", this.DefaultDestinationService) + `,`, `MixerAttributes:` + strings.Replace(fmt.Sprintf("%v", this.MixerAttributes), "Attributes", "v1.Attributes", 1) + `,`, @@ -1105,7 +1173,7 @@ func (this *TcpClientConfig) String() string { return "nil" } s := strings.Join([]string{`&TcpClientConfig{`, - `Transport:` + strings.Replace(fmt.Sprintf("%v", this.Transport), "TransportConfig", "TransportConfig", 1) + `,`, + `Transport:` + strings.Replace(this.Transport.String(), "TransportConfig", "TransportConfig", 1) + `,`, `MixerAttributes:` + strings.Replace(fmt.Sprintf("%v", this.MixerAttributes), "Attributes", "v1.Attributes", 1) + `,`, `DisableCheckCalls:` + fmt.Sprintf("%v", this.DisableCheckCalls) + `,`, `DisableReportCalls:` + fmt.Sprintf("%v", this.DisableReportCalls) + `,`, diff --git a/mixer/v1/config/client/quota.pb.go b/mixer/v1/config/client/quota.pb.go index 39fe9ff3118..38e0ccf3e53 100644 --- a/mixer/v1/config/client/quota.pb.go +++ b/mixer/v1/config/client/quota.pb.go @@ -10,6 +10,7 @@ import ( github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -41,7 +42,7 @@ func (m *QuotaSpec) XXX_Unmarshal(b []byte) error { } func (m *QuotaSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -79,7 +80,7 @@ func (m *QuotaRule) XXX_Unmarshal(b []byte) error { } func (m *QuotaRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -117,7 +118,7 @@ func (m *StringMatch) XXX_Unmarshal(b []byte) error { } func (m *StringMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -289,7 +290,7 @@ func (m *AttributeMatch) XXX_Unmarshal(b []byte) error { } func (m *AttributeMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -325,7 +326,7 @@ func (m *Quota) XXX_Unmarshal(b []byte) error { } func (m *Quota) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -364,7 +365,7 @@ func (m *QuotaSpecBinding) XXX_Unmarshal(b []byte) error { } func (m *QuotaSpecBinding) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -403,7 +404,7 @@ func (m *QuotaSpecBinding_QuotaSpecReference) XXX_Unmarshal(b []byte) error { } func (m *QuotaSpecBinding_QuotaSpecReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -475,7 +476,7 @@ var fileDescriptor_81777b5d047af315 = []byte{ func (m *QuotaSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -483,29 +484,36 @@ func (m *QuotaSpec) Marshal() (dAtA []byte, err error) { } func (m *QuotaSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuotaSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Rules) > 0 { - for _, msg := range m.Rules { - dAtA[i] = 0xa - i++ - i = encodeVarintQuota(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuota(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *QuotaRule) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -513,41 +521,50 @@ func (m *QuotaRule) Marshal() (dAtA []byte, err error) { } func (m *QuotaRule) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuotaRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Match) > 0 { - for _, msg := range m.Match { - dAtA[i] = 0xa - i++ - i = encodeVarintQuota(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Quotas) > 0 { + for iNdEx := len(m.Quotas) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Quotas[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuota(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if len(m.Quotas) > 0 { - for _, msg := range m.Quotas { - dAtA[i] = 0x12 - i++ - i = encodeVarintQuota(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Match) > 0 { + for iNdEx := len(m.Match) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Match[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuota(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *StringMatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -555,48 +572,70 @@ func (m *StringMatch) Marshal() (dAtA []byte, err error) { } func (m *StringMatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StringMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.MatchType != nil { - nn1, err := m.MatchType.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.MatchType.Size() + i -= size + if _, err := m.MatchType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn1 } - return i, nil + return len(dAtA) - i, nil } func (m *StringMatch_Exact) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0xa - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *StringMatch_Exact) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Exact) + copy(dAtA[i:], m.Exact) i = encodeVarintQuota(dAtA, i, uint64(len(m.Exact))) - i += copy(dAtA[i:], m.Exact) - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *StringMatch_Prefix) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *StringMatch_Prefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) i = encodeVarintQuota(dAtA, i, uint64(len(m.Prefix))) - i += copy(dAtA[i:], m.Prefix) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *StringMatch_Regex) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x1a - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *StringMatch_Regex) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Regex) + copy(dAtA[i:], m.Regex) i = encodeVarintQuota(dAtA, i, uint64(len(m.Regex))) - i += copy(dAtA[i:], m.Regex) - return i, nil + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil } func (m *AttributeMatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -604,50 +643,53 @@ func (m *AttributeMatch) Marshal() (dAtA []byte, err error) { } func (m *AttributeMatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AttributeMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Clause) > 0 { keysForClause := make([]string, 0, len(m.Clause)) - for k, _ := range m.Clause { + for k := range m.Clause { keysForClause = append(keysForClause, string(k)) } github_com_gogo_protobuf_sortkeys.Strings(keysForClause) - for _, k := range keysForClause { - dAtA[i] = 0xa - i++ - v := m.Clause[string(k)] - msgSize := 0 + for iNdEx := len(keysForClause) - 1; iNdEx >= 0; iNdEx-- { + v := m.Clause[string(keysForClause[iNdEx])] + baseI := i if v != nil { - msgSize = v.Size() - msgSize += 1 + sovQuota(uint64(msgSize)) - } - mapSize := 1 + len(k) + sovQuota(uint64(len(k))) + msgSize - i = encodeVarintQuota(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintQuota(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - if v != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintQuota(dAtA, i, uint64(v.Size())) - n2, err := v.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuota(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x12 } + i -= len(keysForClause[iNdEx]) + copy(dAtA[i:], keysForClause[iNdEx]) + i = encodeVarintQuota(dAtA, i, uint64(len(keysForClause[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuota(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *Quota) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -655,28 +697,34 @@ func (m *Quota) Marshal() (dAtA []byte, err error) { } func (m *Quota) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Quota) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Quota) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintQuota(dAtA, i, uint64(len(m.Quota))) - i += copy(dAtA[i:], m.Quota) - } if m.Charge != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintQuota(dAtA, i, uint64(m.Charge)) + i-- + dAtA[i] = 0x10 + } + if len(m.Quota) > 0 { + i -= len(m.Quota) + copy(dAtA[i:], m.Quota) + i = encodeVarintQuota(dAtA, i, uint64(len(m.Quota))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *QuotaSpecBinding) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -684,41 +732,50 @@ func (m *QuotaSpecBinding) Marshal() (dAtA []byte, err error) { } func (m *QuotaSpecBinding) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuotaSpecBinding) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Services) > 0 { - for _, msg := range m.Services { - dAtA[i] = 0xa - i++ - i = encodeVarintQuota(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.QuotaSpecs) > 0 { + for iNdEx := len(m.QuotaSpecs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.QuotaSpecs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuota(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if len(m.QuotaSpecs) > 0 { - for _, msg := range m.QuotaSpecs { - dAtA[i] = 0x12 - i++ - i = encodeVarintQuota(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Services) > 0 { + for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Services[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuota(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *QuotaSpecBinding_QuotaSpecReference) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -726,33 +783,42 @@ func (m *QuotaSpecBinding_QuotaSpecReference) Marshal() (dAtA []byte, err error) } func (m *QuotaSpecBinding_QuotaSpecReference) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuotaSpecBinding_QuotaSpecReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintQuota(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } if len(m.Namespace) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) i = encodeVarintQuota(dAtA, i, uint64(len(m.Namespace))) - i += copy(dAtA[i:], m.Namespace) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintQuota(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func encodeVarintQuota(dAtA []byte, offset int, v uint64) int { + offset -= sovQuota(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *QuotaSpec) Size() (n int) { if m == nil { @@ -909,14 +975,7 @@ func (m *QuotaSpecBinding_QuotaSpecReference) Size() (n int) { } func sovQuota(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozQuota(x uint64) (n int) { return sovQuota(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -925,8 +984,13 @@ func (this *QuotaSpec) String() string { if this == nil { return "nil" } + repeatedStringForRules := "[]*QuotaRule{" + for _, f := range this.Rules { + repeatedStringForRules += strings.Replace(f.String(), "QuotaRule", "QuotaRule", 1) + "," + } + repeatedStringForRules += "}" s := strings.Join([]string{`&QuotaSpec{`, - `Rules:` + strings.Replace(fmt.Sprintf("%v", this.Rules), "QuotaRule", "QuotaRule", 1) + `,`, + `Rules:` + repeatedStringForRules + `,`, `}`, }, "") return s @@ -935,9 +999,19 @@ func (this *QuotaRule) String() string { if this == nil { return "nil" } + repeatedStringForMatch := "[]*AttributeMatch{" + for _, f := range this.Match { + repeatedStringForMatch += strings.Replace(f.String(), "AttributeMatch", "AttributeMatch", 1) + "," + } + repeatedStringForMatch += "}" + repeatedStringForQuotas := "[]*Quota{" + for _, f := range this.Quotas { + repeatedStringForQuotas += strings.Replace(f.String(), "Quota", "Quota", 1) + "," + } + repeatedStringForQuotas += "}" s := strings.Join([]string{`&QuotaRule{`, - `Match:` + strings.Replace(fmt.Sprintf("%v", this.Match), "AttributeMatch", "AttributeMatch", 1) + `,`, - `Quotas:` + strings.Replace(fmt.Sprintf("%v", this.Quotas), "Quota", "Quota", 1) + `,`, + `Match:` + repeatedStringForMatch + `,`, + `Quotas:` + repeatedStringForQuotas + `,`, `}`, }, "") return s @@ -1017,9 +1091,19 @@ func (this *QuotaSpecBinding) String() string { if this == nil { return "nil" } + repeatedStringForServices := "[]*IstioService{" + for _, f := range this.Services { + repeatedStringForServices += strings.Replace(fmt.Sprintf("%v", f), "IstioService", "IstioService", 1) + "," + } + repeatedStringForServices += "}" + repeatedStringForQuotaSpecs := "[]*QuotaSpecBinding_QuotaSpecReference{" + for _, f := range this.QuotaSpecs { + repeatedStringForQuotaSpecs += strings.Replace(fmt.Sprintf("%v", f), "QuotaSpecBinding_QuotaSpecReference", "QuotaSpecBinding_QuotaSpecReference", 1) + "," + } + repeatedStringForQuotaSpecs += "}" s := strings.Join([]string{`&QuotaSpecBinding{`, - `Services:` + strings.Replace(fmt.Sprintf("%v", this.Services), "IstioService", "IstioService", 1) + `,`, - `QuotaSpecs:` + strings.Replace(fmt.Sprintf("%v", this.QuotaSpecs), "QuotaSpecBinding_QuotaSpecReference", "QuotaSpecBinding_QuotaSpecReference", 1) + `,`, + `Services:` + repeatedStringForServices + `,`, + `QuotaSpecs:` + repeatedStringForQuotaSpecs + `,`, `}`, }, "") return s diff --git a/mixer/v1/config/client/service.pb.go b/mixer/v1/config/client/service.pb.go index 34e237910f4..95dc3e629d4 100644 --- a/mixer/v1/config/client/service.pb.go +++ b/mixer/v1/config/client/service.pb.go @@ -10,6 +10,7 @@ import ( github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -54,7 +55,7 @@ func (m *IstioService) XXX_Unmarshal(b []byte) error { } func (m *IstioService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -108,7 +109,7 @@ var fileDescriptor_3358a28a51c817d5 = []byte{ func (m *IstioService) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -116,67 +117,80 @@ func (m *IstioService) Marshal() (dAtA []byte, err error) { } func (m *IstioService) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IstioService) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintService(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Namespace) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintService(dAtA, i, uint64(len(m.Namespace))) - i += copy(dAtA[i:], m.Namespace) - } - if len(m.Domain) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintService(dAtA, i, uint64(len(m.Domain))) - i += copy(dAtA[i:], m.Domain) - } - if len(m.Service) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintService(dAtA, i, uint64(len(m.Service))) - i += copy(dAtA[i:], m.Service) - } if len(m.Labels) > 0 { keysForLabels := make([]string, 0, len(m.Labels)) - for k, _ := range m.Labels { + for k := range m.Labels { keysForLabels = append(keysForLabels, string(k)) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - for _, k := range keysForLabels { - dAtA[i] = 0x2a - i++ - v := m.Labels[string(k)] - mapSize := 1 + len(k) + sovService(uint64(len(k))) + 1 + len(v) + sovService(uint64(len(v))) - i = encodeVarintService(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintService(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + for iNdEx := len(keysForLabels) - 1; iNdEx >= 0; iNdEx-- { + v := m.Labels[string(keysForLabels[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintService(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(keysForLabels[iNdEx]) + copy(dAtA[i:], keysForLabels[iNdEx]) + i = encodeVarintService(dAtA, i, uint64(len(keysForLabels[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a } } - return i, nil + if len(m.Service) > 0 { + i -= len(m.Service) + copy(dAtA[i:], m.Service) + i = encodeVarintService(dAtA, i, uint64(len(m.Service))) + i-- + dAtA[i] = 0x22 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintService(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0x1a + } + if len(m.Namespace) > 0 { + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintService(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintService(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func encodeVarintService(dAtA []byte, offset int, v uint64) int { + offset -= sovService(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *IstioService) Size() (n int) { if m == nil { @@ -212,14 +226,7 @@ func (m *IstioService) Size() (n int) { } func sovService(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozService(x uint64) (n int) { return sovService(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/mixer/v1/mixer.pb.go b/mixer/v1/mixer.pb.go index 83deae51af8..5916d8bd4a3 100644 --- a/mixer/v1/mixer.pb.go +++ b/mixer/v1/mixer.pb.go @@ -16,8 +16,11 @@ import ( _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strconv "strconv" strings "strings" @@ -149,7 +152,7 @@ func (m *CheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_CheckRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -189,7 +192,7 @@ func (m *CheckRequest_QuotaParams) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_CheckRequest_QuotaParams.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -229,7 +232,7 @@ func (m *CheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_CheckResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -278,7 +281,7 @@ func (m *CheckResponse_PreconditionResult) XXX_Marshal(b []byte, deterministic b return xxx_messageInfo_CheckResponse_PreconditionResult.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -325,7 +328,7 @@ func (m *CheckResponse_QuotaResult) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_CheckResponse_QuotaResult.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -367,7 +370,7 @@ func (m *ReferencedAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_ReferencedAttributes.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -422,7 +425,7 @@ func (m *ReferencedAttributes_AttributeMatch) XXX_Marshal(b []byte, deterministi return xxx_messageInfo_ReferencedAttributes_AttributeMatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -467,7 +470,7 @@ func (m *HeaderOperation) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_HeaderOperation.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -514,7 +517,7 @@ func (m *RouteDirective) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_RouteDirective.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -568,7 +571,7 @@ func (m *ReportRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_ReportRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -604,7 +607,7 @@ func (m *ReportResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_ReportResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -807,6 +810,17 @@ type MixerServer interface { Report(context.Context, *ReportRequest) (*ReportResponse, error) } +// UnimplementedMixerServer can be embedded to have forward compatible implementations. +type UnimplementedMixerServer struct { +} + +func (*UnimplementedMixerServer) Check(ctx context.Context, req *CheckRequest) (*CheckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") +} +func (*UnimplementedMixerServer) Report(ctx context.Context, req *ReportRequest) (*ReportResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Report not implemented") +} + func RegisterMixerServer(s *grpc.Server, srv MixerServer) { s.RegisterService(&_Mixer_serviceDesc, srv) } @@ -867,7 +881,7 @@ var _Mixer_serviceDesc = grpc.ServiceDesc{ func (m *CheckRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -875,62 +889,68 @@ func (m *CheckRequest) Marshal() (dAtA []byte, err error) { } func (m *CheckRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CheckRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintMixer(dAtA, i, uint64(m.Attributes.Size())) - n1, err := m.Attributes.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - if m.GlobalWordCount != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintMixer(dAtA, i, uint64(m.GlobalWordCount)) - } - if len(m.DeduplicationId) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintMixer(dAtA, i, uint64(len(m.DeduplicationId))) - i += copy(dAtA[i:], m.DeduplicationId) - } if len(m.Quotas) > 0 { - for k, _ := range m.Quotas { - dAtA[i] = 0x22 - i++ + for k := range m.Quotas { v := m.Quotas[k] - msgSize := 0 - if (&v) != nil { - msgSize = (&v).Size() - msgSize += 1 + sovMixer(uint64(msgSize)) + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMixer(dAtA, i, uint64(size)) } - mapSize := 1 + len(k) + sovMixer(uint64(len(k))) + msgSize - i = encodeVarintMixer(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintMixer(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintMixer(dAtA, i, uint64((&v).Size())) - n2, err := (&v).MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintMixer(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintMixer(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 + } + } + if len(m.DeduplicationId) > 0 { + i -= len(m.DeduplicationId) + copy(dAtA[i:], m.DeduplicationId) + i = encodeVarintMixer(dAtA, i, uint64(len(m.DeduplicationId))) + i-- + dAtA[i] = 0x1a + } + if m.GlobalWordCount != 0 { + i = encodeVarintMixer(dAtA, i, uint64(m.GlobalWordCount)) + i-- + dAtA[i] = 0x10 + } + { + size, err := m.Attributes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintMixer(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *CheckRequest_QuotaParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -938,32 +958,37 @@ func (m *CheckRequest_QuotaParams) Marshal() (dAtA []byte, err error) { } func (m *CheckRequest_QuotaParams) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CheckRequest_QuotaParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Amount != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintMixer(dAtA, i, uint64(m.Amount)) - } if m.BestEffort { - dAtA[i] = 0x10 - i++ + i-- if m.BestEffort { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - return i, nil + if m.Amount != 0 { + i = encodeVarintMixer(dAtA, i, uint64(m.Amount)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *CheckResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -971,51 +996,56 @@ func (m *CheckResponse) Marshal() (dAtA []byte, err error) { } func (m *CheckResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CheckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0x12 - i++ - i = encodeVarintMixer(dAtA, i, uint64(m.Precondition.Size())) - n3, err := m.Precondition.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 if len(m.Quotas) > 0 { - for k, _ := range m.Quotas { - dAtA[i] = 0x1a - i++ + for k := range m.Quotas { v := m.Quotas[k] - msgSize := 0 - if (&v) != nil { - msgSize = (&v).Size() - msgSize += 1 + sovMixer(uint64(msgSize)) + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMixer(dAtA, i, uint64(size)) } - mapSize := 1 + len(k) + sovMixer(uint64(len(k))) + msgSize - i = encodeVarintMixer(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintMixer(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintMixer(dAtA, i, uint64((&v).Size())) - n4, err := (&v).MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintMixer(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintMixer(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } + } + { + size, err := m.Precondition.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintMixer(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *CheckResponse_PreconditionResult) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1023,58 +1053,69 @@ func (m *CheckResponse_PreconditionResult) Marshal() (dAtA []byte, err error) { } func (m *CheckResponse_PreconditionResult) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CheckResponse_PreconditionResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintMixer(dAtA, i, uint64(m.Status.Size())) - n5, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.RouteDirective != nil { + { + size, err := m.RouteDirective.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMixer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 } - i += n5 - dAtA[i] = 0x12 - i++ - i = encodeVarintMixer(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.ValidDuration))) - n6, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ValidDuration, dAtA[i:]) - if err != nil { - return 0, err + if m.ReferencedAttributes != nil { + { + size, err := m.ReferencedAttributes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMixer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a } - i += n6 if m.ValidUseCount != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintMixer(dAtA, i, uint64(m.ValidUseCount)) + i-- + dAtA[i] = 0x18 } - if m.ReferencedAttributes != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintMixer(dAtA, i, uint64(m.ReferencedAttributes.Size())) - n7, err := m.ReferencedAttributes.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 + n7, err7 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ValidDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ValidDuration):]) + if err7 != nil { + return 0, err7 } - if m.RouteDirective != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintMixer(dAtA, i, uint64(m.RouteDirective.Size())) - n8, err := m.RouteDirective.MarshalTo(dAtA[i:]) + i -= n7 + i = encodeVarintMixer(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x12 + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n8 + i -= size + i = encodeVarintMixer(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *CheckResponse_QuotaResult) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1082,46 +1123,55 @@ func (m *CheckResponse_QuotaResult) Marshal() (dAtA []byte, err error) { } func (m *CheckResponse_QuotaResult) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CheckResponse_QuotaResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintMixer(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.ValidDuration))) - n9, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ValidDuration, dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMixer(dAtA, i, uint64(size)) } - i += n9 - if m.GrantedAmount != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintMixer(dAtA, i, uint64(m.GrantedAmount)) + i-- + dAtA[i] = 0x32 + { + size, err := m.ReferencedAttributes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMixer(dAtA, i, uint64(size)) } + i-- dAtA[i] = 0x2a - i++ - i = encodeVarintMixer(dAtA, i, uint64(m.ReferencedAttributes.Size())) - n10, err := m.ReferencedAttributes.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.GrantedAmount != 0 { + i = encodeVarintMixer(dAtA, i, uint64(m.GrantedAmount)) + i-- + dAtA[i] = 0x10 } - i += n10 - dAtA[i] = 0x32 - i++ - i = encodeVarintMixer(dAtA, i, uint64(m.Status.Size())) - n11, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + n11, err11 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ValidDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ValidDuration):]) + if err11 != nil { + return 0, err11 } - i += n11 - return i, nil + i -= n11 + i = encodeVarintMixer(dAtA, i, uint64(n11)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *ReferencedAttributes) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1129,44 +1179,45 @@ func (m *ReferencedAttributes) Marshal() (dAtA []byte, err error) { } func (m *ReferencedAttributes) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReferencedAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Words) > 0 { - for _, s := range m.Words { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if len(m.AttributeMatches) > 0 { + for iNdEx := len(m.AttributeMatches) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AttributeMatches[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMixer(dAtA, i, uint64(size)) } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i-- + dAtA[i] = 0x12 } } - if len(m.AttributeMatches) > 0 { - for _, msg := range m.AttributeMatches { - dAtA[i] = 0x12 - i++ - i = encodeVarintMixer(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + if len(m.Words) > 0 { + for iNdEx := len(m.Words) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Words[iNdEx]) + copy(dAtA[i:], m.Words[iNdEx]) + i = encodeVarintMixer(dAtA, i, uint64(len(m.Words[iNdEx]))) + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *ReferencedAttributes_AttributeMatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1174,38 +1225,44 @@ func (m *ReferencedAttributes_AttributeMatch) Marshal() (dAtA []byte, err error) } func (m *ReferencedAttributes_AttributeMatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReferencedAttributes_AttributeMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Name != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintMixer(dAtA, i, uint64((uint32(m.Name)<<1)^uint32((m.Name>>31)))) - } - if m.Condition != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintMixer(dAtA, i, uint64(m.Condition)) + if m.MapKey != 0 { + i = encodeVarintMixer(dAtA, i, uint64((uint32(m.MapKey)<<1)^uint32((m.MapKey>>31)))) + i-- + dAtA[i] = 0x20 } if len(m.Regex) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.Regex) + copy(dAtA[i:], m.Regex) i = encodeVarintMixer(dAtA, i, uint64(len(m.Regex))) - i += copy(dAtA[i:], m.Regex) + i-- + dAtA[i] = 0x1a } - if m.MapKey != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintMixer(dAtA, i, uint64((uint32(m.MapKey)<<1)^uint32((m.MapKey>>31)))) + if m.Condition != 0 { + i = encodeVarintMixer(dAtA, i, uint64(m.Condition)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.Name != 0 { + i = encodeVarintMixer(dAtA, i, uint64((uint32(m.Name)<<1)^uint32((m.Name>>31)))) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *HeaderOperation) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1213,34 +1270,41 @@ func (m *HeaderOperation) Marshal() (dAtA []byte, err error) { } func (m *HeaderOperation) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HeaderOperation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintMixer(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.Operation != 0 { + i = encodeVarintMixer(dAtA, i, uint64(m.Operation)) + i-- + dAtA[i] = 0x18 } if len(m.Value) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Value) + copy(dAtA[i:], m.Value) i = encodeVarintMixer(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + i-- + dAtA[i] = 0x12 } - if m.Operation != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintMixer(dAtA, i, uint64(m.Operation)) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMixer(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RouteDirective) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1248,52 +1312,62 @@ func (m *RouteDirective) Marshal() (dAtA []byte, err error) { } func (m *RouteDirective) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RouteDirective) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.RequestHeaderOperations) > 0 { - for _, msg := range m.RequestHeaderOperations { - dAtA[i] = 0xa - i++ - i = encodeVarintMixer(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if len(m.DirectResponseBody) > 0 { + i -= len(m.DirectResponseBody) + copy(dAtA[i:], m.DirectResponseBody) + i = encodeVarintMixer(dAtA, i, uint64(len(m.DirectResponseBody))) + i-- + dAtA[i] = 0x22 + } + if m.DirectResponseCode != 0 { + i = encodeVarintMixer(dAtA, i, uint64(m.DirectResponseCode)) + i-- + dAtA[i] = 0x18 } if len(m.ResponseHeaderOperations) > 0 { - for _, msg := range m.ResponseHeaderOperations { - dAtA[i] = 0x12 - i++ - i = encodeVarintMixer(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.ResponseHeaderOperations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResponseHeaderOperations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMixer(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.DirectResponseCode != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintMixer(dAtA, i, uint64(m.DirectResponseCode)) - } - if len(m.DirectResponseBody) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintMixer(dAtA, i, uint64(len(m.DirectResponseBody))) - i += copy(dAtA[i:], m.DirectResponseBody) + if len(m.RequestHeaderOperations) > 0 { + for iNdEx := len(m.RequestHeaderOperations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RequestHeaderOperations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMixer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *ReportRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1301,54 +1375,55 @@ func (m *ReportRequest) Marshal() (dAtA []byte, err error) { } func (m *ReportRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReportRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Attributes) > 0 { - for _, msg := range m.Attributes { - dAtA[i] = 0xa - i++ - i = encodeVarintMixer(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.RepeatedAttributesSemantics != 0 { + i = encodeVarintMixer(dAtA, i, uint64(m.RepeatedAttributesSemantics)) + i-- + dAtA[i] = 0x20 + } + if m.GlobalWordCount != 0 { + i = encodeVarintMixer(dAtA, i, uint64(m.GlobalWordCount)) + i-- + dAtA[i] = 0x18 } if len(m.DefaultWords) > 0 { - for _, s := range m.DefaultWords { + for iNdEx := len(m.DefaultWords) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DefaultWords[iNdEx]) + copy(dAtA[i:], m.DefaultWords[iNdEx]) + i = encodeVarintMixer(dAtA, i, uint64(len(m.DefaultWords[iNdEx]))) + i-- dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if m.GlobalWordCount != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintMixer(dAtA, i, uint64(m.GlobalWordCount)) - } - if m.RepeatedAttributesSemantics != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintMixer(dAtA, i, uint64(m.RepeatedAttributesSemantics)) + if len(m.Attributes) > 0 { + for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Attributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMixer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *ReportResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1356,21 +1431,28 @@ func (m *ReportResponse) Marshal() (dAtA []byte, err error) { } func (m *ReportResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReportResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func encodeVarintMixer(dAtA []byte, offset int, v uint64) int { + offset -= sovMixer(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *CheckRequest) Size() (n int) { if m == nil { @@ -1604,14 +1686,7 @@ func (m *ReportResponse) Size() (n int) { } func sovMixer(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozMixer(x uint64) (n int) { return sovMixer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1631,7 +1706,7 @@ func (this *CheckRequest) String() string { } mapStringForQuotas += "}" s := strings.Join([]string{`&CheckRequest{`, - `Attributes:` + strings.Replace(strings.Replace(this.Attributes.String(), "CompressedAttributes", "CompressedAttributes", 1), `&`, ``, 1) + `,`, + `Attributes:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Attributes), "CompressedAttributes", "CompressedAttributes", 1), `&`, ``, 1) + `,`, `GlobalWordCount:` + fmt.Sprintf("%v", this.GlobalWordCount) + `,`, `DeduplicationId:` + fmt.Sprintf("%v", this.DeduplicationId) + `,`, `Quotas:` + mapStringForQuotas + `,`, @@ -1665,7 +1740,7 @@ func (this *CheckResponse) String() string { } mapStringForQuotas += "}" s := strings.Join([]string{`&CheckResponse{`, - `Precondition:` + strings.Replace(strings.Replace(this.Precondition.String(), "CheckResponse_PreconditionResult", "CheckResponse_PreconditionResult", 1), `&`, ``, 1) + `,`, + `Precondition:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Precondition), "CheckResponse_PreconditionResult", "CheckResponse_PreconditionResult", 1), `&`, ``, 1) + `,`, `Quotas:` + mapStringForQuotas + `,`, `}`, }, "") @@ -1676,11 +1751,11 @@ func (this *CheckResponse_PreconditionResult) String() string { return "nil" } s := strings.Join([]string{`&CheckResponse_PreconditionResult{`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "Status", "rpc.Status", 1), `&`, ``, 1) + `,`, - `ValidDuration:` + strings.Replace(strings.Replace(this.ValidDuration.String(), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "rpc.Status", 1), `&`, ``, 1) + `,`, + `ValidDuration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ValidDuration), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, `ValidUseCount:` + fmt.Sprintf("%v", this.ValidUseCount) + `,`, - `ReferencedAttributes:` + strings.Replace(fmt.Sprintf("%v", this.ReferencedAttributes), "ReferencedAttributes", "ReferencedAttributes", 1) + `,`, - `RouteDirective:` + strings.Replace(fmt.Sprintf("%v", this.RouteDirective), "RouteDirective", "RouteDirective", 1) + `,`, + `ReferencedAttributes:` + strings.Replace(this.ReferencedAttributes.String(), "ReferencedAttributes", "ReferencedAttributes", 1) + `,`, + `RouteDirective:` + strings.Replace(this.RouteDirective.String(), "RouteDirective", "RouteDirective", 1) + `,`, `}`, }, "") return s @@ -1690,10 +1765,10 @@ func (this *CheckResponse_QuotaResult) String() string { return "nil" } s := strings.Join([]string{`&CheckResponse_QuotaResult{`, - `ValidDuration:` + strings.Replace(strings.Replace(this.ValidDuration.String(), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, + `ValidDuration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ValidDuration), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, `GrantedAmount:` + fmt.Sprintf("%v", this.GrantedAmount) + `,`, `ReferencedAttributes:` + strings.Replace(strings.Replace(this.ReferencedAttributes.String(), "ReferencedAttributes", "ReferencedAttributes", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "Status", "rpc.Status", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "rpc.Status", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -1702,9 +1777,14 @@ func (this *ReferencedAttributes) String() string { if this == nil { return "nil" } + repeatedStringForAttributeMatches := "[]ReferencedAttributes_AttributeMatch{" + for _, f := range this.AttributeMatches { + repeatedStringForAttributeMatches += fmt.Sprintf("%v", f) + "," + } + repeatedStringForAttributeMatches += "}" s := strings.Join([]string{`&ReferencedAttributes{`, `Words:` + fmt.Sprintf("%v", this.Words) + `,`, - `AttributeMatches:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.AttributeMatches), "ReferencedAttributes_AttributeMatch", "ReferencedAttributes_AttributeMatch", 1), `&`, ``, 1) + `,`, + `AttributeMatches:` + repeatedStringForAttributeMatches + `,`, `}`, }, "") return s @@ -1738,9 +1818,19 @@ func (this *RouteDirective) String() string { if this == nil { return "nil" } + repeatedStringForRequestHeaderOperations := "[]HeaderOperation{" + for _, f := range this.RequestHeaderOperations { + repeatedStringForRequestHeaderOperations += strings.Replace(strings.Replace(f.String(), "HeaderOperation", "HeaderOperation", 1), `&`, ``, 1) + "," + } + repeatedStringForRequestHeaderOperations += "}" + repeatedStringForResponseHeaderOperations := "[]HeaderOperation{" + for _, f := range this.ResponseHeaderOperations { + repeatedStringForResponseHeaderOperations += strings.Replace(strings.Replace(f.String(), "HeaderOperation", "HeaderOperation", 1), `&`, ``, 1) + "," + } + repeatedStringForResponseHeaderOperations += "}" s := strings.Join([]string{`&RouteDirective{`, - `RequestHeaderOperations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.RequestHeaderOperations), "HeaderOperation", "HeaderOperation", 1), `&`, ``, 1) + `,`, - `ResponseHeaderOperations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ResponseHeaderOperations), "HeaderOperation", "HeaderOperation", 1), `&`, ``, 1) + `,`, + `RequestHeaderOperations:` + repeatedStringForRequestHeaderOperations + `,`, + `ResponseHeaderOperations:` + repeatedStringForResponseHeaderOperations + `,`, `DirectResponseCode:` + fmt.Sprintf("%v", this.DirectResponseCode) + `,`, `DirectResponseBody:` + fmt.Sprintf("%v", this.DirectResponseBody) + `,`, `}`, @@ -1751,8 +1841,13 @@ func (this *ReportRequest) String() string { if this == nil { return "nil" } + repeatedStringForAttributes := "[]CompressedAttributes{" + for _, f := range this.Attributes { + repeatedStringForAttributes += fmt.Sprintf("%v", f) + "," + } + repeatedStringForAttributes += "}" s := strings.Join([]string{`&ReportRequest{`, - `Attributes:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Attributes), "CompressedAttributes", "CompressedAttributes", 1), `&`, ``, 1) + `,`, + `Attributes:` + repeatedStringForAttributes + `,`, `DefaultWords:` + fmt.Sprintf("%v", this.DefaultWords) + `,`, `GlobalWordCount:` + fmt.Sprintf("%v", this.GlobalWordCount) + `,`, `RepeatedAttributesSemantics:` + fmt.Sprintf("%v", this.RepeatedAttributesSemantics) + `,`, diff --git a/networking/v1alpha3/destination_rule.pb.go b/networking/v1alpha3/destination_rule.pb.go index 0286bffdaf8..97ca1a67a01 100644 --- a/networking/v1alpha3/destination_rule.pb.go +++ b/networking/v1alpha3/destination_rule.pb.go @@ -82,6 +82,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" time "time" ) @@ -277,7 +278,7 @@ func (m *DestinationRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_DestinationRule.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -360,7 +361,7 @@ func (m *TrafficPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_TrafficPolicy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -447,7 +448,7 @@ func (m *TrafficPolicy_PortTrafficPolicy) XXX_Marshal(b []byte, deterministic bo return xxx_messageInfo_TrafficPolicy_PortTrafficPolicy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -568,7 +569,7 @@ func (m *Subset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Subset.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -673,7 +674,7 @@ func (m *LoadBalancerSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_LoadBalancerSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -837,7 +838,7 @@ func (m *LoadBalancerSettings_ConsistentHashLB) XXX_Marshal(b []byte, determinis return xxx_messageInfo_LoadBalancerSettings_ConsistentHashLB.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1035,7 +1036,7 @@ func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) XXX_Marshal(b []byte, return xxx_messageInfo_LoadBalancerSettings_ConsistentHashLB_HTTPCookie.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1124,7 +1125,7 @@ func (m *ConnectionPoolSettings) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_ConnectionPoolSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1184,7 +1185,7 @@ func (m *ConnectionPoolSettings_TCPSettings) XXX_Marshal(b []byte, deterministic return xxx_messageInfo_ConnectionPoolSettings_TCPSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1261,7 +1262,7 @@ func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) XXX_Marshal(b []byte, return xxx_messageInfo_ConnectionPoolSettings_TCPSettings_TcpKeepalive.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1339,7 +1340,7 @@ func (m *ConnectionPoolSettings_HTTPSettings) XXX_Marshal(b []byte, deterministi return xxx_messageInfo_ConnectionPoolSettings_HTTPSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1481,7 +1482,7 @@ func (m *OutlierDetection) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_OutlierDetection.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1630,7 +1631,7 @@ func (m *TLSSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_TLSSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1815,7 +1816,7 @@ var fileDescriptor_12899beb695152c8 = []byte{ func (m *DestinationRule) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1823,63 +1824,68 @@ func (m *DestinationRule) Marshal() (dAtA []byte, err error) { } func (m *DestinationRule) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DestinationRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Host) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.Host))) - i += copy(dAtA[i:], m.Host) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.TrafficPolicy != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.TrafficPolicy.Size())) - n1, err := m.TrafficPolicy.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.ExportTo) > 0 { + for iNdEx := len(m.ExportTo) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExportTo[iNdEx]) + copy(dAtA[i:], m.ExportTo[iNdEx]) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.ExportTo[iNdEx]))) + i-- + dAtA[i] = 0x22 } - i += n1 } if len(m.Subsets) > 0 { - for _, msg := range m.Subsets { + for iNdEx := len(m.Subsets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Subsets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.TrafficPolicy != nil { + { + size, err := m.TrafficPolicy.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n - } - } - if len(m.ExportTo) > 0 { - for _, s := range m.ExportTo { - dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Host) > 0 { + i -= len(m.Host) + copy(dAtA[i:], m.Host) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.Host))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *TrafficPolicy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1887,72 +1893,88 @@ func (m *TrafficPolicy) Marshal() (dAtA []byte, err error) { } func (m *TrafficPolicy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TrafficPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.LoadBalancer != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.LoadBalancer.Size())) - n2, err := m.LoadBalancer.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.PortLevelSettings) > 0 { + for iNdEx := len(m.PortLevelSettings) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PortLevelSettings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a } - i += n2 } - if m.ConnectionPool != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.ConnectionPool.Size())) - n3, err := m.ConnectionPool.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Tls != nil { + { + size, err := m.Tls.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x22 } if m.OutlierDetection != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.OutlierDetection.Size())) - n4, err := m.OutlierDetection.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.OutlierDetection.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x1a } - if m.Tls != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.Tls.Size())) - n5, err := m.Tls.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ConnectionPool != nil { + { + size, err := m.ConnectionPool.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0x12 } - if len(m.PortLevelSettings) > 0 { - for _, msg := range m.PortLevelSettings { - dAtA[i] = 0x2a - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.LoadBalancer != nil { + { + size, err := m.LoadBalancer.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *TrafficPolicy_PortTrafficPolicy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1960,70 +1982,86 @@ func (m *TrafficPolicy_PortTrafficPolicy) Marshal() (dAtA []byte, err error) { } func (m *TrafficPolicy_PortTrafficPolicy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TrafficPolicy_PortTrafficPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Port != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.Port.Size())) - n6, err := m.Port.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Tls != nil { + { + size, err := m.Tls.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x2a } - if m.LoadBalancer != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.LoadBalancer.Size())) - n7, err := m.LoadBalancer.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.OutlierDetection != nil { + { + size, err := m.OutlierDetection.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x22 } if m.ConnectionPool != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.ConnectionPool.Size())) - n8, err := m.ConnectionPool.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ConnectionPool.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x1a } - if m.OutlierDetection != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.OutlierDetection.Size())) - n9, err := m.OutlierDetection.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.LoadBalancer != nil { + { + size, err := m.LoadBalancer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x12 } - if m.Tls != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.Tls.Size())) - n10, err := m.Tls.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Port != nil { + { + size, err := m.Port.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) } - i += n10 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Subset) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2031,53 +2069,64 @@ func (m *Subset) Marshal() (dAtA []byte, err error) { } func (m *Subset) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Subset) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.TrafficPolicy != nil { + { + size, err := m.TrafficPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x12 - i++ + for k := range m.Labels { v := m.Labels[k] - mapSize := 1 + len(k) + sovDestinationRule(uint64(len(k))) + 1 + len(v) + sovDestinationRule(uint64(len(v))) - i = encodeVarintDestinationRule(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) i = encodeVarintDestinationRule(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + i-- + dAtA[i] = 0xa + i = encodeVarintDestinationRule(dAtA, i, uint64(baseI-i)) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) } } - if m.TrafficPolicy != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.TrafficPolicy.Size())) - n11, err := m.TrafficPolicy.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n11 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *LoadBalancerSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2085,48 +2134,66 @@ func (m *LoadBalancerSettings) Marshal() (dAtA []byte, err error) { } func (m *LoadBalancerSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LoadBalancerSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.LbPolicy != nil { - nn12, err := m.LbPolicy.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.LbPolicy.Size() + i -= size + if _, err := m.LbPolicy.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn12 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *LoadBalancerSettings_Simple) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x8 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *LoadBalancerSettings_Simple) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintDestinationRule(dAtA, i, uint64(m.Simple)) - return i, nil + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil } func (m *LoadBalancerSettings_ConsistentHash) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *LoadBalancerSettings_ConsistentHash) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.ConsistentHash != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.ConsistentHash.Size())) - n13, err := m.ConsistentHash.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ConsistentHash.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *LoadBalancerSettings_ConsistentHashLB) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2134,66 +2201,89 @@ func (m *LoadBalancerSettings_ConsistentHashLB) Marshal() (dAtA []byte, err erro } func (m *LoadBalancerSettings_ConsistentHashLB) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LoadBalancerSettings_ConsistentHashLB) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.HashKey != nil { - nn14, err := m.HashKey.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn14 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.MinimumRingSize != 0 { - dAtA[i] = 0x20 - i++ i = encodeVarintDestinationRule(dAtA, i, uint64(m.MinimumRingSize)) + i-- + dAtA[i] = 0x20 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.HashKey != nil { + { + size := m.HashKey.Size() + i -= size + if _, err := m.HashKey.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return i, nil + return len(dAtA) - i, nil } func (m *LoadBalancerSettings_ConsistentHashLB_HttpHeaderName) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0xa - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *LoadBalancerSettings_ConsistentHashLB_HttpHeaderName) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.HttpHeaderName) + copy(dAtA[i:], m.HttpHeaderName) i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.HttpHeaderName))) - i += copy(dAtA[i:], m.HttpHeaderName) - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *LoadBalancerSettings_ConsistentHashLB_HttpCookie) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *LoadBalancerSettings_ConsistentHashLB_HttpCookie) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.HttpCookie != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.HttpCookie.Size())) - n15, err := m.HttpCookie.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.HttpCookie.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) } - i += n15 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *LoadBalancerSettings_ConsistentHashLB_UseSourceIp) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x18 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *LoadBalancerSettings_ConsistentHashLB_UseSourceIp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i-- if m.UseSourceIp { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - return i, nil + i-- + dAtA[i] = 0x18 + return len(dAtA) - i, nil } func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2201,42 +2291,50 @@ func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) Marshal() (dAtA []byt } func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Path) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.Path))) - i += copy(dAtA[i:], m.Path) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Ttl != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Ttl))) - n16, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Ttl, dAtA[i:]) - if err != nil { - return 0, err + n14, err14 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Ttl, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Ttl):]) + if err14 != nil { + return 0, err14 } - i += n16 + i -= n14 + i = encodeVarintDestinationRule(dAtA, i, uint64(n14)) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ConnectionPoolSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2244,40 +2342,50 @@ func (m *ConnectionPoolSettings) Marshal() (dAtA []byte, err error) { } func (m *ConnectionPoolSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectionPoolSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Tcp != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.Tcp.Size())) - n17, err := m.Tcp.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n17 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Http != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.Http.Size())) - n18, err := m.Http.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Http.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) } - i += n18 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Tcp != nil { + { + size, err := m.Tcp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ConnectionPoolSettings_TCPSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2285,45 +2393,55 @@ func (m *ConnectionPoolSettings_TCPSettings) Marshal() (dAtA []byte, err error) } func (m *ConnectionPoolSettings_TCPSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectionPoolSettings_TCPSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.MaxConnections != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.MaxConnections)) - } - if m.ConnectTimeout != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.ConnectTimeout.Size())) - n19, err := m.ConnectTimeout.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n19 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.TcpKeepalive != nil { + { + size, err := m.TcpKeepalive.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.TcpKeepalive.Size())) - n20, err := m.TcpKeepalive.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + } + if m.ConnectTimeout != nil { + { + size, err := m.ConnectTimeout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) } - i += n20 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.MaxConnections != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.MaxConnections)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2331,45 +2449,55 @@ func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) Marshal() (dAtA []byte } func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Probes != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.Probes)) - } - if m.Time != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.Time.Size())) - n21, err := m.Time.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n21 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Interval != nil { + { + size, err := m.Interval.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.Interval.Size())) - n22, err := m.Interval.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + } + if m.Time != nil { + { + size, err := m.Time.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) } - i += n22 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Probes != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.Probes)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ConnectionPoolSettings_HTTPSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2377,55 +2505,63 @@ func (m *ConnectionPoolSettings_HTTPSettings) Marshal() (dAtA []byte, err error) } func (m *ConnectionPoolSettings_HTTPSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectionPoolSettings_HTTPSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Http1MaxPendingRequests != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.Http1MaxPendingRequests)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Http2MaxRequests != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.Http2MaxRequests)) + if m.H2UpgradePolicy != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.H2UpgradePolicy)) + i-- + dAtA[i] = 0x30 } - if m.MaxRequestsPerConnection != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.MaxRequestsPerConnection)) + if m.IdleTimeout != nil { + { + size, err := m.IdleTimeout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a } if m.MaxRetries != 0 { - dAtA[i] = 0x20 - i++ i = encodeVarintDestinationRule(dAtA, i, uint64(m.MaxRetries)) + i-- + dAtA[i] = 0x20 } - if m.IdleTimeout != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.IdleTimeout.Size())) - n23, err := m.IdleTimeout.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n23 + if m.MaxRequestsPerConnection != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.MaxRequestsPerConnection)) + i-- + dAtA[i] = 0x18 } - if m.H2UpgradePolicy != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.H2UpgradePolicy)) + if m.Http2MaxRequests != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.Http2MaxRequests)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Http1MaxPendingRequests != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.Http1MaxPendingRequests)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *OutlierDetection) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2433,55 +2569,65 @@ func (m *OutlierDetection) Marshal() (dAtA []byte, err error) { } func (m *OutlierDetection) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OutlierDetection) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ConsecutiveErrors != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.ConsecutiveErrors)) - } - if m.Interval != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.Interval.Size())) - n24, err := m.Interval.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n24 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.BaseEjectionTime != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.BaseEjectionTime.Size())) - n25, err := m.BaseEjectionTime.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n25 + if m.MinHealthPercent != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.MinHealthPercent)) + i-- + dAtA[i] = 0x28 } if m.MaxEjectionPercent != 0 { - dAtA[i] = 0x20 - i++ i = encodeVarintDestinationRule(dAtA, i, uint64(m.MaxEjectionPercent)) + i-- + dAtA[i] = 0x20 } - if m.MinHealthPercent != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.MinHealthPercent)) + if m.BaseEjectionTime != nil { + { + size, err := m.BaseEjectionTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Interval != nil { + { + size, err := m.Interval.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return i, nil + if m.ConsecutiveErrors != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.ConsecutiveErrors)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *TLSSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2489,68 +2635,74 @@ func (m *TLSSettings) Marshal() (dAtA []byte, err error) { } func (m *TLSSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TLSSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Mode != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(m.Mode)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.ClientCertificate) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.ClientCertificate))) - i += copy(dAtA[i:], m.ClientCertificate) + if len(m.Sni) > 0 { + i -= len(m.Sni) + copy(dAtA[i:], m.Sni) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.Sni))) + i-- + dAtA[i] = 0x32 } - if len(m.PrivateKey) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.PrivateKey))) - i += copy(dAtA[i:], m.PrivateKey) + if len(m.SubjectAltNames) > 0 { + for iNdEx := len(m.SubjectAltNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SubjectAltNames[iNdEx]) + copy(dAtA[i:], m.SubjectAltNames[iNdEx]) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.SubjectAltNames[iNdEx]))) + i-- + dAtA[i] = 0x2a + } } if len(m.CaCertificates) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.CaCertificates) + copy(dAtA[i:], m.CaCertificates) i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.CaCertificates))) - i += copy(dAtA[i:], m.CaCertificates) + i-- + dAtA[i] = 0x22 } - if len(m.SubjectAltNames) > 0 { - for _, s := range m.SubjectAltNames { - dAtA[i] = 0x2a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if len(m.PrivateKey) > 0 { + i -= len(m.PrivateKey) + copy(dAtA[i:], m.PrivateKey) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.PrivateKey))) + i-- + dAtA[i] = 0x1a } - if len(m.Sni) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.Sni))) - i += copy(dAtA[i:], m.Sni) + if len(m.ClientCertificate) > 0 { + i -= len(m.ClientCertificate) + copy(dAtA[i:], m.ClientCertificate) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.ClientCertificate))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Mode != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintDestinationRule(dAtA []byte, offset int, v uint64) int { + offset -= sovDestinationRule(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *DestinationRule) Size() (n int) { if m == nil { @@ -2951,14 +3103,7 @@ func (m *TLSSettings) Size() (n int) { } func sovDestinationRule(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozDestinationRule(x uint64) (n int) { return sovDestinationRule(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/networking/v1alpha3/envoy_filter.pb.go b/networking/v1alpha3/envoy_filter.pb.go index b98f274e942..4492ac8d6ab 100644 --- a/networking/v1alpha3/envoy_filter.pb.go +++ b/networking/v1alpha3/envoy_filter.pb.go @@ -184,6 +184,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -522,7 +523,7 @@ func (m *EnvoyFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_EnvoyFilter.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -618,7 +619,7 @@ func (m *EnvoyFilter_DeprecatedListenerMatch) XXX_Marshal(b []byte, deterministi return xxx_messageInfo_EnvoyFilter_DeprecatedListenerMatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -700,7 +701,7 @@ func (m *EnvoyFilter_InsertPosition) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_EnvoyFilter_InsertPosition.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -772,7 +773,7 @@ func (m *EnvoyFilter_Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_EnvoyFilter_Filter.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -858,7 +859,7 @@ func (m *EnvoyFilter_ProxyMatch) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_EnvoyFilter_ProxyMatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1025,7 +1026,7 @@ func (m *EnvoyFilter_ClusterMatch) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_EnvoyFilter_ClusterMatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1116,7 +1117,7 @@ func (m *EnvoyFilter_RouteConfigurationMatch) XXX_Marshal(b []byte, deterministi return xxx_messageInfo_EnvoyFilter_RouteConfigurationMatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1200,7 +1201,7 @@ func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) XXX_Marshal(b []b return xxx_messageInfo_EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1268,7 +1269,7 @@ func (m *EnvoyFilter_ListenerMatch) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_EnvoyFilter_ListenerMatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1362,7 +1363,7 @@ func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) XXX_Marshal(b []byte, deter return xxx_messageInfo_EnvoyFilter_ListenerMatch_FilterChainMatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1429,7 +1430,7 @@ func (m *EnvoyFilter_ListenerMatch_FilterMatch) XXX_Marshal(b []byte, determinis return xxx_messageInfo_EnvoyFilter_ListenerMatch_FilterMatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1490,7 +1491,7 @@ func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) XXX_Marshal(b []byte, determi return xxx_messageInfo_EnvoyFilter_ListenerMatch_SubFilterMatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1542,7 +1543,7 @@ func (m *EnvoyFilter_Patch) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_EnvoyFilter_Patch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1608,7 +1609,7 @@ func (m *EnvoyFilter_EnvoyConfigObjectMatch) XXX_Marshal(b []byte, deterministic return xxx_messageInfo_EnvoyFilter_EnvoyConfigObjectMatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1820,7 +1821,7 @@ func (m *EnvoyFilter_EnvoyConfigObjectPatch) XXX_Marshal(b []byte, deterministic return xxx_messageInfo_EnvoyFilter_EnvoyConfigObjectPatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1992,7 +1993,7 @@ var fileDescriptor_16d9b2922bd3e4a9 = []byte{ func (m *EnvoyFilter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2000,71 +2001,85 @@ func (m *EnvoyFilter) Marshal() (dAtA []byte, err error) { } func (m *EnvoyFilter) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.WorkloadLabels) > 0 { - for k, _ := range m.WorkloadLabels { - dAtA[i] = 0xa - i++ - v := m.WorkloadLabels[k] - mapSize := 1 + len(k) + sovEnvoyFilter(uint64(len(k))) + 1 + len(v) + sovEnvoyFilter(uint64(len(v))) - i = encodeVarintEnvoyFilter(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ConfigPatches) > 0 { + for iNdEx := len(m.ConfigPatches) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ConfigPatches[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } } - if len(m.Filters) > 0 { - for _, msg := range m.Filters { - dAtA[i] = 0x12 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.WorkloadSelector != nil { + { + size, err := m.WorkloadSelector.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) } - } - if m.WorkloadSelector != nil { + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.WorkloadSelector.Size())) - n1, err := m.WorkloadSelector.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 } - if len(m.ConfigPatches) > 0 { - for _, msg := range m.ConfigPatches { - dAtA[i] = 0x22 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Filters) > 0 { + for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Filters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.WorkloadLabels) > 0 { + for k := range m.WorkloadLabels { + v := m.WorkloadLabels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintEnvoyFilter(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *EnvoyFilter_DeprecatedListenerMatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2072,56 +2087,57 @@ func (m *EnvoyFilter_DeprecatedListenerMatch) Marshal() (dAtA []byte, err error) } func (m *EnvoyFilter_DeprecatedListenerMatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_DeprecatedListenerMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.PortNumber != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.PortNumber)) - } - if len(m.PortNamePrefix) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.PortNamePrefix))) - i += copy(dAtA[i:], m.PortNamePrefix) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.ListenerType != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.ListenerType)) + if len(m.Address) > 0 { + for iNdEx := len(m.Address) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Address[iNdEx]) + copy(dAtA[i:], m.Address[iNdEx]) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Address[iNdEx]))) + i-- + dAtA[i] = 0x2a + } } if m.ListenerProtocol != 0 { - dAtA[i] = 0x20 - i++ i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.ListenerProtocol)) + i-- + dAtA[i] = 0x20 } - if len(m.Address) > 0 { - for _, s := range m.Address { - dAtA[i] = 0x2a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.ListenerType != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.ListenerType)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.PortNamePrefix) > 0 { + i -= len(m.PortNamePrefix) + copy(dAtA[i:], m.PortNamePrefix) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.PortNamePrefix))) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.PortNumber != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.PortNumber)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *EnvoyFilter_InsertPosition) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2129,31 +2145,38 @@ func (m *EnvoyFilter_InsertPosition) Marshal() (dAtA []byte, err error) { } func (m *EnvoyFilter_InsertPosition) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_InsertPosition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Index != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Index)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.RelativeTo) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.RelativeTo) + copy(dAtA[i:], m.RelativeTo) i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.RelativeTo))) - i += copy(dAtA[i:], m.RelativeTo) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Index != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *EnvoyFilter_Filter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2161,61 +2184,74 @@ func (m *EnvoyFilter_Filter) Marshal() (dAtA []byte, err error) { } func (m *EnvoyFilter_Filter) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_Filter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ListenerMatch != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.ListenerMatch.Size())) - n2, err := m.ListenerMatch.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.InsertPosition != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.InsertPosition.Size())) - n3, err := m.InsertPosition.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.FilterConfig != nil { + { + size, err := m.FilterConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) } - i += n3 - } - if m.FilterType != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.FilterType)) + i-- + dAtA[i] = 0x2a } if len(m.FilterName) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.FilterName) + copy(dAtA[i:], m.FilterName) i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.FilterName))) - i += copy(dAtA[i:], m.FilterName) + i-- + dAtA[i] = 0x22 } - if m.FilterConfig != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.FilterConfig.Size())) - n4, err := m.FilterConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.FilterType != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.FilterType)) + i-- + dAtA[i] = 0x18 + } + if m.InsertPosition != nil { + { + size, err := m.InsertPosition.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.ListenerMatch != nil { + { + size, err := m.ListenerMatch.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *EnvoyFilter_ProxyMatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2223,60 +2259,80 @@ func (m *EnvoyFilter_ProxyMatch) Marshal() (dAtA []byte, err error) { } func (m *EnvoyFilter_ProxyMatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_ProxyMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.VersionMatch != nil { - nn5, err := m.VersionMatch.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn5 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Metadata) > 0 { - for k, _ := range m.Metadata { - dAtA[i] = 0x1a - i++ + for k := range m.Metadata { v := m.Metadata[k] - mapSize := 1 + len(k) + sovEnvoyFilter(uint64(len(k))) + 1 + len(v) + sovEnvoyFilter(uint64(len(v))) - i = encodeVarintEnvoyFilter(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintEnvoyFilter(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.VersionMatch != nil { + { + size := m.VersionMatch.Size() + i -= size + if _, err := m.VersionMatch.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return i, nil + return len(dAtA) - i, nil } func (m *EnvoyFilter_ProxyMatch_VersionGe) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0xa - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *EnvoyFilter_ProxyMatch_VersionGe) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.VersionGe) + copy(dAtA[i:], m.VersionGe) i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.VersionGe))) - i += copy(dAtA[i:], m.VersionGe) - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *EnvoyFilter_ProxyMatch_VersionEq) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *EnvoyFilter_ProxyMatch_VersionEq) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.VersionEq) + copy(dAtA[i:], m.VersionEq) i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.VersionEq))) - i += copy(dAtA[i:], m.VersionEq) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *EnvoyFilter_ClusterMatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2284,43 +2340,52 @@ func (m *EnvoyFilter_ClusterMatch) Marshal() (dAtA []byte, err error) { } func (m *EnvoyFilter_ClusterMatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_ClusterMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.PortNumber != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.PortNumber)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Service) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Service))) - i += copy(dAtA[i:], m.Service) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x22 } if len(m.Subset) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.Subset) + copy(dAtA[i:], m.Subset) i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Subset))) - i += copy(dAtA[i:], m.Subset) + i-- + dAtA[i] = 0x1a } - if len(m.Name) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if len(m.Service) > 0 { + i -= len(m.Service) + copy(dAtA[i:], m.Service) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Service))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.PortNumber != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.PortNumber)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *EnvoyFilter_RouteConfigurationMatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2328,53 +2393,64 @@ func (m *EnvoyFilter_RouteConfigurationMatch) Marshal() (dAtA []byte, err error) } func (m *EnvoyFilter_RouteConfigurationMatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_RouteConfigurationMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.PortNumber != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.PortNumber)) - } - if len(m.PortName) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.PortName))) - i += copy(dAtA[i:], m.PortName) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Gateway) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Gateway))) - i += copy(dAtA[i:], m.Gateway) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x2a } if m.Vhost != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Vhost.Size())) - n6, err := m.Vhost.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Vhost.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x22 } - if len(m.Name) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if len(m.Gateway) > 0 { + i -= len(m.Gateway) + copy(dAtA[i:], m.Gateway) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Gateway))) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.PortName) > 0 { + i -= len(m.PortName) + copy(dAtA[i:], m.PortName) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.PortName))) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.PortNumber != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.PortNumber)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2382,26 +2458,33 @@ func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) Marshal() (dAtA [ } func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *EnvoyFilter_ListenerMatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2409,47 +2492,57 @@ func (m *EnvoyFilter_ListenerMatch) Marshal() (dAtA []byte, err error) { } func (m *EnvoyFilter_ListenerMatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_ListenerMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.PortNumber != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.PortNumber)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.PortName) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.PortName))) - i += copy(dAtA[i:], m.PortName) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x22 } if m.FilterChain != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.FilterChain.Size())) - n7, err := m.FilterChain.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.FilterChain.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x1a } - if len(m.Name) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if len(m.PortName) > 0 { + i -= len(m.PortName) + copy(dAtA[i:], m.PortName) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.PortName))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.PortNumber != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.PortNumber)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2457,42 +2550,52 @@ func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) Marshal() (dAtA []byte, err } func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Sni) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Sni))) - i += copy(dAtA[i:], m.Sni) - } - if len(m.TransportProtocol) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.TransportProtocol))) - i += copy(dAtA[i:], m.TransportProtocol) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Filter != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Filter.Size())) - n8, err := m.Filter.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.TransportProtocol) > 0 { + i -= len(m.TransportProtocol) + copy(dAtA[i:], m.TransportProtocol) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.TransportProtocol))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Sni) > 0 { + i -= len(m.Sni) + copy(dAtA[i:], m.Sni) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Sni))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *EnvoyFilter_ListenerMatch_FilterMatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2500,36 +2603,45 @@ func (m *EnvoyFilter_ListenerMatch_FilterMatch) Marshal() (dAtA []byte, err erro } func (m *EnvoyFilter_ListenerMatch_FilterMatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_ListenerMatch_FilterMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.SubFilter != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.SubFilter.Size())) - n9, err := m.SubFilter.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.SubFilter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2537,26 +2649,33 @@ func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) Marshal() (dAtA []byte, err e } func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *EnvoyFilter_Patch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2564,35 +2683,43 @@ func (m *EnvoyFilter_Patch) Marshal() (dAtA []byte, err error) { } func (m *EnvoyFilter_Patch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_Patch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Operation != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Operation)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Value != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Value.Size())) - n10, err := m.Value.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Operation != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Operation)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *EnvoyFilter_EnvoyConfigObjectMatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2600,84 +2727,112 @@ func (m *EnvoyFilter_EnvoyConfigObjectMatch) Marshal() (dAtA []byte, err error) } func (m *EnvoyFilter_EnvoyConfigObjectMatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Context != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Context)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Proxy != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Proxy.Size())) - n11, err := m.Proxy.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ObjectTypes != nil { + { + size := m.ObjectTypes.Size() + i -= size + if _, err := m.ObjectTypes.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += n11 } - if m.ObjectTypes != nil { - nn12, err := m.ObjectTypes.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Proxy != nil { + { + size, err := m.Proxy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) } - i += nn12 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Context != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Context)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *EnvoyFilter_EnvoyConfigObjectMatch_Listener) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch_Listener) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Listener != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Listener.Size())) - n13, err := m.Listener.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Listener.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *EnvoyFilter_EnvoyConfigObjectMatch_RouteConfiguration) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch_RouteConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.RouteConfiguration != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.RouteConfiguration.Size())) - n14, err := m.RouteConfiguration.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.RouteConfiguration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *EnvoyFilter_EnvoyConfigObjectMatch_Cluster) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch_Cluster) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Cluster != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Cluster.Size())) - n15, err := m.Cluster.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Cluster.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) } - i += n15 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *EnvoyFilter_EnvoyConfigObjectPatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2685,49 +2840,61 @@ func (m *EnvoyFilter_EnvoyConfigObjectPatch) Marshal() (dAtA []byte, err error) } func (m *EnvoyFilter_EnvoyConfigObjectPatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_EnvoyConfigObjectPatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ApplyTo != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.ApplyTo)) - } - if m.Match != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Match.Size())) - n16, err := m.Match.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n16 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Patch != nil { + { + size, err := m.Patch.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Patch.Size())) - n17, err := m.Patch.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + } + if m.Match != nil { + { + size, err := m.Match.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) } - i += n17 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.ApplyTo != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.ApplyTo)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintEnvoyFilter(dAtA []byte, offset int, v uint64) int { + offset -= sovEnvoyFilter(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *EnvoyFilter) Size() (n int) { if m == nil { @@ -3151,14 +3318,7 @@ func (m *EnvoyFilter_EnvoyConfigObjectPatch) Size() (n int) { } func sovEnvoyFilter(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozEnvoyFilter(x uint64) (n int) { return sovEnvoyFilter(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/networking/v1alpha3/gateway.pb.go b/networking/v1alpha3/gateway.pb.go index 796053a1682..7ed9f985236 100644 --- a/networking/v1alpha3/gateway.pb.go +++ b/networking/v1alpha3/gateway.pb.go @@ -180,6 +180,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -318,7 +319,7 @@ func (m *Gateway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Gateway.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -474,7 +475,7 @@ func (m *Server) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Server.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -605,7 +606,7 @@ func (m *Server_TLSOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_Server_TLSOptions.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -738,7 +739,7 @@ func (m *Port) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Port.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -843,7 +844,7 @@ var fileDescriptor_067d98d02f84cc0b = []byte{ func (m *Gateway) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -851,49 +852,59 @@ func (m *Gateway) Marshal() (dAtA []byte, err error) { } func (m *Gateway) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Gateway) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Servers) > 0 { - for _, msg := range m.Servers { - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Selector) > 0 { - for k, _ := range m.Selector { - dAtA[i] = 0x12 - i++ + for k := range m.Selector { v := m.Selector[k] - mapSize := 1 + len(k) + sovGateway(uint64(len(k))) + 1 + len(v) + sovGateway(uint64(len(v))) - i = encodeVarintGateway(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGateway(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) i = encodeVarintGateway(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + i-- + dAtA[i] = 0xa + i = encodeVarintGateway(dAtA, i, uint64(baseI-i)) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Servers) > 0 { + for iNdEx := len(m.Servers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Servers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *Server) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -901,67 +912,73 @@ func (m *Server) Marshal() (dAtA []byte, err error) { } func (m *Server) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Server) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Port != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(m.Port.Size())) - n1, err := m.Port.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.DefaultEndpoint) > 0 { + i -= len(m.DefaultEndpoint) + copy(dAtA[i:], m.DefaultEndpoint) + i = encodeVarintGateway(dAtA, i, uint64(len(m.DefaultEndpoint))) + i-- + dAtA[i] = 0x2a + } + if len(m.Bind) > 0 { + i -= len(m.Bind) + copy(dAtA[i:], m.Bind) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Bind))) + i-- + dAtA[i] = 0x22 + } + if m.Tls != nil { + { + size, err := m.Tls.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) } - i += n1 + i-- + dAtA[i] = 0x1a } if len(m.Hosts) > 0 { - for _, s := range m.Hosts { + for iNdEx := len(m.Hosts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Hosts[iNdEx]) + copy(dAtA[i:], m.Hosts[iNdEx]) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Hosts[iNdEx]))) + i-- dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if m.Tls != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintGateway(dAtA, i, uint64(m.Tls.Size())) - n2, err := m.Tls.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Port != nil { + { + size, err := m.Port.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) } - i += n2 - } - if len(m.Bind) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.Bind))) - i += copy(dAtA[i:], m.Bind) - } - if len(m.DefaultEndpoint) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.DefaultEndpoint))) - i += copy(dAtA[i:], m.DefaultEndpoint) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Server_TLSOptions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -969,129 +986,115 @@ func (m *Server_TLSOptions) Marshal() (dAtA []byte, err error) { } func (m *Server_TLSOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Server_TLSOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.HttpsRedirect { - dAtA[i] = 0x8 - i++ - if m.HttpsRedirect { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.VerifyCertificateHash) > 0 { + for iNdEx := len(m.VerifyCertificateHash) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.VerifyCertificateHash[iNdEx]) + copy(dAtA[i:], m.VerifyCertificateHash[iNdEx]) + i = encodeVarintGateway(dAtA, i, uint64(len(m.VerifyCertificateHash[iNdEx]))) + i-- + dAtA[i] = 0x62 } - i++ } - if m.Mode != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintGateway(dAtA, i, uint64(m.Mode)) + if len(m.VerifyCertificateSpki) > 0 { + for iNdEx := len(m.VerifyCertificateSpki) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.VerifyCertificateSpki[iNdEx]) + copy(dAtA[i:], m.VerifyCertificateSpki[iNdEx]) + i = encodeVarintGateway(dAtA, i, uint64(len(m.VerifyCertificateSpki[iNdEx]))) + i-- + dAtA[i] = 0x5a + } } - if len(m.ServerCertificate) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.ServerCertificate))) - i += copy(dAtA[i:], m.ServerCertificate) + if len(m.CredentialName) > 0 { + i -= len(m.CredentialName) + copy(dAtA[i:], m.CredentialName) + i = encodeVarintGateway(dAtA, i, uint64(len(m.CredentialName))) + i-- + dAtA[i] = 0x52 } - if len(m.PrivateKey) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.PrivateKey))) - i += copy(dAtA[i:], m.PrivateKey) + if len(m.CipherSuites) > 0 { + for iNdEx := len(m.CipherSuites) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CipherSuites[iNdEx]) + copy(dAtA[i:], m.CipherSuites[iNdEx]) + i = encodeVarintGateway(dAtA, i, uint64(len(m.CipherSuites[iNdEx]))) + i-- + dAtA[i] = 0x4a + } } - if len(m.CaCertificates) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.CaCertificates))) - i += copy(dAtA[i:], m.CaCertificates) + if m.MaxProtocolVersion != 0 { + i = encodeVarintGateway(dAtA, i, uint64(m.MaxProtocolVersion)) + i-- + dAtA[i] = 0x40 + } + if m.MinProtocolVersion != 0 { + i = encodeVarintGateway(dAtA, i, uint64(m.MinProtocolVersion)) + i-- + dAtA[i] = 0x38 } if len(m.SubjectAltNames) > 0 { - for _, s := range m.SubjectAltNames { + for iNdEx := len(m.SubjectAltNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SubjectAltNames[iNdEx]) + copy(dAtA[i:], m.SubjectAltNames[iNdEx]) + i = encodeVarintGateway(dAtA, i, uint64(len(m.SubjectAltNames[iNdEx]))) + i-- dAtA[i] = 0x32 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if m.MinProtocolVersion != 0 { - dAtA[i] = 0x38 - i++ - i = encodeVarintGateway(dAtA, i, uint64(m.MinProtocolVersion)) - } - if m.MaxProtocolVersion != 0 { - dAtA[i] = 0x40 - i++ - i = encodeVarintGateway(dAtA, i, uint64(m.MaxProtocolVersion)) + if len(m.CaCertificates) > 0 { + i -= len(m.CaCertificates) + copy(dAtA[i:], m.CaCertificates) + i = encodeVarintGateway(dAtA, i, uint64(len(m.CaCertificates))) + i-- + dAtA[i] = 0x2a } - if len(m.CipherSuites) > 0 { - for _, s := range m.CipherSuites { - dAtA[i] = 0x4a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if len(m.PrivateKey) > 0 { + i -= len(m.PrivateKey) + copy(dAtA[i:], m.PrivateKey) + i = encodeVarintGateway(dAtA, i, uint64(len(m.PrivateKey))) + i-- + dAtA[i] = 0x22 } - if len(m.CredentialName) > 0 { - dAtA[i] = 0x52 - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.CredentialName))) - i += copy(dAtA[i:], m.CredentialName) + if len(m.ServerCertificate) > 0 { + i -= len(m.ServerCertificate) + copy(dAtA[i:], m.ServerCertificate) + i = encodeVarintGateway(dAtA, i, uint64(len(m.ServerCertificate))) + i-- + dAtA[i] = 0x1a } - if len(m.VerifyCertificateSpki) > 0 { - for _, s := range m.VerifyCertificateSpki { - dAtA[i] = 0x5a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.Mode != 0 { + i = encodeVarintGateway(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x10 } - if len(m.VerifyCertificateHash) > 0 { - for _, s := range m.VerifyCertificateHash { - dAtA[i] = 0x62 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if m.HttpsRedirect { + i-- + if m.HttpsRedirect { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *Port) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1099,41 +1102,51 @@ func (m *Port) Marshal() (dAtA []byte, err error) { } func (m *Port) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Port) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Number != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintGateway(dAtA, i, uint64(m.Number)) - } - if len(m.Protocol) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.Protocol))) - i += copy(dAtA[i:], m.Protocol) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Name) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintGateway(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Protocol) > 0 { + i -= len(m.Protocol) + copy(dAtA[i:], m.Protocol) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Protocol))) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Number != 0 { + i = encodeVarintGateway(dAtA, i, uint64(m.Number)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func encodeVarintGateway(dAtA []byte, offset int, v uint64) int { + offset -= sovGateway(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Gateway) Size() (n int) { if m == nil { @@ -1283,14 +1296,7 @@ func (m *Port) Size() (n int) { } func sovGateway(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozGateway(x uint64) (n int) { return sovGateway(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/networking/v1alpha3/service_entry.pb.go b/networking/v1alpha3/service_entry.pb.go index a20a88837bd..3e1b5750060 100644 --- a/networking/v1alpha3/service_entry.pb.go +++ b/networking/v1alpha3/service_entry.pb.go @@ -321,6 +321,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -510,7 +511,7 @@ func (m *ServiceEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_ServiceEntry.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -648,7 +649,7 @@ func (m *ServiceEntry_Endpoint) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_ServiceEntry_Endpoint.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -762,7 +763,7 @@ var fileDescriptor_9220e0fa673c4bf8 = []byte{ func (m *ServiceEntry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -770,114 +771,100 @@ func (m *ServiceEntry) Marshal() (dAtA []byte, err error) { } func (m *ServiceEntry) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Hosts) > 0 { - for _, s := range m.Hosts { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.SubjectAltNames) > 0 { + for iNdEx := len(m.SubjectAltNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SubjectAltNames[iNdEx]) + copy(dAtA[i:], m.SubjectAltNames[iNdEx]) + i = encodeVarintServiceEntry(dAtA, i, uint64(len(m.SubjectAltNames[iNdEx]))) + i-- + dAtA[i] = 0x42 } } - if len(m.Addresses) > 0 { - for _, s := range m.Addresses { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.ExportTo) > 0 { + for iNdEx := len(m.ExportTo) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExportTo[iNdEx]) + copy(dAtA[i:], m.ExportTo[iNdEx]) + i = encodeVarintServiceEntry(dAtA, i, uint64(len(m.ExportTo[iNdEx]))) + i-- + dAtA[i] = 0x3a } } - if len(m.Ports) > 0 { - for _, msg := range m.Ports { - dAtA[i] = 0x1a - i++ - i = encodeVarintServiceEntry(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Endpoints) > 0 { + for iNdEx := len(m.Endpoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Endpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintServiceEntry(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x32 } } - if m.Location != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintServiceEntry(dAtA, i, uint64(m.Location)) - } if m.Resolution != 0 { - dAtA[i] = 0x28 - i++ i = encodeVarintServiceEntry(dAtA, i, uint64(m.Resolution)) + i-- + dAtA[i] = 0x28 } - if len(m.Endpoints) > 0 { - for _, msg := range m.Endpoints { - dAtA[i] = 0x32 - i++ - i = encodeVarintServiceEntry(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Location != 0 { + i = encodeVarintServiceEntry(dAtA, i, uint64(m.Location)) + i-- + dAtA[i] = 0x20 + } + if len(m.Ports) > 0 { + for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintServiceEntry(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - if len(m.ExportTo) > 0 { - for _, s := range m.ExportTo { - dAtA[i] = 0x3a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.Addresses) > 0 { + for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Addresses[iNdEx]) + copy(dAtA[i:], m.Addresses[iNdEx]) + i = encodeVarintServiceEntry(dAtA, i, uint64(len(m.Addresses[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - if len(m.SubjectAltNames) > 0 { - for _, s := range m.SubjectAltNames { - dAtA[i] = 0x42 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.Hosts) > 0 { + for iNdEx := len(m.Hosts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Hosts[iNdEx]) + copy(dAtA[i:], m.Hosts[iNdEx]) + i = encodeVarintServiceEntry(dAtA, i, uint64(len(m.Hosts[iNdEx]))) + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *ServiceEntry_Endpoint) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -885,80 +872,94 @@ func (m *ServiceEntry_Endpoint) Marshal() (dAtA []byte, err error) { } func (m *ServiceEntry_Endpoint) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceEntry_Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Address) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintServiceEntry(dAtA, i, uint64(len(m.Address))) - i += copy(dAtA[i:], m.Address) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Ports) > 0 { - for k, _ := range m.Ports { - dAtA[i] = 0x12 - i++ - v := m.Ports[k] - mapSize := 1 + len(k) + sovServiceEntry(uint64(len(k))) + 1 + sovServiceEntry(uint64(v)) - i = encodeVarintServiceEntry(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintServiceEntry(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x10 - i++ - i = encodeVarintServiceEntry(dAtA, i, uint64(v)) - } + if m.Weight != 0 { + i = encodeVarintServiceEntry(dAtA, i, uint64(m.Weight)) + i-- + dAtA[i] = 0x30 + } + if len(m.Locality) > 0 { + i -= len(m.Locality) + copy(dAtA[i:], m.Locality) + i = encodeVarintServiceEntry(dAtA, i, uint64(len(m.Locality))) + i-- + dAtA[i] = 0x2a + } + if len(m.Network) > 0 { + i -= len(m.Network) + copy(dAtA[i:], m.Network) + i = encodeVarintServiceEntry(dAtA, i, uint64(len(m.Network))) + i-- + dAtA[i] = 0x22 } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ + for k := range m.Labels { v := m.Labels[k] - mapSize := 1 + len(k) + sovServiceEntry(uint64(len(k))) + 1 + len(v) + sovServiceEntry(uint64(len(v))) - i = encodeVarintServiceEntry(dAtA, i, uint64(mapSize)) + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintServiceEntry(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintServiceEntry(dAtA, i, uint64(len(k))) + i-- dAtA[i] = 0xa - i++ + i = encodeVarintServiceEntry(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Ports) > 0 { + for k := range m.Ports { + v := m.Ports[k] + baseI := i + i = encodeVarintServiceEntry(dAtA, i, uint64(v)) + i-- + dAtA[i] = 0x10 + i -= len(k) + copy(dAtA[i:], k) i = encodeVarintServiceEntry(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + i-- + dAtA[i] = 0xa + i = encodeVarintServiceEntry(dAtA, i, uint64(baseI-i)) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintServiceEntry(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) } } - if len(m.Network) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintServiceEntry(dAtA, i, uint64(len(m.Network))) - i += copy(dAtA[i:], m.Network) - } - if len(m.Locality) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintServiceEntry(dAtA, i, uint64(len(m.Locality))) - i += copy(dAtA[i:], m.Locality) - } - if m.Weight != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintServiceEntry(dAtA, i, uint64(m.Weight)) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintServiceEntry(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintServiceEntry(dAtA []byte, offset int, v uint64) int { + offset -= sovServiceEntry(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *ServiceEntry) Size() (n int) { if m == nil { @@ -1058,14 +1059,7 @@ func (m *ServiceEntry_Endpoint) Size() (n int) { } func sovServiceEntry(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozServiceEntry(x uint64) (n int) { return sovServiceEntry(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/networking/v1alpha3/sidecar.pb.go b/networking/v1alpha3/sidecar.pb.go index 5a43c4f8157..b59e858cebe 100644 --- a/networking/v1alpha3/sidecar.pb.go +++ b/networking/v1alpha3/sidecar.pb.go @@ -211,6 +211,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -331,7 +332,7 @@ func (m *Sidecar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Sidecar.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -420,7 +421,7 @@ func (m *IstioIngressListener) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_IstioIngressListener.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -542,7 +543,7 @@ func (m *IstioEgressListener) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_IstioEgressListener.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -621,7 +622,7 @@ func (m *WorkloadSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_WorkloadSelector.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -677,7 +678,7 @@ func (m *OutboundTrafficPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_OutboundTrafficPolicy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -759,7 +760,7 @@ var fileDescriptor_b5c11342f04ad3d1 = []byte{ func (m *Sidecar) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -767,64 +768,78 @@ func (m *Sidecar) Marshal() (dAtA []byte, err error) { } func (m *Sidecar) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Sidecar) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.WorkloadSelector != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintSidecar(dAtA, i, uint64(m.WorkloadSelector.Size())) - n1, err := m.WorkloadSelector.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Ingress) > 0 { - for _, msg := range m.Ingress { - dAtA[i] = 0x12 - i++ - i = encodeVarintSidecar(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.OutboundTrafficPolicy != nil { + { + size, err := m.OutboundTrafficPolicy.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x22 } if len(m.Egress) > 0 { - for _, msg := range m.Egress { - dAtA[i] = 0x1a - i++ - i = encodeVarintSidecar(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Egress) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Egress[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - if m.OutboundTrafficPolicy != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintSidecar(dAtA, i, uint64(m.OutboundTrafficPolicy.Size())) - n2, err := m.OutboundTrafficPolicy.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Ingress) > 0 { + for iNdEx := len(m.Ingress) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ingress[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - i += n2 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.WorkloadSelector != nil { + { + size, err := m.WorkloadSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *IstioIngressListener) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -832,47 +847,57 @@ func (m *IstioIngressListener) Marshal() (dAtA []byte, err error) { } func (m *IstioIngressListener) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IstioIngressListener) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Port != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintSidecar(dAtA, i, uint64(m.Port.Size())) - n3, err := m.Port.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Bind) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintSidecar(dAtA, i, uint64(len(m.Bind))) - i += copy(dAtA[i:], m.Bind) + if len(m.DefaultEndpoint) > 0 { + i -= len(m.DefaultEndpoint) + copy(dAtA[i:], m.DefaultEndpoint) + i = encodeVarintSidecar(dAtA, i, uint64(len(m.DefaultEndpoint))) + i-- + dAtA[i] = 0x22 } if m.CaptureMode != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintSidecar(dAtA, i, uint64(m.CaptureMode)) + i-- + dAtA[i] = 0x18 } - if len(m.DefaultEndpoint) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintSidecar(dAtA, i, uint64(len(m.DefaultEndpoint))) - i += copy(dAtA[i:], m.DefaultEndpoint) + if len(m.Bind) > 0 { + i -= len(m.Bind) + copy(dAtA[i:], m.Bind) + i = encodeVarintSidecar(dAtA, i, uint64(len(m.Bind))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Port != nil { + { + size, err := m.Port.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *IstioEgressListener) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -880,56 +905,59 @@ func (m *IstioEgressListener) Marshal() (dAtA []byte, err error) { } func (m *IstioEgressListener) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IstioEgressListener) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Port != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintSidecar(dAtA, i, uint64(m.Port.Size())) - n4, err := m.Port.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Bind) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintSidecar(dAtA, i, uint64(len(m.Bind))) - i += copy(dAtA[i:], m.Bind) + if len(m.Hosts) > 0 { + for iNdEx := len(m.Hosts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Hosts[iNdEx]) + copy(dAtA[i:], m.Hosts[iNdEx]) + i = encodeVarintSidecar(dAtA, i, uint64(len(m.Hosts[iNdEx]))) + i-- + dAtA[i] = 0x22 + } } if m.CaptureMode != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintSidecar(dAtA, i, uint64(m.CaptureMode)) + i-- + dAtA[i] = 0x18 } - if len(m.Hosts) > 0 { - for _, s := range m.Hosts { - dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if len(m.Bind) > 0 { + i -= len(m.Bind) + copy(dAtA[i:], m.Bind) + i = encodeVarintSidecar(dAtA, i, uint64(len(m.Bind))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Port != nil { + { + size, err := m.Port.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *WorkloadSelector) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -937,37 +965,45 @@ func (m *WorkloadSelector) Marshal() (dAtA []byte, err error) { } func (m *WorkloadSelector) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0xa - i++ + for k := range m.Labels { v := m.Labels[k] - mapSize := 1 + len(k) + sovSidecar(uint64(len(k))) + 1 + len(v) + sovSidecar(uint64(len(v))) - i = encodeVarintSidecar(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintSidecar(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintSidecar(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintSidecar(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintSidecar(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *OutboundTrafficPolicy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -975,29 +1011,37 @@ func (m *OutboundTrafficPolicy) Marshal() (dAtA []byte, err error) { } func (m *OutboundTrafficPolicy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OutboundTrafficPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Mode != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintSidecar(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintSidecar(dAtA []byte, offset int, v uint64) int { + offset -= sovSidecar(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Sidecar) Size() (n int) { if m == nil { @@ -1123,14 +1167,7 @@ func (m *OutboundTrafficPolicy) Size() (n int) { } func sovSidecar(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozSidecar(x uint64) (n int) { return sovSidecar(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/networking/v1alpha3/virtual_service.pb.go b/networking/v1alpha3/virtual_service.pb.go index 94c562048ea..1e581069743 100644 --- a/networking/v1alpha3/virtual_service.pb.go +++ b/networking/v1alpha3/virtual_service.pb.go @@ -100,6 +100,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -208,7 +209,7 @@ func (m *VirtualService) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_VirtualService.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -439,7 +440,7 @@ func (m *Destination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_Destination.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -558,7 +559,7 @@ func (m *HTTPRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_HTTPRoute.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -755,7 +756,7 @@ func (m *Headers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Headers.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -816,7 +817,7 @@ func (m *Headers_HeaderOperations) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_Headers_HeaderOperations.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -914,7 +915,7 @@ func (m *TLSRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_TLSRoute.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -995,7 +996,7 @@ func (m *TCPRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_TCPRoute.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1162,7 +1163,7 @@ func (m *HTTPMatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_HTTPMatchRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1359,7 +1360,7 @@ func (m *HTTPRouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_HTTPRouteDestination.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1459,7 +1460,7 @@ func (m *RouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_RouteDestination.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1534,7 +1535,7 @@ func (m *L4MatchAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_L4MatchAttributes.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1635,7 +1636,7 @@ func (m *TLSMatchAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_TLSMatchAttributes.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1749,7 +1750,7 @@ func (m *HTTPRedirect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_HTTPRedirect.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1841,7 +1842,7 @@ func (m *HTTPRewrite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_HTTPRewrite.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1901,7 +1902,7 @@ func (m *StringMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_StringMatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2103,7 +2104,7 @@ func (m *HTTPRetry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_HTTPRetry.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2216,7 +2217,7 @@ func (m *CorsPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_CorsPolicy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2311,7 +2312,7 @@ func (m *HTTPFaultInjection) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_HTTPFaultInjection.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2405,7 +2406,7 @@ func (m *HTTPFaultInjection_Delay) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_HTTPFaultInjection_Delay.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2609,7 +2610,7 @@ func (m *HTTPFaultInjection_Abort) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_HTTPFaultInjection_Abort.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2797,7 +2798,7 @@ func (m *PortSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_PortSelector.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2940,7 +2941,7 @@ func (m *Percent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Percent.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3131,7 +3132,7 @@ var fileDescriptor_e85a9a4fa9c17a22 = []byte{ func (m *VirtualService) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3139,101 +3140,95 @@ func (m *VirtualService) Marshal() (dAtA []byte, err error) { } func (m *VirtualService) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VirtualService) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Hosts) > 0 { - for _, s := range m.Hosts { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Gateways) > 0 { - for _, s := range m.Gateways { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.ExportTo) > 0 { + for iNdEx := len(m.ExportTo) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExportTo[iNdEx]) + copy(dAtA[i:], m.ExportTo[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.ExportTo[iNdEx]))) + i-- + dAtA[i] = 0x32 } } - if len(m.Http) > 0 { - for _, msg := range m.Http { - dAtA[i] = 0x1a - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Tls) > 0 { + for iNdEx := len(m.Tls) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tls[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x2a } } if len(m.Tcp) > 0 { - for _, msg := range m.Tcp { - dAtA[i] = 0x22 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Tcp) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tcp[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x22 } } - if len(m.Tls) > 0 { - for _, msg := range m.Tls { - dAtA[i] = 0x2a - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Http) > 0 { + for iNdEx := len(m.Http) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Http[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - if len(m.ExportTo) > 0 { - for _, s := range m.ExportTo { - dAtA[i] = 0x32 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.Gateways) > 0 { + for iNdEx := len(m.Gateways) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Gateways[iNdEx]) + copy(dAtA[i:], m.Gateways[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Gateways[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Hosts) > 0 { + for iNdEx := len(m.Hosts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Hosts[iNdEx]) + copy(dAtA[i:], m.Hosts[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Hosts[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *Destination) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3241,42 +3236,52 @@ func (m *Destination) Marshal() (dAtA []byte, err error) { } func (m *Destination) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Destination) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Host) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Host))) - i += copy(dAtA[i:], m.Host) - } - if len(m.Subset) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Subset))) - i += copy(dAtA[i:], m.Subset) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Port != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Port.Size())) - n1, err := m.Port.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Port.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i += n1 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Subset) > 0 { + i -= len(m.Subset) + copy(dAtA[i:], m.Subset) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Subset))) + i-- + dAtA[i] = 0x12 + } + if len(m.Host) > 0 { + i -= len(m.Host) + copy(dAtA[i:], m.Host) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Host))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HTTPRoute) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3284,217 +3289,237 @@ func (m *HTTPRoute) Marshal() (dAtA []byte, err error) { } func (m *HTTPRoute) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Match) > 0 { - for _, msg := range m.Match { - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Route) > 0 { - for _, msg := range m.Route { - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.Headers != nil { + { + size, err := m.Headers.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 } - if m.Redirect != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Redirect.Size())) - n2, err := m.Redirect.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.AppendRequestHeaders) > 0 { + for k := range m.AppendRequestHeaders { + v := m.AppendRequestHeaders[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x7a } - i += n2 } - if m.Rewrite != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Rewrite.Size())) - n3, err := m.Rewrite.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.RemoveRequestHeaders) > 0 { + for iNdEx := len(m.RemoveRequestHeaders) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RemoveRequestHeaders[iNdEx]) + copy(dAtA[i:], m.RemoveRequestHeaders[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.RemoveRequestHeaders[iNdEx]))) + i-- + dAtA[i] = 0x72 } - i += n3 } - if m.WebsocketUpgrade { - dAtA[i] = 0x28 - i++ - if m.WebsocketUpgrade { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if len(m.AppendResponseHeaders) > 0 { + for k := range m.AppendResponseHeaders { + v := m.AppendResponseHeaders[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x6a } - i++ } - if m.Timeout != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Timeout.Size())) - n4, err := m.Timeout.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.RemoveResponseHeaders) > 0 { + for iNdEx := len(m.RemoveResponseHeaders) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RemoveResponseHeaders[iNdEx]) + copy(dAtA[i:], m.RemoveResponseHeaders[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.RemoveResponseHeaders[iNdEx]))) + i-- + dAtA[i] = 0x62 } - i += n4 } - if m.Retries != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Retries.Size())) - n5, err := m.Retries.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.AppendHeaders) > 0 { + for k := range m.AppendHeaders { + v := m.AppendHeaders[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x5a } - i += n5 } - if m.Fault != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Fault.Size())) - n6, err := m.Fault.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.CorsPolicy != nil { + { + size, err := m.CorsPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x52 } if m.Mirror != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Mirror.Size())) - n7, err := m.Mirror.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Mirror.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x4a } - if m.CorsPolicy != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.CorsPolicy.Size())) - n8, err := m.CorsPolicy.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Fault != nil { + { + size, err := m.Fault.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x42 } - if len(m.AppendHeaders) > 0 { - for k, _ := range m.AppendHeaders { - dAtA[i] = 0x5a - i++ - v := m.AppendHeaders[k] - mapSize := 1 + len(k) + sovVirtualService(uint64(len(k))) + 1 + len(v) + sovVirtualService(uint64(len(v))) - i = encodeVarintVirtualService(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + if m.Retries != nil { + { + size, err := m.Retries.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x3a } - if len(m.RemoveResponseHeaders) > 0 { - for _, s := range m.RemoveResponseHeaders { - dAtA[i] = 0x62 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if m.Timeout != nil { + { + size, err := m.Timeout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x32 } - if len(m.AppendResponseHeaders) > 0 { - for k, _ := range m.AppendResponseHeaders { - dAtA[i] = 0x6a - i++ - v := m.AppendResponseHeaders[k] - mapSize := 1 + len(k) + sovVirtualService(uint64(len(k))) + 1 + len(v) + sovVirtualService(uint64(len(v))) - i = encodeVarintVirtualService(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + if m.WebsocketUpgrade { + i-- + if m.WebsocketUpgrade { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i-- + dAtA[i] = 0x28 } - if len(m.RemoveRequestHeaders) > 0 { - for _, s := range m.RemoveRequestHeaders { - dAtA[i] = 0x72 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if m.Rewrite != nil { + { + size, err := m.Rewrite.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x22 } - if len(m.AppendRequestHeaders) > 0 { - for k, _ := range m.AppendRequestHeaders { - dAtA[i] = 0x7a - i++ - v := m.AppendRequestHeaders[k] - mapSize := 1 + len(k) + sovVirtualService(uint64(len(k))) + 1 + len(v) + sovVirtualService(uint64(len(v))) - i = encodeVarintVirtualService(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + if m.Redirect != nil { + { + size, err := m.Redirect.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a } - if m.Headers != nil { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Headers.Size())) - n9, err := m.Headers.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Route) > 0 { + for iNdEx := len(m.Route) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Route[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - i += n9 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Match) > 0 { + for iNdEx := len(m.Match) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Match[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *Headers) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3502,40 +3527,50 @@ func (m *Headers) Marshal() (dAtA []byte, err error) { } func (m *Headers) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Headers) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Request != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Request.Size())) - n10, err := m.Request.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Response != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Response.Size())) - n11, err := m.Response.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Response.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i += n11 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Request != nil { + { + size, err := m.Request.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Headers_HeaderOperations) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3543,69 +3578,73 @@ func (m *Headers_HeaderOperations) Marshal() (dAtA []byte, err error) { } func (m *Headers_HeaderOperations) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Headers_HeaderOperations) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Set) > 0 { - for k, _ := range m.Set { - dAtA[i] = 0xa - i++ - v := m.Set[k] - mapSize := 1 + len(k) + sovVirtualService(uint64(len(k))) + 1 + len(v) + sovVirtualService(uint64(len(v))) - i = encodeVarintVirtualService(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Remove) > 0 { + for iNdEx := len(m.Remove) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Remove[iNdEx]) + copy(dAtA[i:], m.Remove[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Remove[iNdEx]))) + i-- + dAtA[i] = 0x1a } } if len(m.Add) > 0 { - for k, _ := range m.Add { - dAtA[i] = 0x12 - i++ + for k := range m.Add { v := m.Add[k] - mapSize := 1 + len(k) + sovVirtualService(uint64(len(k))) + 1 + len(v) + sovVirtualService(uint64(len(v))) - i = encodeVarintVirtualService(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) } } - if len(m.Remove) > 0 { - for _, s := range m.Remove { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.Set) > 0 { + for k := range m.Set { + v := m.Set[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *TLSRoute) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3613,44 +3652,54 @@ func (m *TLSRoute) Marshal() (dAtA []byte, err error) { } func (m *TLSRoute) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TLSRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Match) > 0 { - for _, msg := range m.Match { - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Route) > 0 { - for _, msg := range m.Route { - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Route) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Route[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Match) > 0 { + for iNdEx := len(m.Match) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Match[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *TCPRoute) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3658,44 +3707,54 @@ func (m *TCPRoute) Marshal() (dAtA []byte, err error) { } func (m *TCPRoute) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TCPRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Match) > 0 { - for _, msg := range m.Match { - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Route) > 0 { - for _, msg := range m.Route { - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Route) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Route[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Match) > 0 { + for iNdEx := len(m.Match) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Match[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *HTTPMatchRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3703,163 +3762,169 @@ func (m *HTTPMatchRequest) Marshal() (dAtA []byte, err error) { } func (m *HTTPMatchRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPMatchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Uri != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Uri.Size())) - n12, err := m.Uri.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n12 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Scheme != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Scheme.Size())) - n13, err := m.Scheme.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.IgnoreUriCase { + i-- + if m.IgnoreUriCase { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } - i += n13 + i-- + dAtA[i] = 0x50 } - if m.Method != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Method.Size())) - n14, err := m.Method.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.QueryParams) > 0 { + for k := range m.QueryParams { + v := m.QueryParams[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a } - i += n14 } - if m.Authority != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Authority.Size())) - n15, err := m.Authority.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Gateways) > 0 { + for iNdEx := len(m.Gateways) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Gateways[iNdEx]) + copy(dAtA[i:], m.Gateways[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Gateways[iNdEx]))) + i-- + dAtA[i] = 0x42 } - i += n15 } - if len(m.Headers) > 0 { - for k, _ := range m.Headers { - dAtA[i] = 0x2a - i++ - v := m.Headers[k] - msgSize := 0 - if v != nil { - msgSize = v.Size() - msgSize += 1 + sovVirtualService(uint64(msgSize)) - } - mapSize := 1 + len(k) + sovVirtualService(uint64(len(k))) + msgSize - i = encodeVarintVirtualService(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ + if len(m.SourceLabels) > 0 { + for k := range m.SourceLabels { + v := m.SourceLabels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - if v != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(v.Size())) - n16, err := v.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n16 - } + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a } } if m.Port != 0 { - dAtA[i] = 0x30 - i++ i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x30 } - if len(m.SourceLabels) > 0 { - for k, _ := range m.SourceLabels { - dAtA[i] = 0x3a - i++ - v := m.SourceLabels[k] - mapSize := 1 + len(k) + sovVirtualService(uint64(len(k))) + 1 + len(v) + sovVirtualService(uint64(len(v))) - i = encodeVarintVirtualService(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ + if len(m.Headers) > 0 { + for k := range m.Headers { + v := m.Headers[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a } } - if len(m.Gateways) > 0 { - for _, s := range m.Gateways { - dAtA[i] = 0x42 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if m.Authority != nil { + { + size, err := m.Authority.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x22 } - if len(m.QueryParams) > 0 { - for k, _ := range m.QueryParams { - dAtA[i] = 0x4a - i++ - v := m.QueryParams[k] - msgSize := 0 - if v != nil { - msgSize = v.Size() - msgSize += 1 + sovVirtualService(uint64(msgSize)) - } - mapSize := 1 + len(k) + sovVirtualService(uint64(len(k))) + msgSize - i = encodeVarintVirtualService(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - if v != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(v.Size())) - n17, err := v.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n17 + if m.Method != nil { + { + size, err := m.Method.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a } - if m.IgnoreUriCase { - dAtA[i] = 0x50 - i++ - if m.IgnoreUriCase { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if m.Scheme != nil { + { + size, err := m.Scheme.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i++ + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Uri != nil { + { + size, err := m.Uri.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HTTPRouteDestination) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3867,109 +3932,111 @@ func (m *HTTPRouteDestination) Marshal() (dAtA []byte, err error) { } func (m *HTTPRouteDestination) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPRouteDestination) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Destination != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Destination.Size())) - n18, err := m.Destination.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n18 - } - if m.Weight != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Weight)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.RemoveResponseHeaders) > 0 { - for _, s := range m.RemoveResponseHeaders { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if m.Headers != nil { + { + size, err := m.Headers.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x3a } - if len(m.AppendResponseHeaders) > 0 { - for k, _ := range m.AppendResponseHeaders { - dAtA[i] = 0x22 - i++ - v := m.AppendResponseHeaders[k] - mapSize := 1 + len(k) + sovVirtualService(uint64(len(k))) + 1 + len(v) + sovVirtualService(uint64(len(v))) - i = encodeVarintVirtualService(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + if len(m.AppendRequestHeaders) > 0 { + for k := range m.AppendRequestHeaders { + v := m.AppendRequestHeaders[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 } } if len(m.RemoveRequestHeaders) > 0 { - for _, s := range m.RemoveRequestHeaders { + for iNdEx := len(m.RemoveRequestHeaders) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RemoveRequestHeaders[iNdEx]) + copy(dAtA[i:], m.RemoveRequestHeaders[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.RemoveRequestHeaders[iNdEx]))) + i-- dAtA[i] = 0x2a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if len(m.AppendRequestHeaders) > 0 { - for k, _ := range m.AppendRequestHeaders { - dAtA[i] = 0x32 - i++ - v := m.AppendRequestHeaders[k] - mapSize := 1 + len(k) + sovVirtualService(uint64(len(k))) + 1 + len(v) + sovVirtualService(uint64(len(v))) - i = encodeVarintVirtualService(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + if len(m.AppendResponseHeaders) > 0 { + for k := range m.AppendResponseHeaders { + v := m.AppendResponseHeaders[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 } } - if m.Headers != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Headers.Size())) - n19, err := m.Headers.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.RemoveResponseHeaders) > 0 { + for iNdEx := len(m.RemoveResponseHeaders) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RemoveResponseHeaders[iNdEx]) + copy(dAtA[i:], m.RemoveResponseHeaders[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.RemoveResponseHeaders[iNdEx]))) + i-- + dAtA[i] = 0x1a } - i += n19 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Weight != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Weight)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.Destination != nil { + { + size, err := m.Destination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *RouteDestination) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3977,35 +4044,43 @@ func (m *RouteDestination) Marshal() (dAtA []byte, err error) { } func (m *RouteDestination) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RouteDestination) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Destination != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Destination.Size())) - n20, err := m.Destination.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n20 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Weight != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintVirtualService(dAtA, i, uint64(m.Weight)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Destination != nil { + { + size, err := m.Destination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *L4MatchAttributes) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -4013,78 +4088,75 @@ func (m *L4MatchAttributes) Marshal() (dAtA []byte, err error) { } func (m *L4MatchAttributes) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *L4MatchAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.DestinationSubnets) > 0 { - for _, s := range m.DestinationSubnets { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if m.Port != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.SourceSubnet) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(m.SourceSubnet))) - i += copy(dAtA[i:], m.SourceSubnet) + if len(m.Gateways) > 0 { + for iNdEx := len(m.Gateways) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Gateways[iNdEx]) + copy(dAtA[i:], m.Gateways[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Gateways[iNdEx]))) + i-- + dAtA[i] = 0x2a + } } if len(m.SourceLabels) > 0 { - for k, _ := range m.SourceLabels { - dAtA[i] = 0x22 - i++ + for k := range m.SourceLabels { v := m.SourceLabels[k] - mapSize := 1 + len(k) + sovVirtualService(uint64(len(k))) + 1 + len(v) + sovVirtualService(uint64(len(v))) - i = encodeVarintVirtualService(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 } } - if len(m.Gateways) > 0 { - for _, s := range m.Gateways { - dAtA[i] = 0x2a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if len(m.SourceSubnet) > 0 { + i -= len(m.SourceSubnet) + copy(dAtA[i:], m.SourceSubnet) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.SourceSubnet))) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Port != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x10 + } + if len(m.DestinationSubnets) > 0 { + for iNdEx := len(m.DestinationSubnets) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DestinationSubnets[iNdEx]) + copy(dAtA[i:], m.DestinationSubnets[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.DestinationSubnets[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *TLSMatchAttributes) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -4092,93 +4164,84 @@ func (m *TLSMatchAttributes) Marshal() (dAtA []byte, err error) { } func (m *TLSMatchAttributes) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TLSMatchAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SniHosts) > 0 { - for _, s := range m.SniHosts { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Gateways) > 0 { + for iNdEx := len(m.Gateways) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Gateways[iNdEx]) + copy(dAtA[i:], m.Gateways[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Gateways[iNdEx]))) + i-- + dAtA[i] = 0x32 } } - if len(m.DestinationSubnets) > 0 { - for _, s := range m.DestinationSubnets { + if len(m.SourceLabels) > 0 { + for k := range m.SourceLabels { + v := m.SourceLabels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) + i-- dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a } } - if m.Port != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) - } if len(m.SourceSubnet) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.SourceSubnet) + copy(dAtA[i:], m.SourceSubnet) i = encodeVarintVirtualService(dAtA, i, uint64(len(m.SourceSubnet))) - i += copy(dAtA[i:], m.SourceSubnet) + i-- + dAtA[i] = 0x22 } - if len(m.SourceLabels) > 0 { - for k, _ := range m.SourceLabels { - dAtA[i] = 0x2a - i++ - v := m.SourceLabels[k] - mapSize := 1 + len(k) + sovVirtualService(uint64(len(k))) + 1 + len(v) + sovVirtualService(uint64(len(v))) - i = encodeVarintVirtualService(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } + if m.Port != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x18 } - if len(m.Gateways) > 0 { - for _, s := range m.Gateways { - dAtA[i] = 0x32 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.DestinationSubnets) > 0 { + for iNdEx := len(m.DestinationSubnets) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DestinationSubnets[iNdEx]) + copy(dAtA[i:], m.DestinationSubnets[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.DestinationSubnets[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.SniHosts) > 0 { + for iNdEx := len(m.SniHosts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SniHosts[iNdEx]) + copy(dAtA[i:], m.SniHosts[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.SniHosts[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *HTTPRedirect) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -4186,37 +4249,45 @@ func (m *HTTPRedirect) Marshal() (dAtA []byte, err error) { } func (m *HTTPRedirect) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPRedirect) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Uri) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Uri))) - i += copy(dAtA[i:], m.Uri) - } - if len(m.Authority) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Authority))) - i += copy(dAtA[i:], m.Authority) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.RedirectCode != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintVirtualService(dAtA, i, uint64(m.RedirectCode)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x12 + } + if len(m.Uri) > 0 { + i -= len(m.Uri) + copy(dAtA[i:], m.Uri) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Uri))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HTTPRewrite) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -4224,32 +4295,40 @@ func (m *HTTPRewrite) Marshal() (dAtA []byte, err error) { } func (m *HTTPRewrite) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPRewrite) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Uri) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Uri))) - i += copy(dAtA[i:], m.Uri) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Authority) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Authority))) - i += copy(dAtA[i:], m.Authority) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Uri) > 0 { + i -= len(m.Uri) + copy(dAtA[i:], m.Uri) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Uri))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *StringMatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -4257,51 +4336,74 @@ func (m *StringMatch) Marshal() (dAtA []byte, err error) { } func (m *StringMatch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StringMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.MatchType != nil { - nn21, err := m.MatchType.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.MatchType.Size() + i -= size + if _, err := m.MatchType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn21 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *StringMatch_Exact) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0xa - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *StringMatch_Exact) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Exact) + copy(dAtA[i:], m.Exact) i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Exact))) - i += copy(dAtA[i:], m.Exact) - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *StringMatch_Prefix) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *StringMatch_Prefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Prefix))) - i += copy(dAtA[i:], m.Prefix) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *StringMatch_Regex) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x1a - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *StringMatch_Regex) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Regex) + copy(dAtA[i:], m.Regex) i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Regex))) - i += copy(dAtA[i:], m.Regex) - return i, nil + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil } func (m *HTTPRetry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -4309,41 +4411,50 @@ func (m *HTTPRetry) Marshal() (dAtA []byte, err error) { } func (m *HTTPRetry) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPRetry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Attempts != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Attempts)) - } - if m.PerTryTimeout != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.PerTryTimeout.Size())) - n22, err := m.PerTryTimeout.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n22 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.RetryOn) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.RetryOn) + copy(dAtA[i:], m.RetryOn) i = encodeVarintVirtualService(dAtA, i, uint64(len(m.RetryOn))) - i += copy(dAtA[i:], m.RetryOn) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.PerTryTimeout != nil { + { + size, err := m.PerTryTimeout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Attempts != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Attempts)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *CorsPolicy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -4351,100 +4462,86 @@ func (m *CorsPolicy) Marshal() (dAtA []byte, err error) { } func (m *CorsPolicy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CorsPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.AllowOrigin) > 0 { - for _, s := range m.AllowOrigin { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.AllowMethods) > 0 { - for _, s := range m.AllowMethods { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if m.AllowCredentials != nil { + { + size, err := m.AllowCredentials.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x32 } - if len(m.AllowHeaders) > 0 { - for _, s := range m.AllowHeaders { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if m.MaxAge != nil { + { + size, err := m.MaxAge.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x2a } if len(m.ExposeHeaders) > 0 { - for _, s := range m.ExposeHeaders { + for iNdEx := len(m.ExposeHeaders) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExposeHeaders[iNdEx]) + copy(dAtA[i:], m.ExposeHeaders[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.ExposeHeaders[iNdEx]))) + i-- dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if m.MaxAge != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.MaxAge.Size())) - n23, err := m.MaxAge.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.AllowHeaders) > 0 { + for iNdEx := len(m.AllowHeaders) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowHeaders[iNdEx]) + copy(dAtA[i:], m.AllowHeaders[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.AllowHeaders[iNdEx]))) + i-- + dAtA[i] = 0x1a } - i += n23 } - if m.AllowCredentials != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.AllowCredentials.Size())) - n24, err := m.AllowCredentials.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.AllowMethods) > 0 { + for iNdEx := len(m.AllowMethods) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowMethods[iNdEx]) + copy(dAtA[i:], m.AllowMethods[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.AllowMethods[iNdEx]))) + i-- + dAtA[i] = 0x12 } - i += n24 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.AllowOrigin) > 0 { + for iNdEx := len(m.AllowOrigin) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowOrigin[iNdEx]) + copy(dAtA[i:], m.AllowOrigin[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.AllowOrigin[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *HTTPFaultInjection) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -4452,40 +4549,50 @@ func (m *HTTPFaultInjection) Marshal() (dAtA []byte, err error) { } func (m *HTTPFaultInjection) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPFaultInjection) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Delay != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Delay.Size())) - n25, err := m.Delay.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n25 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Abort != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Abort.Size())) - n26, err := m.Abort.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Abort.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i += n26 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Delay != nil { + { + size, err := m.Delay.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HTTPFaultInjection_Delay) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -4493,70 +4600,92 @@ func (m *HTTPFaultInjection_Delay) Marshal() (dAtA []byte, err error) { } func (m *HTTPFaultInjection_Delay) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPFaultInjection_Delay) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Percent != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Percent)) - } - if m.HttpDelayType != nil { - nn27, err := m.HttpDelayType.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn27 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Percentage != nil { + { + size, err := m.Percentage.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x2a - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Percentage.Size())) - n28, err := m.Percentage.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + } + if m.HttpDelayType != nil { + { + size := m.HttpDelayType.Size() + i -= size + if _, err := m.HttpDelayType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += n28 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Percent != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Percent)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *HTTPFaultInjection_Delay_FixedDelay) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *HTTPFaultInjection_Delay_FixedDelay) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.FixedDelay != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.FixedDelay.Size())) - n29, err := m.FixedDelay.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.FixedDelay.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i += n29 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *HTTPFaultInjection_Delay_ExponentialDelay) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *HTTPFaultInjection_Delay_ExponentialDelay) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.ExponentialDelay != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.ExponentialDelay.Size())) - n30, err := m.ExponentialDelay.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ExponentialDelay.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i += n30 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *HTTPFaultInjection_Abort) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -4564,65 +4693,89 @@ func (m *HTTPFaultInjection_Abort) Marshal() (dAtA []byte, err error) { } func (m *HTTPFaultInjection_Abort) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPFaultInjection_Abort) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Percent != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Percent)) - } - if m.ErrorType != nil { - nn31, err := m.ErrorType.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn31 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Percentage != nil { + { + size, err := m.Percentage.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x2a - i++ - i = encodeVarintVirtualService(dAtA, i, uint64(m.Percentage.Size())) - n32, err := m.Percentage.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + } + if m.ErrorType != nil { + { + size := m.ErrorType.Size() + i -= size + if _, err := m.ErrorType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += n32 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Percent != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Percent)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *HTTPFaultInjection_Abort_HttpStatus) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x10 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *HTTPFaultInjection_Abort_HttpStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintVirtualService(dAtA, i, uint64(m.HttpStatus)) - return i, nil + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil } func (m *HTTPFaultInjection_Abort_GrpcStatus) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x1a - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *HTTPFaultInjection_Abort_GrpcStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.GrpcStatus) + copy(dAtA[i:], m.GrpcStatus) i = encodeVarintVirtualService(dAtA, i, uint64(len(m.GrpcStatus))) - i += copy(dAtA[i:], m.GrpcStatus) - return i, nil + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil } func (m *HTTPFaultInjection_Abort_Http2Error) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x22 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *HTTPFaultInjection_Abort_Http2Error) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Http2Error) + copy(dAtA[i:], m.Http2Error) i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Http2Error))) - i += copy(dAtA[i:], m.Http2Error) - return i, nil + i-- + dAtA[i] = 0x22 + return len(dAtA) - i, nil } func (m *PortSelector) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -4630,42 +4783,59 @@ func (m *PortSelector) Marshal() (dAtA []byte, err error) { } func (m *PortSelector) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PortSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Port != nil { - nn33, err := m.Port.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Port.Size() + i -= size + if _, err := m.Port.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn33 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *PortSelector_Number) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x8 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *PortSelector_Number) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintVirtualService(dAtA, i, uint64(m.Number)) - return i, nil + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil } func (m *PortSelector_Name) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *PortSelector_Name) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *Percent) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -4673,30 +4843,38 @@ func (m *Percent) Marshal() (dAtA []byte, err error) { } func (m *Percent) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Percent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Value != 0 { - dAtA[i] = 0x9 - i++ + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i += 8 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0x9 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintVirtualService(dAtA []byte, offset int, v uint64) int { + offset -= sovVirtualService(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *VirtualService) Size() (n int) { if m == nil { @@ -5517,14 +5695,7 @@ func (m *Percent) Size() (n int) { } func sovVirtualService(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozVirtualService(x uint64) (n int) { return sovVirtualService(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/policy/v1beta1/cfg.pb.go b/policy/v1beta1/cfg.pb.go index ddce4e57fe3..508c795102b 100644 --- a/policy/v1beta1/cfg.pb.go +++ b/policy/v1beta1/cfg.pb.go @@ -12,6 +12,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strconv "strconv" strings "strings" @@ -150,7 +151,7 @@ func (m *AttributeManifest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_AttributeManifest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -251,7 +252,7 @@ func (m *AttributeManifest_AttributeInfo) XXX_Marshal(b []byte, deterministic bo return xxx_messageInfo_AttributeManifest_AttributeInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -340,7 +341,7 @@ func (m *Rule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Rule.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -431,7 +432,7 @@ func (m *Rule_HeaderOperationTemplate) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_Rule_HeaderOperationTemplate.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -507,7 +508,7 @@ func (m *Action) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Action.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -614,7 +615,7 @@ func (m *Instance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Instance.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -755,7 +756,7 @@ func (m *Handler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Handler.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -834,7 +835,7 @@ func (m *Connection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Connection.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -899,7 +900,7 @@ func (m *Sampling) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Sampling.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -971,7 +972,7 @@ func (m *RandomSampling) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_RandomSampling.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1037,7 +1038,7 @@ func (m *RateLimitSampling) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_RateLimitSampling.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1105,7 +1106,7 @@ func (m *FractionalPercent) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_FractionalPercent.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1160,7 +1161,7 @@ func (m *Authentication) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_Authentication.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1327,7 +1328,7 @@ func (m *Tls) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Tls.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1571,7 +1572,7 @@ func (m *OAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_OAuth.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1657,7 +1658,7 @@ func (m *Mutual) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Mutual.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2879,7 +2880,7 @@ func valueToGoStringCfg(v interface{}, typ string) string { func (m *AttributeManifest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2887,57 +2888,62 @@ func (m *AttributeManifest) Marshal() (dAtA []byte, err error) { } func (m *AttributeManifest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AttributeManifest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Revision) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.Revision))) - i += copy(dAtA[i:], m.Revision) - } - if len(m.Name) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } if len(m.Attributes) > 0 { - for k, _ := range m.Attributes { - dAtA[i] = 0x1a - i++ + for k := range m.Attributes { v := m.Attributes[k] - msgSize := 0 + baseI := i if v != nil { - msgSize = v.Size() - msgSize += 1 + sovCfg(uint64(msgSize)) - } - mapSize := 1 + len(k) + sovCfg(uint64(len(k))) + msgSize - i = encodeVarintCfg(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - if v != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintCfg(dAtA, i, uint64(v.Size())) - n1, err := v.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCfg(dAtA, i, uint64(size)) } - i += n1 + i-- + dAtA[i] = 0x12 } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintCfg(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintCfg(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - return i, nil + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintCfg(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Revision) > 0 { + i -= len(m.Revision) + copy(dAtA[i:], m.Revision) + i = encodeVarintCfg(dAtA, i, uint64(len(m.Revision))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *AttributeManifest_AttributeInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2945,28 +2951,34 @@ func (m *AttributeManifest_AttributeInfo) Marshal() (dAtA []byte, err error) { } func (m *AttributeManifest_AttributeInfo) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AttributeManifest_AttributeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Description) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.Description))) - i += copy(dAtA[i:], m.Description) - } if m.ValueType != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintCfg(dAtA, i, uint64(m.ValueType)) + i-- + dAtA[i] = 0x10 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintCfg(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Rule) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2974,69 +2986,83 @@ func (m *Rule) Marshal() (dAtA []byte, err error) { } func (m *Rule) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Rule) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Match) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.Match))) - i += copy(dAtA[i:], m.Match) - } - if len(m.Actions) > 0 { - for _, msg := range m.Actions { - dAtA[i] = 0x12 - i++ - i = encodeVarintCfg(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.Sampling != nil { + { + size, err := m.Sampling.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintCfg(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.ResponseHeaderOperations) > 0 { + for iNdEx := len(m.ResponseHeaderOperations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResponseHeaderOperations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCfg(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } } if len(m.RequestHeaderOperations) > 0 { - for _, msg := range m.RequestHeaderOperations { - dAtA[i] = 0x1a - i++ - i = encodeVarintCfg(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.RequestHeaderOperations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RequestHeaderOperations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCfg(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - if len(m.ResponseHeaderOperations) > 0 { - for _, msg := range m.ResponseHeaderOperations { - dAtA[i] = 0x22 - i++ - i = encodeVarintCfg(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Actions) > 0 { + for iNdEx := len(m.Actions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Actions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCfg(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.Sampling != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintCfg(dAtA, i, uint64(m.Sampling.Size())) - n2, err := m.Sampling.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 + if len(m.Match) > 0 { + i -= len(m.Match) + copy(dAtA[i:], m.Match) + i = encodeVarintCfg(dAtA, i, uint64(len(m.Match))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Rule_HeaderOperationTemplate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3044,43 +3070,43 @@ func (m *Rule_HeaderOperationTemplate) Marshal() (dAtA []byte, err error) { } func (m *Rule_HeaderOperationTemplate) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Rule_HeaderOperationTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.Operation != 0 { + i = encodeVarintCfg(dAtA, i, uint64(m.Operation)) + i-- + dAtA[i] = 0x18 } if len(m.Values) > 0 { - for _, s := range m.Values { + for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Values[iNdEx]) + copy(dAtA[i:], m.Values[iNdEx]) + i = encodeVarintCfg(dAtA, i, uint64(len(m.Values[iNdEx]))) + i-- dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if m.Operation != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintCfg(dAtA, i, uint64(m.Operation)) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintCfg(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Action) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3088,44 +3114,45 @@ func (m *Action) Marshal() (dAtA []byte, err error) { } func (m *Action) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Handler) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.Handler))) - i += copy(dAtA[i:], m.Handler) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintCfg(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x22 } if len(m.Instances) > 0 { - for _, s := range m.Instances { + for iNdEx := len(m.Instances) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Instances[iNdEx]) + copy(dAtA[i:], m.Instances[iNdEx]) + i = encodeVarintCfg(dAtA, i, uint64(len(m.Instances[iNdEx]))) + i-- dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if len(m.Name) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if len(m.Handler) > 0 { + i -= len(m.Handler) + copy(dAtA[i:], m.Handler) + i = encodeVarintCfg(dAtA, i, uint64(len(m.Handler))) + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *Instance) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3133,70 +3160,82 @@ func (m *Instance) Marshal() (dAtA []byte, err error) { } func (m *Instance) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Instance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Template) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.Template))) - i += copy(dAtA[i:], m.Template) - } - if m.Params != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintCfg(dAtA, i, uint64(m.Params.Size())) - n3, err := m.Params.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 + if len(m.CompiledTemplate) > 0 { + i -= len(m.CompiledTemplate) + copy(dAtA[i:], m.CompiledTemplate) + i = encodeVarintCfg(dAtA, i, uint64(len(m.CompiledTemplate))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x82 + i-- + dAtA[i] = 0xce + i-- + dAtA[i] = 0xef + i-- + dAtA[i] = 0xa2 } if len(m.AttributeBindings) > 0 { - for k, _ := range m.AttributeBindings { - dAtA[i] = 0x22 - i++ + for k := range m.AttributeBindings { v := m.AttributeBindings[k] - mapSize := 1 + len(k) + sovCfg(uint64(len(k))) + 1 + len(v) + sovCfg(uint64(len(v))) - i = encodeVarintCfg(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintCfg(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintCfg(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintCfg(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 } } - if len(m.CompiledTemplate) > 0 { - dAtA[i] = 0xa2 - i++ - dAtA[i] = 0xef - i++ - dAtA[i] = 0xce - i++ - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x2 - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.CompiledTemplate))) - i += copy(dAtA[i:], m.CompiledTemplate) + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCfg(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Template) > 0 { + i -= len(m.Template) + copy(dAtA[i:], m.Template) + i = encodeVarintCfg(dAtA, i, uint64(len(m.Template))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintCfg(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Handler) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3204,63 +3243,75 @@ func (m *Handler) Marshal() (dAtA []byte, err error) { } func (m *Handler) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Handler) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if len(m.CompiledAdapter) > 0 { + i -= len(m.CompiledAdapter) + copy(dAtA[i:], m.CompiledAdapter) + i = encodeVarintCfg(dAtA, i, uint64(len(m.CompiledAdapter))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x82 + i-- + dAtA[i] = 0xce + i-- + dAtA[i] = 0xef + i-- + dAtA[i] = 0xa2 } - if len(m.Adapter) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.Adapter))) - i += copy(dAtA[i:], m.Adapter) + if m.Connection != nil { + { + size, err := m.Connection.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCfg(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } if m.Params != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintCfg(dAtA, i, uint64(m.Params.Size())) - n4, err := m.Params.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCfg(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x1a } - if m.Connection != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintCfg(dAtA, i, uint64(m.Connection.Size())) - n5, err := m.Connection.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 + if len(m.Adapter) > 0 { + i -= len(m.Adapter) + copy(dAtA[i:], m.Adapter) + i = encodeVarintCfg(dAtA, i, uint64(len(m.Adapter))) + i-- + dAtA[i] = 0x12 } - if len(m.CompiledAdapter) > 0 { - dAtA[i] = 0xa2 - i++ - dAtA[i] = 0xef - i++ - dAtA[i] = 0xce - i++ - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x2 - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.CompiledAdapter))) - i += copy(dAtA[i:], m.CompiledAdapter) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintCfg(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Connection) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3268,43 +3319,51 @@ func (m *Connection) Marshal() (dAtA []byte, err error) { } func (m *Connection) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Connection) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Address) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.Address))) - i += copy(dAtA[i:], m.Address) + if m.Authentication != nil { + { + size, err := m.Authentication.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCfg(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } if m.Timeout != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintCfg(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Timeout))) - n6, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Timeout, dAtA[i:]) - if err != nil { - return 0, err + n7, err7 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Timeout, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Timeout):]) + if err7 != nil { + return 0, err7 } - i += n6 + i -= n7 + i = encodeVarintCfg(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x1a } - if m.Authentication != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintCfg(dAtA, i, uint64(m.Authentication.Size())) - n7, err := m.Authentication.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintCfg(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *Sampling) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3312,37 +3371,46 @@ func (m *Sampling) Marshal() (dAtA []byte, err error) { } func (m *Sampling) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Sampling) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Random != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(m.Random.Size())) - n8, err := m.Random.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n8 - } if m.RateLimit != nil { + { + size, err := m.RateLimit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCfg(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintCfg(dAtA, i, uint64(m.RateLimit.Size())) - n9, err := m.RateLimit.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + } + if m.Random != nil { + { + size, err := m.Random.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCfg(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RandomSampling) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3350,43 +3418,51 @@ func (m *RandomSampling) Marshal() (dAtA []byte, err error) { } func (m *RandomSampling) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RandomSampling) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.AttributeExpression) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.AttributeExpression))) - i += copy(dAtA[i:], m.AttributeExpression) - } - if m.PercentSampled != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintCfg(dAtA, i, uint64(m.PercentSampled.Size())) - n10, err := m.PercentSampled.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 - } if m.UseIndependentRandomness { - dAtA[i] = 0x18 - i++ + i-- if m.UseIndependentRandomness { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 + } + if m.PercentSampled != nil { + { + size, err := m.PercentSampled.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCfg(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.AttributeExpression) > 0 { + i -= len(m.AttributeExpression) + copy(dAtA[i:], m.AttributeExpression) + i = encodeVarintCfg(dAtA, i, uint64(len(m.AttributeExpression))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *RateLimitSampling) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3394,35 +3470,40 @@ func (m *RateLimitSampling) Marshal() (dAtA []byte, err error) { } func (m *RateLimitSampling) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RateLimitSampling) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.SamplingDuration))) - n11, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.SamplingDuration, dAtA[i:]) - if err != nil { - return 0, err + if m.SamplingRate != 0 { + i = encodeVarintCfg(dAtA, i, uint64(m.SamplingRate)) + i-- + dAtA[i] = 0x18 } - i += n11 if m.MaxUnsampledEntries != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintCfg(dAtA, i, uint64(m.MaxUnsampledEntries)) + i-- + dAtA[i] = 0x10 } - if m.SamplingRate != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintCfg(dAtA, i, uint64(m.SamplingRate)) + n11, err11 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.SamplingDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.SamplingDuration):]) + if err11 != nil { + return 0, err11 } - return i, nil + i -= n11 + i = encodeVarintCfg(dAtA, i, uint64(n11)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *FractionalPercent) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3430,27 +3511,32 @@ func (m *FractionalPercent) Marshal() (dAtA []byte, err error) { } func (m *FractionalPercent) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FractionalPercent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Numerator != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintCfg(dAtA, i, uint64(m.Numerator)) - } if m.Denominator != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintCfg(dAtA, i, uint64(m.Denominator)) + i-- + dAtA[i] = 0x10 + } + if m.Numerator != 0 { + i = encodeVarintCfg(dAtA, i, uint64(m.Numerator)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *Authentication) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3458,52 +3544,71 @@ func (m *Authentication) Marshal() (dAtA []byte, err error) { } func (m *Authentication) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Authentication) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.AuthType != nil { - nn12, err := m.AuthType.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.AuthType.Size() + i -= size + if _, err := m.AuthType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn12 } - return i, nil + return len(dAtA) - i, nil } func (m *Authentication_Tls) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Authentication_Tls) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Tls != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(m.Tls.Size())) - n13, err := m.Tls.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Tls.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCfg(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Authentication_Mutual) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Authentication_Mutual) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Mutual != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintCfg(dAtA, i, uint64(m.Mutual.Size())) - n14, err := m.Mutual.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Mutual.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCfg(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *Tls) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3511,80 +3616,111 @@ func (m *Tls) Marshal() (dAtA []byte, err error) { } func (m *Tls) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Tls) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.CaCertificates) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.CaCertificates))) - i += copy(dAtA[i:], m.CaCertificates) + if len(m.ServerName) > 0 { + i -= len(m.ServerName) + copy(dAtA[i:], m.ServerName) + i = encodeVarintCfg(dAtA, i, uint64(len(m.ServerName))) + i-- + dAtA[i] = 0x32 } - if m.TokenSource != nil { - nn15, err := m.TokenSource.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.TokenType != nil { + { + size := m.TokenType.Size() + i -= size + if _, err := m.TokenType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn15 } - if m.TokenType != nil { - nn16, err := m.TokenType.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.TokenSource != nil { + { + size := m.TokenSource.Size() + i -= size + if _, err := m.TokenSource.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn16 } - if len(m.ServerName) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.ServerName))) - i += copy(dAtA[i:], m.ServerName) + if len(m.CaCertificates) > 0 { + i -= len(m.CaCertificates) + copy(dAtA[i:], m.CaCertificates) + i = encodeVarintCfg(dAtA, i, uint64(len(m.CaCertificates))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Tls_TokenPath) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Tls_TokenPath) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.TokenPath) + copy(dAtA[i:], m.TokenPath) i = encodeVarintCfg(dAtA, i, uint64(len(m.TokenPath))) - i += copy(dAtA[i:], m.TokenPath) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *Tls_Oauth) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Tls_Oauth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Oauth != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintCfg(dAtA, i, uint64(m.Oauth.Size())) - n17, err := m.Oauth.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Oauth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCfg(dAtA, i, uint64(size)) } - i += n17 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *Tls_AuthHeader_) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x20 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Tls_AuthHeader_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintCfg(dAtA, i, uint64(m.AuthHeader)) - return i, nil + i-- + dAtA[i] = 0x20 + return len(dAtA) - i, nil } func (m *Tls_CustomHeader) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x2a - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Tls_CustomHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.CustomHeader) + copy(dAtA[i:], m.CustomHeader) i = encodeVarintCfg(dAtA, i, uint64(len(m.CustomHeader))) - i += copy(dAtA[i:], m.CustomHeader) - return i, nil + i-- + dAtA[i] = 0x2a + return len(dAtA) - i, nil } func (m *OAuth) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3592,67 +3728,71 @@ func (m *OAuth) Marshal() (dAtA []byte, err error) { } func (m *OAuth) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OAuth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ClientId) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.ClientId))) - i += copy(dAtA[i:], m.ClientId) + if len(m.EndpointParams) > 0 { + for k := range m.EndpointParams { + v := m.EndpointParams[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintCfg(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintCfg(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintCfg(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } } - if len(m.ClientSecret) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.ClientSecret))) - i += copy(dAtA[i:], m.ClientSecret) + if len(m.Scopes) > 0 { + for iNdEx := len(m.Scopes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Scopes[iNdEx]) + copy(dAtA[i:], m.Scopes[iNdEx]) + i = encodeVarintCfg(dAtA, i, uint64(len(m.Scopes[iNdEx]))) + i-- + dAtA[i] = 0x22 + } } if len(m.TokenUrl) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.TokenUrl) + copy(dAtA[i:], m.TokenUrl) i = encodeVarintCfg(dAtA, i, uint64(len(m.TokenUrl))) - i += copy(dAtA[i:], m.TokenUrl) + i-- + dAtA[i] = 0x1a } - if len(m.Scopes) > 0 { - for _, s := range m.Scopes { - dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if len(m.ClientSecret) > 0 { + i -= len(m.ClientSecret) + copy(dAtA[i:], m.ClientSecret) + i = encodeVarintCfg(dAtA, i, uint64(len(m.ClientSecret))) + i-- + dAtA[i] = 0x12 } - if len(m.EndpointParams) > 0 { - for k, _ := range m.EndpointParams { - dAtA[i] = 0x2a - i++ - v := m.EndpointParams[k] - mapSize := 1 + len(k) + sovCfg(uint64(len(k))) + 1 + len(v) + sovCfg(uint64(len(v))) - i = encodeVarintCfg(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintCfg(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Mutual) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3660,45 +3800,56 @@ func (m *Mutual) Marshal() (dAtA []byte, err error) { } func (m *Mutual) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Mutual) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.PrivateKey) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.PrivateKey))) - i += copy(dAtA[i:], m.PrivateKey) - } - if len(m.ClientCertificate) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.ClientCertificate))) - i += copy(dAtA[i:], m.ClientCertificate) + if len(m.ServerName) > 0 { + i -= len(m.ServerName) + copy(dAtA[i:], m.ServerName) + i = encodeVarintCfg(dAtA, i, uint64(len(m.ServerName))) + i-- + dAtA[i] = 0x22 } if len(m.CaCertificates) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.CaCertificates) + copy(dAtA[i:], m.CaCertificates) i = encodeVarintCfg(dAtA, i, uint64(len(m.CaCertificates))) - i += copy(dAtA[i:], m.CaCertificates) + i-- + dAtA[i] = 0x1a } - if len(m.ServerName) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintCfg(dAtA, i, uint64(len(m.ServerName))) - i += copy(dAtA[i:], m.ServerName) + if len(m.ClientCertificate) > 0 { + i -= len(m.ClientCertificate) + copy(dAtA[i:], m.ClientCertificate) + i = encodeVarintCfg(dAtA, i, uint64(len(m.ClientCertificate))) + i-- + dAtA[i] = 0x12 + } + if len(m.PrivateKey) > 0 { + i -= len(m.PrivateKey) + copy(dAtA[i:], m.PrivateKey) + i = encodeVarintCfg(dAtA, i, uint64(len(m.PrivateKey))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintCfg(dAtA []byte, offset int, v uint64) int { + offset -= sovCfg(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *AttributeManifest) Size() (n int) { if m == nil { @@ -4139,14 +4290,7 @@ func (m *Mutual) Size() (n int) { } func sovCfg(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozCfg(x uint64) (n int) { return sovCfg(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -4188,12 +4332,27 @@ func (this *Rule) String() string { if this == nil { return "nil" } + repeatedStringForActions := "[]*Action{" + for _, f := range this.Actions { + repeatedStringForActions += strings.Replace(f.String(), "Action", "Action", 1) + "," + } + repeatedStringForActions += "}" + repeatedStringForRequestHeaderOperations := "[]*Rule_HeaderOperationTemplate{" + for _, f := range this.RequestHeaderOperations { + repeatedStringForRequestHeaderOperations += strings.Replace(fmt.Sprintf("%v", f), "Rule_HeaderOperationTemplate", "Rule_HeaderOperationTemplate", 1) + "," + } + repeatedStringForRequestHeaderOperations += "}" + repeatedStringForResponseHeaderOperations := "[]*Rule_HeaderOperationTemplate{" + for _, f := range this.ResponseHeaderOperations { + repeatedStringForResponseHeaderOperations += strings.Replace(fmt.Sprintf("%v", f), "Rule_HeaderOperationTemplate", "Rule_HeaderOperationTemplate", 1) + "," + } + repeatedStringForResponseHeaderOperations += "}" s := strings.Join([]string{`&Rule{`, `Match:` + fmt.Sprintf("%v", this.Match) + `,`, - `Actions:` + strings.Replace(fmt.Sprintf("%v", this.Actions), "Action", "Action", 1) + `,`, - `RequestHeaderOperations:` + strings.Replace(fmt.Sprintf("%v", this.RequestHeaderOperations), "Rule_HeaderOperationTemplate", "Rule_HeaderOperationTemplate", 1) + `,`, - `ResponseHeaderOperations:` + strings.Replace(fmt.Sprintf("%v", this.ResponseHeaderOperations), "Rule_HeaderOperationTemplate", "Rule_HeaderOperationTemplate", 1) + `,`, - `Sampling:` + strings.Replace(fmt.Sprintf("%v", this.Sampling), "Sampling", "Sampling", 1) + `,`, + `Actions:` + repeatedStringForActions + `,`, + `RequestHeaderOperations:` + repeatedStringForRequestHeaderOperations + `,`, + `ResponseHeaderOperations:` + repeatedStringForResponseHeaderOperations + `,`, + `Sampling:` + strings.Replace(this.Sampling.String(), "Sampling", "Sampling", 1) + `,`, `}`, }, "") return s @@ -4254,7 +4413,7 @@ func (this *Handler) String() string { `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Adapter:` + fmt.Sprintf("%v", this.Adapter) + `,`, `Params:` + strings.Replace(fmt.Sprintf("%v", this.Params), "Struct", "types.Struct", 1) + `,`, - `Connection:` + strings.Replace(fmt.Sprintf("%v", this.Connection), "Connection", "Connection", 1) + `,`, + `Connection:` + strings.Replace(this.Connection.String(), "Connection", "Connection", 1) + `,`, `CompiledAdapter:` + fmt.Sprintf("%v", this.CompiledAdapter) + `,`, `}`, }, "") @@ -4267,7 +4426,7 @@ func (this *Connection) String() string { s := strings.Join([]string{`&Connection{`, `Address:` + fmt.Sprintf("%v", this.Address) + `,`, `Timeout:` + strings.Replace(fmt.Sprintf("%v", this.Timeout), "Duration", "types.Duration", 1) + `,`, - `Authentication:` + strings.Replace(fmt.Sprintf("%v", this.Authentication), "Authentication", "Authentication", 1) + `,`, + `Authentication:` + strings.Replace(this.Authentication.String(), "Authentication", "Authentication", 1) + `,`, `}`, }, "") return s @@ -4277,8 +4436,8 @@ func (this *Sampling) String() string { return "nil" } s := strings.Join([]string{`&Sampling{`, - `Random:` + strings.Replace(fmt.Sprintf("%v", this.Random), "RandomSampling", "RandomSampling", 1) + `,`, - `RateLimit:` + strings.Replace(fmt.Sprintf("%v", this.RateLimit), "RateLimitSampling", "RateLimitSampling", 1) + `,`, + `Random:` + strings.Replace(this.Random.String(), "RandomSampling", "RandomSampling", 1) + `,`, + `RateLimit:` + strings.Replace(this.RateLimit.String(), "RateLimitSampling", "RateLimitSampling", 1) + `,`, `}`, }, "") return s @@ -4289,7 +4448,7 @@ func (this *RandomSampling) String() string { } s := strings.Join([]string{`&RandomSampling{`, `AttributeExpression:` + fmt.Sprintf("%v", this.AttributeExpression) + `,`, - `PercentSampled:` + strings.Replace(fmt.Sprintf("%v", this.PercentSampled), "FractionalPercent", "FractionalPercent", 1) + `,`, + `PercentSampled:` + strings.Replace(this.PercentSampled.String(), "FractionalPercent", "FractionalPercent", 1) + `,`, `UseIndependentRandomness:` + fmt.Sprintf("%v", this.UseIndependentRandomness) + `,`, `}`, }, "") @@ -4300,7 +4459,7 @@ func (this *RateLimitSampling) String() string { return "nil" } s := strings.Join([]string{`&RateLimitSampling{`, - `SamplingDuration:` + strings.Replace(strings.Replace(this.SamplingDuration.String(), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, + `SamplingDuration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.SamplingDuration), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, `MaxUnsampledEntries:` + fmt.Sprintf("%v", this.MaxUnsampledEntries) + `,`, `SamplingRate:` + fmt.Sprintf("%v", this.SamplingRate) + `,`, `}`, diff --git a/policy/v1beta1/http_response.pb.go b/policy/v1beta1/http_response.pb.go index 66955ad3b5d..e245e0f2475 100644 --- a/policy/v1beta1/http_response.pb.go +++ b/policy/v1beta1/http_response.pb.go @@ -9,6 +9,7 @@ import ( github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" io "io" math "math" + math_bits "math/bits" reflect "reflect" strconv "strconv" strings "strings" @@ -239,7 +240,7 @@ func (m *DirectHttpResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_DirectHttpResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -434,7 +435,7 @@ func valueToGoStringHttpResponse(v interface{}, typ string) string { func (m *DirectHttpResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -442,49 +443,59 @@ func (m *DirectHttpResponse) Marshal() (dAtA []byte, err error) { } func (m *DirectHttpResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DirectHttpResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Code != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintHttpResponse(dAtA, i, uint64(m.Code)) - } - if len(m.Body) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintHttpResponse(dAtA, i, uint64(len(m.Body))) - i += copy(dAtA[i:], m.Body) - } if len(m.Headers) > 0 { - for k, _ := range m.Headers { - dAtA[i] = 0x1a - i++ + for k := range m.Headers { v := m.Headers[k] - mapSize := 1 + len(k) + sovHttpResponse(uint64(len(k))) + 1 + len(v) + sovHttpResponse(uint64(len(v))) - i = encodeVarintHttpResponse(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintHttpResponse(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintHttpResponse(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintHttpResponse(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintHttpResponse(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - return i, nil + if len(m.Body) > 0 { + i -= len(m.Body) + copy(dAtA[i:], m.Body) + i = encodeVarintHttpResponse(dAtA, i, uint64(len(m.Body))) + i-- + dAtA[i] = 0x12 + } + if m.Code != 0 { + i = encodeVarintHttpResponse(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func encodeVarintHttpResponse(dAtA []byte, offset int, v uint64) int { + offset -= sovHttpResponse(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *DirectHttpResponse) Size() (n int) { if m == nil { @@ -511,14 +522,7 @@ func (m *DirectHttpResponse) Size() (n int) { } func sovHttpResponse(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozHttpResponse(x uint64) (n int) { return sovHttpResponse(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/policy/v1beta1/type.pb.go b/policy/v1beta1/type.pb.go index 4cf671c0bd4..1a7ef95f9dc 100644 --- a/policy/v1beta1/type.pb.go +++ b/policy/v1beta1/type.pb.go @@ -14,6 +14,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -67,7 +68,7 @@ func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Value.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -476,7 +477,7 @@ func (m *IPAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_IPAddress.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -525,7 +526,7 @@ func (m *Duration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Duration.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -574,7 +575,7 @@ func (m *TimeStamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_TimeStamp.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -623,7 +624,7 @@ func (m *DNSName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DNSName.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -672,7 +673,7 @@ func (m *StringMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_StringMap.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -722,7 +723,7 @@ func (m *EmailAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_EmailAddress.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -772,7 +773,7 @@ func (m *Uri) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Uri.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1518,7 +1519,7 @@ func valueToGoStringType(v interface{}, typ string) string { func (m *Value) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1526,157 +1527,223 @@ func (m *Value) Marshal() (dAtA []byte, err error) { } func (m *Value) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Value != nil { - nn1, err := m.Value.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Value.Size() + i -= size + if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn1 } - return i, nil + return len(dAtA) - i, nil } func (m *Value_StringValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0xa - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Value_StringValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.StringValue) + copy(dAtA[i:], m.StringValue) i = encodeVarintType(dAtA, i, uint64(len(m.StringValue))) - i += copy(dAtA[i:], m.StringValue) - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *Value_Int64Value) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x10 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Value_Int64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintType(dAtA, i, uint64(m.Int64Value)) - return i, nil + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil } func (m *Value_DoubleValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x19 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Value_DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DoubleValue)))) - i += 8 - return i, nil + i-- + dAtA[i] = 0x19 + return len(dAtA) - i, nil } func (m *Value_BoolValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x20 - i++ + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Value_BoolValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i-- if m.BoolValue { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - return i, nil + i-- + dAtA[i] = 0x20 + return len(dAtA) - i, nil } func (m *Value_IpAddressValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Value_IpAddressValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.IpAddressValue != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintType(dAtA, i, uint64(m.IpAddressValue.Size())) - n2, err := m.IpAddressValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.IpAddressValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintType(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *Value_TimestampValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Value_TimestampValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.TimestampValue != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintType(dAtA, i, uint64(m.TimestampValue.Size())) - n3, err := m.TimestampValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.TimestampValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintType(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x32 } - return i, nil + return len(dAtA) - i, nil } func (m *Value_DurationValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Value_DurationValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.DurationValue != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintType(dAtA, i, uint64(m.DurationValue.Size())) - n4, err := m.DurationValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.DurationValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintType(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x3a } - return i, nil + return len(dAtA) - i, nil } func (m *Value_EmailAddressValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Value_EmailAddressValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.EmailAddressValue != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintType(dAtA, i, uint64(m.EmailAddressValue.Size())) - n5, err := m.EmailAddressValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.EmailAddressValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintType(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0x42 } - return i, nil + return len(dAtA) - i, nil } func (m *Value_DnsNameValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Value_DnsNameValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.DnsNameValue != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintType(dAtA, i, uint64(m.DnsNameValue.Size())) - n6, err := m.DnsNameValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.DnsNameValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintType(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x4a } - return i, nil + return len(dAtA) - i, nil } func (m *Value_UriValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Value_UriValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.UriValue != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintType(dAtA, i, uint64(m.UriValue.Size())) - n7, err := m.UriValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.UriValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintType(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x52 } - return i, nil + return len(dAtA) - i, nil } func (m *Value_StringMapValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *Value_StringMapValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.StringMapValue != nil { - dAtA[i] = 0x5a - i++ - i = encodeVarintType(dAtA, i, uint64(m.StringMapValue.Size())) - n8, err := m.StringMapValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.StringMapValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintType(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x5a } - return i, nil + return len(dAtA) - i, nil } func (m *IPAddress) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1684,23 +1751,29 @@ func (m *IPAddress) Marshal() (dAtA []byte, err error) { } func (m *IPAddress) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IPAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Value) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Value) + copy(dAtA[i:], m.Value) i = encodeVarintType(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Duration) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1708,27 +1781,34 @@ func (m *Duration) Marshal() (dAtA []byte, err error) { } func (m *Duration) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Duration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Value != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintType(dAtA, i, uint64(m.Value.Size())) - n9, err := m.Value.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintType(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *TimeStamp) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1736,27 +1816,34 @@ func (m *TimeStamp) Marshal() (dAtA []byte, err error) { } func (m *TimeStamp) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TimeStamp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Value != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintType(dAtA, i, uint64(m.Value.Size())) - n10, err := m.Value.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintType(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DNSName) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1764,23 +1851,29 @@ func (m *DNSName) Marshal() (dAtA []byte, err error) { } func (m *DNSName) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DNSName) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Value) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Value) + copy(dAtA[i:], m.Value) i = encodeVarintType(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *StringMap) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1788,34 +1881,41 @@ func (m *StringMap) Marshal() (dAtA []byte, err error) { } func (m *StringMap) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StringMap) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Value) > 0 { - for k, _ := range m.Value { - dAtA[i] = 0xa - i++ + for k := range m.Value { v := m.Value[k] - mapSize := 1 + len(k) + sovType(uint64(len(k))) + 1 + len(v) + sovType(uint64(len(v))) - i = encodeVarintType(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintType(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintType(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintType(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintType(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *EmailAddress) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1823,23 +1923,29 @@ func (m *EmailAddress) Marshal() (dAtA []byte, err error) { } func (m *EmailAddress) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EmailAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Value) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Value) + copy(dAtA[i:], m.Value) i = encodeVarintType(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Uri) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1847,27 +1953,35 @@ func (m *Uri) Marshal() (dAtA []byte, err error) { } func (m *Uri) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Uri) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Value) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Value) + copy(dAtA[i:], m.Value) i = encodeVarintType(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintType(dAtA []byte, offset int, v uint64) int { + offset -= sovType(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Value) Size() (n int) { if m == nil { @@ -2098,14 +2212,7 @@ func (m *Uri) Size() (n int) { } func sovType(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozType(x uint64) (n int) { return sovType(uint64((x << 1) ^ uint64((int64(x) >> 63)))) diff --git a/rbac/v1alpha1/rbac.pb.go b/rbac/v1alpha1/rbac.pb.go index a793eedd6a0..22ff59ba1ba 100644 --- a/rbac/v1alpha1/rbac.pb.go +++ b/rbac/v1alpha1/rbac.pb.go @@ -73,6 +73,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -194,7 +195,7 @@ func (m *WorkloadSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_WorkloadSelector.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -252,7 +253,7 @@ func (m *AuthorizationPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_AuthorizationPolicy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -308,7 +309,7 @@ func (m *ServiceRole) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_ServiceRole.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -405,7 +406,7 @@ func (m *AccessRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_AccessRule.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -522,7 +523,7 @@ func (m *AccessRule_Constraint) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_AccessRule_Constraint.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -621,7 +622,7 @@ func (m *ServiceRoleBinding) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ServiceRoleBinding.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -734,7 +735,7 @@ func (m *Subject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Subject.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -858,7 +859,7 @@ func (m *RoleRef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RoleRef.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -944,7 +945,7 @@ func (m *RbacConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RbacConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1019,7 +1020,7 @@ func (m *RbacConfig_Target) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_RbacConfig_Target.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1143,7 +1144,7 @@ var fileDescriptor_3462954d26c055c0 = []byte{ func (m *WorkloadSelector) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1151,37 +1152,45 @@ func (m *WorkloadSelector) Marshal() (dAtA []byte, err error) { } func (m *WorkloadSelector) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0xa - i++ + for k := range m.Labels { v := m.Labels[k] - mapSize := 1 + len(k) + sovRbac(uint64(len(k))) + 1 + len(v) + sovRbac(uint64(len(v))) - i = encodeVarintRbac(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintRbac(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintRbac(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintRbac(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintRbac(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *AuthorizationPolicy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1189,42 +1198,52 @@ func (m *AuthorizationPolicy) Marshal() (dAtA []byte, err error) { } func (m *AuthorizationPolicy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthorizationPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.WorkloadSelector != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRbac(dAtA, i, uint64(m.WorkloadSelector.Size())) - n1, err := m.WorkloadSelector.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Allow) > 0 { - for _, msg := range m.Allow { + for iNdEx := len(m.Allow) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Allow[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRbac(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintRbac(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.WorkloadSelector != nil { + { + size, err := m.WorkloadSelector.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintRbac(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *ServiceRole) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1232,32 +1251,40 @@ func (m *ServiceRole) Marshal() (dAtA []byte, err error) { } func (m *ServiceRole) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceRole) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Rules) > 0 { - for _, msg := range m.Rules { - dAtA[i] = 0xa - i++ - i = encodeVarintRbac(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRbac(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *AccessRule) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1265,131 +1292,23 @@ func (m *AccessRule) Marshal() (dAtA []byte, err error) { } func (m *AccessRule) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AccessRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Services) > 0 { - for _, s := range m.Services { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.Paths) > 0 { - for _, s := range m.Paths { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.Methods) > 0 { - for _, s := range m.Methods { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.Constraints) > 0 { - for _, msg := range m.Constraints { - dAtA[i] = 0x22 - i++ - i = encodeVarintRbac(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Hosts) > 0 { - for _, s := range m.Hosts { - dAtA[i] = 0x2a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.NotHosts) > 0 { - for _, s := range m.NotHosts { - dAtA[i] = 0x32 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.NotPaths) > 0 { - for _, s := range m.NotPaths { - dAtA[i] = 0x3a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.NotMethods) > 0 { - for _, s := range m.NotMethods { - dAtA[i] = 0x42 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Ports) > 0 { - dAtA3 := make([]byte, len(m.Ports)*10) + if len(m.NotPorts) > 0 { + dAtA3 := make([]byte, len(m.NotPorts)*10) var j2 int - for _, num1 := range m.Ports { + for _, num1 := range m.NotPorts { num := uint64(num1) for num >= 1<<7 { dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) @@ -1399,15 +1318,16 @@ func (m *AccessRule) MarshalTo(dAtA []byte) (int, error) { dAtA3[j2] = uint8(num) j2++ } - dAtA[i] = 0x4a - i++ + i -= j2 + copy(dAtA[i:], dAtA3[:j2]) i = encodeVarintRbac(dAtA, i, uint64(j2)) - i += copy(dAtA[i:], dAtA3[:j2]) + i-- + dAtA[i] = 0x52 } - if len(m.NotPorts) > 0 { - dAtA5 := make([]byte, len(m.NotPorts)*10) + if len(m.Ports) > 0 { + dAtA5 := make([]byte, len(m.Ports)*10) var j4 int - for _, num1 := range m.NotPorts { + for _, num1 := range m.Ports { num := uint64(num1) for num >= 1<<7 { dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) @@ -1417,21 +1337,96 @@ func (m *AccessRule) MarshalTo(dAtA []byte) (int, error) { dAtA5[j4] = uint8(num) j4++ } - dAtA[i] = 0x52 - i++ + i -= j4 + copy(dAtA[i:], dAtA5[:j4]) i = encodeVarintRbac(dAtA, i, uint64(j4)) - i += copy(dAtA[i:], dAtA5[:j4]) + i-- + dAtA[i] = 0x4a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.NotMethods) > 0 { + for iNdEx := len(m.NotMethods) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NotMethods[iNdEx]) + copy(dAtA[i:], m.NotMethods[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.NotMethods[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(m.NotPaths) > 0 { + for iNdEx := len(m.NotPaths) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NotPaths[iNdEx]) + copy(dAtA[i:], m.NotPaths[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.NotPaths[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(m.NotHosts) > 0 { + for iNdEx := len(m.NotHosts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NotHosts[iNdEx]) + copy(dAtA[i:], m.NotHosts[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.NotHosts[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Hosts) > 0 { + for iNdEx := len(m.Hosts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Hosts[iNdEx]) + copy(dAtA[i:], m.Hosts[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.Hosts[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.Constraints) > 0 { + for iNdEx := len(m.Constraints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Constraints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRbac(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Methods) > 0 { + for iNdEx := len(m.Methods) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Methods[iNdEx]) + copy(dAtA[i:], m.Methods[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.Methods[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Paths) > 0 { + for iNdEx := len(m.Paths) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Paths[iNdEx]) + copy(dAtA[i:], m.Paths[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.Paths[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Services) > 0 { + for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Services[iNdEx]) + copy(dAtA[i:], m.Services[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.Services[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *AccessRule_Constraint) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1439,41 +1434,42 @@ func (m *AccessRule_Constraint) Marshal() (dAtA []byte, err error) { } func (m *AccessRule_Constraint) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AccessRule_Constraint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRbac(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Values) > 0 { - for _, s := range m.Values { + for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Values[iNdEx]) + copy(dAtA[i:], m.Values[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.Values[iNdEx]))) + i-- dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintRbac(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ServiceRoleBinding) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1481,65 +1477,78 @@ func (m *ServiceRoleBinding) Marshal() (dAtA []byte, err error) { } func (m *ServiceRoleBinding) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceRoleBinding) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Subjects) > 0 { - for _, msg := range m.Subjects { - dAtA[i] = 0xa - i++ - i = encodeVarintRbac(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.RoleRef != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRbac(dAtA, i, uint64(m.RoleRef.Size())) - n6, err := m.RoleRef.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Role) > 0 { + i -= len(m.Role) + copy(dAtA[i:], m.Role) + i = encodeVarintRbac(dAtA, i, uint64(len(m.Role))) + i-- + dAtA[i] = 0x2a + } + if len(m.Actions) > 0 { + for iNdEx := len(m.Actions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Actions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRbac(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - i += n6 } if m.Mode != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintRbac(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x18 } - if len(m.Actions) > 0 { - for _, msg := range m.Actions { - dAtA[i] = 0x22 - i++ - i = encodeVarintRbac(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.RoleRef != nil { + { + size, err := m.RoleRef.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintRbac(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - if len(m.Role) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintRbac(dAtA, i, uint64(len(m.Role))) - i += copy(dAtA[i:], m.Role) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Subjects) > 0 { + for iNdEx := len(m.Subjects) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Subjects[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRbac(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *Subject) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1547,169 +1556,131 @@ func (m *Subject) Marshal() (dAtA []byte, err error) { } func (m *Subject) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Subject) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.User) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRbac(dAtA, i, uint64(len(m.User))) - i += copy(dAtA[i:], m.User) - } - if len(m.Group) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRbac(dAtA, i, uint64(len(m.Group))) - i += copy(dAtA[i:], m.Group) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Properties) > 0 { - for k, _ := range m.Properties { - dAtA[i] = 0x1a - i++ - v := m.Properties[k] - mapSize := 1 + len(k) + sovRbac(uint64(len(k))) + 1 + len(v) + sovRbac(uint64(len(v))) - i = encodeVarintRbac(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintRbac(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintRbac(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + if len(m.NotIps) > 0 { + for iNdEx := len(m.NotIps) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NotIps[iNdEx]) + copy(dAtA[i:], m.NotIps[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.NotIps[iNdEx]))) + i-- + dAtA[i] = 0x5a } } - if len(m.Names) > 0 { - for _, s := range m.Names { - dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.Ips) > 0 { + for iNdEx := len(m.Ips) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Ips[iNdEx]) + copy(dAtA[i:], m.Ips[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.Ips[iNdEx]))) + i-- + dAtA[i] = 0x52 } } - if len(m.NotNames) > 0 { - for _, s := range m.NotNames { - dAtA[i] = 0x2a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.NotNamespaces) > 0 { + for iNdEx := len(m.NotNamespaces) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NotNamespaces[iNdEx]) + copy(dAtA[i:], m.NotNamespaces[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.NotNamespaces[iNdEx]))) + i-- + dAtA[i] = 0x4a } } - if len(m.Groups) > 0 { - for _, s := range m.Groups { - dAtA[i] = 0x32 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.Namespaces) > 0 { + for iNdEx := len(m.Namespaces) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Namespaces[iNdEx]) + copy(dAtA[i:], m.Namespaces[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.Namespaces[iNdEx]))) + i-- + dAtA[i] = 0x42 } } if len(m.NotGroups) > 0 { - for _, s := range m.NotGroups { + for iNdEx := len(m.NotGroups) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NotGroups[iNdEx]) + copy(dAtA[i:], m.NotGroups[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.NotGroups[iNdEx]))) + i-- dAtA[i] = 0x3a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if len(m.Namespaces) > 0 { - for _, s := range m.Namespaces { - dAtA[i] = 0x42 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.Groups) > 0 { + for iNdEx := len(m.Groups) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Groups[iNdEx]) + copy(dAtA[i:], m.Groups[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.Groups[iNdEx]))) + i-- + dAtA[i] = 0x32 } } - if len(m.NotNamespaces) > 0 { - for _, s := range m.NotNamespaces { - dAtA[i] = 0x4a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.NotNames) > 0 { + for iNdEx := len(m.NotNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NotNames[iNdEx]) + copy(dAtA[i:], m.NotNames[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.NotNames[iNdEx]))) + i-- + dAtA[i] = 0x2a } } - if len(m.Ips) > 0 { - for _, s := range m.Ips { - dAtA[i] = 0x52 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0x22 } } - if len(m.NotIps) > 0 { - for _, s := range m.NotIps { - dAtA[i] = 0x5a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.Properties) > 0 { + for k := range m.Properties { + v := m.Properties[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintRbac(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintRbac(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintRbac(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Group) > 0 { + i -= len(m.Group) + copy(dAtA[i:], m.Group) + i = encodeVarintRbac(dAtA, i, uint64(len(m.Group))) + i-- + dAtA[i] = 0x12 + } + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintRbac(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RoleRef) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1717,32 +1688,40 @@ func (m *RoleRef) Marshal() (dAtA []byte, err error) { } func (m *RoleRef) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RoleRef) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Kind) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRbac(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Name) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintRbac(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintRbac(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RbacConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1750,50 +1729,60 @@ func (m *RbacConfig) Marshal() (dAtA []byte, err error) { } func (m *RbacConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RbacConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Mode != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRbac(dAtA, i, uint64(m.Mode)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Inclusion != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRbac(dAtA, i, uint64(m.Inclusion.Size())) - n7, err := m.Inclusion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 + if m.EnforcementMode != 0 { + i = encodeVarintRbac(dAtA, i, uint64(m.EnforcementMode)) + i-- + dAtA[i] = 0x20 } if m.Exclusion != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintRbac(dAtA, i, uint64(m.Exclusion.Size())) - n8, err := m.Exclusion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Exclusion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRbac(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x1a } - if m.EnforcementMode != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintRbac(dAtA, i, uint64(m.EnforcementMode)) + if m.Inclusion != nil { + { + size, err := m.Inclusion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRbac(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Mode != 0 { + i = encodeVarintRbac(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *RbacConfig_Target) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1801,66 +1790,64 @@ func (m *RbacConfig_Target) Marshal() (dAtA []byte, err error) { } func (m *RbacConfig_Target) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RbacConfig_Target) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Services) > 0 { - for _, s := range m.Services { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.WorkloadSelectors) > 0 { + for iNdEx := len(m.WorkloadSelectors) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.WorkloadSelectors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRbac(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } } if len(m.Namespaces) > 0 { - for _, s := range m.Namespaces { + for iNdEx := len(m.Namespaces) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Namespaces[iNdEx]) + copy(dAtA[i:], m.Namespaces[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.Namespaces[iNdEx]))) + i-- dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if len(m.WorkloadSelectors) > 0 { - for _, msg := range m.WorkloadSelectors { - dAtA[i] = 0x1a - i++ - i = encodeVarintRbac(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + if len(m.Services) > 0 { + for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Services[iNdEx]) + copy(dAtA[i:], m.Services[iNdEx]) + i = encodeVarintRbac(dAtA, i, uint64(len(m.Services[iNdEx]))) + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintRbac(dAtA []byte, offset int, v uint64) int { + offset -= sovRbac(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *WorkloadSelector) Size() (n int) { if m == nil { @@ -2206,14 +2193,7 @@ func (m *RbacConfig_Target) Size() (n int) { } func sovRbac(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozRbac(x uint64) (n int) { return sovRbac(uint64((x << 1) ^ uint64((int64(x) >> 63))))