Merge pull request #8385 from hashicorp/dnephin/check-generated

ci: Add check-generated-protobuf
This commit is contained in:
Daniel Nephin 2020-08-05 12:10:27 -04:00 committed by hashicorp-ci
parent 622495fd28
commit e5f5588d9d
9 changed files with 1044 additions and 871 deletions

View File

@ -85,6 +85,36 @@ jobs:
exit 1 exit 1
fi fi
check-generated-protobuf:
docker:
- image: *GOLANG_IMAGE
environment:
<<: *ENVIRONMENT
steps:
- checkout
- run:
name: Install protobuf
command: |
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.12.3/protoc-3.12.3-linux-x86_64.zip
sudo unzip -d /usr/local protoc-*.zip
sudo chmod +x /usr/local/bin/protoc
rm protoc-*.zip
- run:
name: Install gogo/protobuf
command: |
gogo_version=$(go list -m github.com/gogo/protobuf | awk '{print $2}')
mkdir -p .gotools; cd .gotools; go mod init consul-tools
go get -v github.com/hashicorp/protoc-gen-go-binary
go get -v github.com/gogo/protobuf/protoc-gen-gofast@${gogo_version}
- run:
command: make --always-make proto
- run: |
if ! git diff --exit-code; then
echo "Generated code was not updated correctly"
exit 1
fi
go-test: go-test:
docker: docker:
- image: *GOLANG_IMAGE - image: *GOLANG_IMAGE
@ -629,6 +659,7 @@ workflows:
- stable-website - stable-website
- /^docs\/.*/ - /^docs\/.*/
- /^ui\/.*/ - /^ui\/.*/
- check-generated-protobuf: *filter-ignore-non-go-branches
- lint-consul-retry: *filter-ignore-non-go-branches - lint-consul-retry: *filter-ignore-non-go-branches
- lint: *filter-ignore-non-go-branches - lint: *filter-ignore-non-go-branches
- test-connect-ca-providers: *filter-ignore-non-go-branches - test-connect-ca-providers: *filter-ignore-non-go-branches

View File

@ -363,14 +363,6 @@ else
@go test -v ./agent/connect/ca @go test -v ./agent/connect/ca
endif endif
proto-delete:
@echo "Removing $(PROTOGOFILES)"
-@rm $(PROTOGOFILES)
@echo "Removing $(PROTOGOBINFILES)"
-@rm $(PROTOGOBINFILES)
proto-rebuild: proto-delete proto
proto: $(PROTOGOFILES) $(PROTOGOBINFILES) proto: $(PROTOGOFILES) $(PROTOGOBINFILES)
@echo "Generated all protobuf Go files" @echo "Generated all protobuf Go files"
@ -381,4 +373,4 @@ proto: $(PROTOGOFILES) $(PROTOGOBINFILES)
.PHONY: all ci bin dev dist cov test test-flake test-internal cover lint ui static-assets tools .PHONY: all ci bin dev dist cov test test-flake test-internal cover lint ui static-assets tools
.PHONY: docker-images go-build-image ui-build-image static-assets-docker consul-docker ui-docker .PHONY: docker-images go-build-image ui-build-image static-assets-docker consul-docker ui-docker
.PHONY: version proto proto-rebuild proto-delete test-envoy-integ .PHONY: version proto test-envoy-integ

View File

@ -116,7 +116,7 @@ function main {
return 1 return 1
fi fi
BUILD_TAGS=$(sed -e '/^[:space:]*$/,$d' < "${proto_path}" | grep '// +build') BUILD_TAGS=$(sed -e '/^[[:space:]]*$/,$d' < "${proto_path}" | grep '// +build')
if test -n "${BUILD_TAGS}" if test -n "${BUILD_TAGS}"
then then
echo -e "${BUILD_TAGS}\n" >> "${proto_go_path}.new" echo -e "${BUILD_TAGS}\n" >> "${proto_go_path}.new"

View File

@ -9,6 +9,7 @@ import (
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -41,7 +42,7 @@ func (m *ACLLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ACLLink.Marshal(b, m, deterministic) return xxx_messageInfo_ACLLink.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -86,7 +87,7 @@ var fileDescriptor_ad2d2c73a6a0d8b5 = []byte{
func (m *ACLLink) Marshal() (dAtA []byte, err error) { func (m *ACLLink) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -94,33 +95,42 @@ func (m *ACLLink) Marshal() (dAtA []byte, err error) {
} }
func (m *ACLLink) MarshalTo(dAtA []byte) (int, error) { func (m *ACLLink) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ACLLink) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ID) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintAcl(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
}
if len(m.Name) > 0 { if len(m.Name) > 0 {
dAtA[i] = 0x12 i -= len(m.Name)
i++ copy(dAtA[i:], m.Name)
i = encodeVarintAcl(dAtA, i, uint64(len(m.Name))) i = encodeVarintAcl(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name) i--
dAtA[i] = 0x12
} }
return i, nil if len(m.ID) > 0 {
i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintAcl(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintAcl(dAtA []byte, offset int, v uint64) int { func encodeVarintAcl(dAtA []byte, offset int, v uint64) int {
offset -= sovAcl(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *ACLLink) Size() (n int) { func (m *ACLLink) Size() (n int) {
if m == nil { if m == nil {
@ -140,14 +150,7 @@ func (m *ACLLink) Size() (n int) {
} }
func sovAcl(x uint64) (n int) { func sovAcl(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozAcl(x uint64) (n int) { func sozAcl(x uint64) (n int) {
return sovAcl(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovAcl(uint64((x << 1) ^ uint64((int64(x) >> 63))))

View File

@ -10,6 +10,7 @@ import (
pbconnect "github.com/hashicorp/consul/proto/pbconnect" pbconnect "github.com/hashicorp/consul/proto/pbconnect"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -63,7 +64,7 @@ func (m *AutoConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e
return xxx_messageInfo_AutoConfigRequest.Marshal(b, m, deterministic) return xxx_messageInfo_AutoConfigRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -154,7 +155,7 @@ func (m *AutoConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return xxx_messageInfo_AutoConfigResponse.Marshal(b, m, deterministic) return xxx_messageInfo_AutoConfigResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -239,7 +240,7 @@ var fileDescriptor_ccc5af992e5daf69 = []byte{
func (m *AutoConfigRequest) Marshal() (dAtA []byte, err error) { func (m *AutoConfigRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -247,56 +248,68 @@ func (m *AutoConfigRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *AutoConfigRequest) MarshalTo(dAtA []byte) (int, error) { func (m *AutoConfigRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *AutoConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Datacenter) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.Datacenter)))
i += copy(dAtA[i:], m.Datacenter)
}
if len(m.Node) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.Node)))
i += copy(dAtA[i:], m.Node)
}
if len(m.Segment) > 0 {
dAtA[i] = 0x22
i++
i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.Segment)))
i += copy(dAtA[i:], m.Segment)
}
if len(m.JWT) > 0 {
dAtA[i] = 0x2a
i++
i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.JWT)))
i += copy(dAtA[i:], m.JWT)
}
if len(m.ConsulToken) > 0 {
dAtA[i] = 0x32
i++
i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.ConsulToken)))
i += copy(dAtA[i:], m.ConsulToken)
} }
if len(m.CSR) > 0 { if len(m.CSR) > 0 {
dAtA[i] = 0x3a i -= len(m.CSR)
i++ copy(dAtA[i:], m.CSR)
i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.CSR))) i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.CSR)))
i += copy(dAtA[i:], m.CSR) i--
dAtA[i] = 0x3a
} }
if m.XXX_unrecognized != nil { if len(m.ConsulToken) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.ConsulToken)
copy(dAtA[i:], m.ConsulToken)
i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.ConsulToken)))
i--
dAtA[i] = 0x32
} }
return i, nil if len(m.JWT) > 0 {
i -= len(m.JWT)
copy(dAtA[i:], m.JWT)
i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.JWT)))
i--
dAtA[i] = 0x2a
}
if len(m.Segment) > 0 {
i -= len(m.Segment)
copy(dAtA[i:], m.Segment)
i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.Segment)))
i--
dAtA[i] = 0x22
}
if len(m.Node) > 0 {
i -= len(m.Node)
copy(dAtA[i:], m.Node)
i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.Node)))
i--
dAtA[i] = 0x12
}
if len(m.Datacenter) > 0 {
i -= len(m.Datacenter)
copy(dAtA[i:], m.Datacenter)
i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.Datacenter)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *AutoConfigResponse) Marshal() (dAtA []byte, err error) { func (m *AutoConfigResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -304,69 +317,77 @@ func (m *AutoConfigResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *AutoConfigResponse) MarshalTo(dAtA []byte) (int, error) { func (m *AutoConfigResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *AutoConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.Config != nil { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintAutoConfig(dAtA, i, uint64(m.Config.Size()))
n1, err := m.Config.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
}
if m.CARoots != nil {
dAtA[i] = 0x12
i++
i = encodeVarintAutoConfig(dAtA, i, uint64(m.CARoots.Size()))
n2, err := m.CARoots.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n2
}
if m.Certificate != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintAutoConfig(dAtA, i, uint64(m.Certificate.Size()))
n3, err := m.Certificate.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n3
} }
if len(m.ExtraCACertificates) > 0 { if len(m.ExtraCACertificates) > 0 {
for _, s := range m.ExtraCACertificates { for iNdEx := len(m.ExtraCACertificates) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.ExtraCACertificates[iNdEx])
copy(dAtA[i:], m.ExtraCACertificates[iNdEx])
i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.ExtraCACertificates[iNdEx])))
i--
dAtA[i] = 0x22 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.XXX_unrecognized != nil { if m.Certificate != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) {
size, err := m.Certificate.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
} }
return i, nil i -= size
i = encodeVarintAutoConfig(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
}
if m.CARoots != nil {
{
size, err := m.CARoots.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintAutoConfig(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
}
if m.Config != nil {
{
size, err := m.Config.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintAutoConfig(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintAutoConfig(dAtA []byte, offset int, v uint64) int { func encodeVarintAutoConfig(dAtA []byte, offset int, v uint64) int {
offset -= sovAutoConfig(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *AutoConfigRequest) Size() (n int) { func (m *AutoConfigRequest) Size() (n int) {
if m == nil { if m == nil {
@ -435,14 +456,7 @@ func (m *AutoConfigResponse) Size() (n int) {
} }
func sovAutoConfig(x uint64) (n int) { func sovAutoConfig(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozAutoConfig(x uint64) (n int) { func sozAutoConfig(x uint64) (n int) {
return sovAutoConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovAutoConfig(uint64((x << 1) ^ uint64((int64(x) >> 63))))

View File

@ -11,6 +11,7 @@ import (
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
time "time" time "time"
) )
@ -47,7 +48,7 @@ func (m *RaftIndex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RaftIndex.Marshal(b, m, deterministic) return xxx_messageInfo_RaftIndex.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -86,7 +87,7 @@ func (m *TargetDatacenter) XXX_Marshal(b []byte, deterministic bool) ([]byte, er
return xxx_messageInfo_TargetDatacenter.Marshal(b, m, deterministic) return xxx_messageInfo_TargetDatacenter.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -125,7 +126,7 @@ func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return xxx_messageInfo_WriteRequest.Marshal(b, m, deterministic) return xxx_messageInfo_WriteRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -218,7 +219,7 @@ func (m *QueryOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return xxx_messageInfo_QueryOptions.Marshal(b, m, deterministic) return xxx_messageInfo_QueryOptions.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -345,7 +346,7 @@ func (m *QueryMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QueryMeta.Marshal(b, m, deterministic) return xxx_messageInfo_QueryMeta.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -445,7 +446,7 @@ var fileDescriptor_a6f5ac44994d718c = []byte{
func (m *RaftIndex) Marshal() (dAtA []byte, err error) { func (m *RaftIndex) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -453,27 +454,32 @@ func (m *RaftIndex) Marshal() (dAtA []byte, err error) {
} }
func (m *RaftIndex) MarshalTo(dAtA []byte) (int, error) { func (m *RaftIndex) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *RaftIndex) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.CreateIndex != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintCommon(dAtA, i, uint64(m.CreateIndex))
}
if m.ModifyIndex != 0 { if m.ModifyIndex != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintCommon(dAtA, i, uint64(m.ModifyIndex)) i = encodeVarintCommon(dAtA, i, uint64(m.ModifyIndex))
i--
dAtA[i] = 0x10
} }
return i, nil if m.CreateIndex != 0 {
i = encodeVarintCommon(dAtA, i, uint64(m.CreateIndex))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
} }
func (m *TargetDatacenter) Marshal() (dAtA []byte, err error) { func (m *TargetDatacenter) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -481,23 +487,29 @@ func (m *TargetDatacenter) Marshal() (dAtA []byte, err error) {
} }
func (m *TargetDatacenter) MarshalTo(dAtA []byte) (int, error) { func (m *TargetDatacenter) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TargetDatacenter) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Datacenter) > 0 { if len(m.Datacenter) > 0 {
dAtA[i] = 0xa i -= len(m.Datacenter)
i++ copy(dAtA[i:], m.Datacenter)
i = encodeVarintCommon(dAtA, i, uint64(len(m.Datacenter))) i = encodeVarintCommon(dAtA, i, uint64(len(m.Datacenter)))
i += copy(dAtA[i:], m.Datacenter) i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *WriteRequest) Marshal() (dAtA []byte, err error) { func (m *WriteRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -505,23 +517,29 @@ func (m *WriteRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *WriteRequest) MarshalTo(dAtA []byte) (int, error) { func (m *WriteRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *WriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Token) > 0 { if len(m.Token) > 0 {
dAtA[i] = 0xa i -= len(m.Token)
i++ copy(dAtA[i:], m.Token)
i = encodeVarintCommon(dAtA, i, uint64(len(m.Token))) i = encodeVarintCommon(dAtA, i, uint64(len(m.Token)))
i += copy(dAtA[i:], m.Token) i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *QueryOptions) Marshal() (dAtA []byte, err error) { func (m *QueryOptions) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -529,106 +547,113 @@ func (m *QueryOptions) Marshal() (dAtA []byte, err error) {
} }
func (m *QueryOptions) MarshalTo(dAtA []byte) (int, error) { func (m *QueryOptions) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *QueryOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Token) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintCommon(dAtA, i, uint64(len(m.Token)))
i += copy(dAtA[i:], m.Token)
}
if m.MinQueryIndex != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintCommon(dAtA, i, uint64(m.MinQueryIndex))
}
dAtA[i] = 0x1a
i++
i = encodeVarintCommon(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxQueryTime)))
n1, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxQueryTime, dAtA[i:])
if err != nil {
return 0, err
}
i += n1
if m.AllowStale {
dAtA[i] = 0x20
i++
if m.AllowStale {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if m.RequireConsistent {
dAtA[i] = 0x28
i++
if m.RequireConsistent {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if m.UseCache {
dAtA[i] = 0x30
i++
if m.UseCache {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
dAtA[i] = 0x3a
i++
i = encodeVarintCommon(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxStaleDuration)))
n2, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxStaleDuration, dAtA[i:])
if err != nil {
return 0, err
}
i += n2
dAtA[i] = 0x42
i++
i = encodeVarintCommon(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxAge)))
n3, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxAge, dAtA[i:])
if err != nil {
return 0, err
}
i += n3
if m.MustRevalidate {
dAtA[i] = 0x48
i++
if m.MustRevalidate {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
dAtA[i] = 0x52
i++
i = encodeVarintCommon(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.StaleIfError)))
n4, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.StaleIfError, dAtA[i:])
if err != nil {
return 0, err
}
i += n4
if len(m.Filter) > 0 { if len(m.Filter) > 0 {
dAtA[i] = 0x5a i -= len(m.Filter)
i++ copy(dAtA[i:], m.Filter)
i = encodeVarintCommon(dAtA, i, uint64(len(m.Filter))) i = encodeVarintCommon(dAtA, i, uint64(len(m.Filter)))
i += copy(dAtA[i:], m.Filter) i--
dAtA[i] = 0x5a
} }
return i, nil n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.StaleIfError, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.StaleIfError):])
if err1 != nil {
return 0, err1
}
i -= n1
i = encodeVarintCommon(dAtA, i, uint64(n1))
i--
dAtA[i] = 0x52
if m.MustRevalidate {
i--
if m.MustRevalidate {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x48
}
n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxAge, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxAge):])
if err2 != nil {
return 0, err2
}
i -= n2
i = encodeVarintCommon(dAtA, i, uint64(n2))
i--
dAtA[i] = 0x42
n3, err3 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxStaleDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxStaleDuration):])
if err3 != nil {
return 0, err3
}
i -= n3
i = encodeVarintCommon(dAtA, i, uint64(n3))
i--
dAtA[i] = 0x3a
if m.UseCache {
i--
if m.UseCache {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x30
}
if m.RequireConsistent {
i--
if m.RequireConsistent {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x28
}
if m.AllowStale {
i--
if m.AllowStale {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x20
}
n4, err4 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxQueryTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxQueryTime):])
if err4 != nil {
return 0, err4
}
i -= n4
i = encodeVarintCommon(dAtA, i, uint64(n4))
i--
dAtA[i] = 0x1a
if m.MinQueryIndex != 0 {
i = encodeVarintCommon(dAtA, i, uint64(m.MinQueryIndex))
i--
dAtA[i] = 0x10
}
if len(m.Token) > 0 {
i -= len(m.Token)
copy(dAtA[i:], m.Token)
i = encodeVarintCommon(dAtA, i, uint64(len(m.Token)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *QueryMeta) Marshal() (dAtA []byte, err error) { func (m *QueryMeta) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -636,50 +661,58 @@ func (m *QueryMeta) Marshal() (dAtA []byte, err error) {
} }
func (m *QueryMeta) MarshalTo(dAtA []byte) (int, error) { func (m *QueryMeta) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *QueryMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.Index != 0 { if len(m.ConsistencyLevel) > 0 {
dAtA[i] = 0x8 i -= len(m.ConsistencyLevel)
i++ copy(dAtA[i:], m.ConsistencyLevel)
i = encodeVarintCommon(dAtA, i, uint64(m.Index)) i = encodeVarintCommon(dAtA, i, uint64(len(m.ConsistencyLevel)))
i--
dAtA[i] = 0x22
} }
dAtA[i] = 0x12
i++
i = encodeVarintCommon(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.LastContact)))
n5, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.LastContact, dAtA[i:])
if err != nil {
return 0, err
}
i += n5
if m.KnownLeader { if m.KnownLeader {
dAtA[i] = 0x18 i--
i++
if m.KnownLeader { if m.KnownLeader {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x18
} }
if len(m.ConsistencyLevel) > 0 { n5, err5 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.LastContact, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.LastContact):])
dAtA[i] = 0x22 if err5 != nil {
i++ return 0, err5
i = encodeVarintCommon(dAtA, i, uint64(len(m.ConsistencyLevel)))
i += copy(dAtA[i:], m.ConsistencyLevel)
} }
return i, nil i -= n5
i = encodeVarintCommon(dAtA, i, uint64(n5))
i--
dAtA[i] = 0x12
if m.Index != 0 {
i = encodeVarintCommon(dAtA, i, uint64(m.Index))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
} }
func encodeVarintCommon(dAtA []byte, offset int, v uint64) int { func encodeVarintCommon(dAtA []byte, offset int, v uint64) int {
offset -= sovCommon(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *RaftIndex) Size() (n int) { func (m *RaftIndex) Size() (n int) {
if m == nil { if m == nil {
@ -784,14 +817,7 @@ func (m *QueryMeta) Size() (n int) {
} }
func sovCommon(x uint64) (n int) { func sovCommon(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozCommon(x uint64) (n int) { func sozCommon(x uint64) (n int) {
return sovCommon(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovCommon(uint64((x << 1) ^ uint64((int64(x) >> 63))))

View File

@ -10,6 +10,7 @@ import (
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -43,7 +44,7 @@ func (m *EnterpriseMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro
return xxx_messageInfo_EnterpriseMeta.Marshal(b, m, deterministic) return xxx_messageInfo_EnterpriseMeta.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -83,7 +84,7 @@ var fileDescriptor_8f9d7cd54dd4e173 = []byte{
func (m *EnterpriseMeta) Marshal() (dAtA []byte, err error) { func (m *EnterpriseMeta) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -91,24 +92,32 @@ func (m *EnterpriseMeta) Marshal() (dAtA []byte, err error) {
} }
func (m *EnterpriseMeta) MarshalTo(dAtA []byte) (int, error) { func (m *EnterpriseMeta) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *EnterpriseMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil return len(dAtA) - i, nil
} }
func encodeVarintCommonOss(dAtA []byte, offset int, v uint64) int { func encodeVarintCommonOss(dAtA []byte, offset int, v uint64) int {
offset -= sovCommonOss(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *EnterpriseMeta) Size() (n int) { func (m *EnterpriseMeta) Size() (n int) {
if m == nil { if m == nil {
@ -123,14 +132,7 @@ func (m *EnterpriseMeta) Size() (n int) {
} }
func sovCommonOss(x uint64) (n int) { func sovCommonOss(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozCommonOss(x uint64) (n int) { func sozCommonOss(x uint64) (n int) {
return sovCommonOss(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovCommonOss(uint64((x << 1) ^ uint64((int64(x) >> 63))))

View File

@ -8,6 +8,7 @@ import (
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -49,7 +50,7 @@ func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Config.Marshal(b, m, deterministic) return xxx_messageInfo_Config.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -146,7 +147,7 @@ func (m *Gossip) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Gossip.Marshal(b, m, deterministic) return xxx_messageInfo_Gossip.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -202,7 +203,7 @@ func (m *GossipEncryption) XXX_Marshal(b []byte, deterministic bool) ([]byte, er
return xxx_messageInfo_GossipEncryption.Marshal(b, m, deterministic) return xxx_messageInfo_GossipEncryption.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -267,7 +268,7 @@ func (m *TLS) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TLS.Marshal(b, m, deterministic) return xxx_messageInfo_TLS.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -352,7 +353,7 @@ func (m *ACL) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ACL.Marshal(b, m, deterministic) return xxx_messageInfo_ACL.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -474,7 +475,7 @@ func (m *ACLTokens) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ACLTokens.Marshal(b, m, deterministic) return xxx_messageInfo_ACLTokens.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -557,7 +558,7 @@ func (m *ACLServiceProviderToken) XXX_Marshal(b []byte, deterministic bool) ([]b
return xxx_messageInfo_ACLServiceProviderToken.Marshal(b, m, deterministic) return xxx_messageInfo_ACLServiceProviderToken.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -614,7 +615,7 @@ func (m *AutoEncrypt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return xxx_messageInfo_AutoEncrypt.Marshal(b, m, deterministic) return xxx_messageInfo_AutoEncrypt.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -731,7 +732,7 @@ var fileDescriptor_aefa824db7b74d77 = []byte{
func (m *Config) Marshal() (dAtA []byte, err error) { func (m *Config) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -739,84 +740,102 @@ func (m *Config) Marshal() (dAtA []byte, err error) {
} }
func (m *Config) MarshalTo(dAtA []byte) (int, error) { func (m *Config) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Config) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Datacenter) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintConfig(dAtA, i, uint64(len(m.Datacenter)))
i += copy(dAtA[i:], m.Datacenter)
}
if len(m.PrimaryDatacenter) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintConfig(dAtA, i, uint64(len(m.PrimaryDatacenter)))
i += copy(dAtA[i:], m.PrimaryDatacenter)
}
if len(m.NodeName) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintConfig(dAtA, i, uint64(len(m.NodeName)))
i += copy(dAtA[i:], m.NodeName)
}
if len(m.SegmentName) > 0 {
dAtA[i] = 0x22
i++
i = encodeVarintConfig(dAtA, i, uint64(len(m.SegmentName)))
i += copy(dAtA[i:], m.SegmentName)
}
if m.ACL != nil {
dAtA[i] = 0x2a
i++
i = encodeVarintConfig(dAtA, i, uint64(m.ACL.Size()))
n1, err := m.ACL.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
}
if m.AutoEncrypt != nil {
dAtA[i] = 0x32
i++
i = encodeVarintConfig(dAtA, i, uint64(m.AutoEncrypt.Size()))
n2, err := m.AutoEncrypt.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n2
}
if m.Gossip != nil {
dAtA[i] = 0x3a
i++
i = encodeVarintConfig(dAtA, i, uint64(m.Gossip.Size()))
n3, err := m.Gossip.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n3
} }
if m.TLS != nil { if m.TLS != nil {
dAtA[i] = 0x42 {
i++ size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintConfig(dAtA, i, uint64(m.TLS.Size()))
n4, err := m.TLS.MarshalTo(dAtA[i:])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n4 i -= size
i = encodeVarintConfig(dAtA, i, uint64(size))
} }
if m.XXX_unrecognized != nil { i--
i += copy(dAtA[i:], m.XXX_unrecognized) dAtA[i] = 0x42
} }
return i, nil if m.Gossip != nil {
{
size, err := m.Gossip.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintConfig(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x3a
}
if m.AutoEncrypt != nil {
{
size, err := m.AutoEncrypt.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintConfig(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x32
}
if m.ACL != nil {
{
size, err := m.ACL.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintConfig(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x2a
}
if len(m.SegmentName) > 0 {
i -= len(m.SegmentName)
copy(dAtA[i:], m.SegmentName)
i = encodeVarintConfig(dAtA, i, uint64(len(m.SegmentName)))
i--
dAtA[i] = 0x22
}
if len(m.NodeName) > 0 {
i -= len(m.NodeName)
copy(dAtA[i:], m.NodeName)
i = encodeVarintConfig(dAtA, i, uint64(len(m.NodeName)))
i--
dAtA[i] = 0x1a
}
if len(m.PrimaryDatacenter) > 0 {
i -= len(m.PrimaryDatacenter)
copy(dAtA[i:], m.PrimaryDatacenter)
i = encodeVarintConfig(dAtA, i, uint64(len(m.PrimaryDatacenter)))
i--
dAtA[i] = 0x12
}
if len(m.Datacenter) > 0 {
i -= len(m.Datacenter)
copy(dAtA[i:], m.Datacenter)
i = encodeVarintConfig(dAtA, i, uint64(len(m.Datacenter)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *Gossip) Marshal() (dAtA []byte, err error) { func (m *Gossip) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -824,45 +843,47 @@ func (m *Gossip) Marshal() (dAtA []byte, err error) {
} }
func (m *Gossip) MarshalTo(dAtA []byte) (int, error) { func (m *Gossip) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Gossip) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.RetryJoinLAN) > 0 {
for iNdEx := len(m.RetryJoinLAN) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.RetryJoinLAN[iNdEx])
copy(dAtA[i:], m.RetryJoinLAN[iNdEx])
i = encodeVarintConfig(dAtA, i, uint64(len(m.RetryJoinLAN[iNdEx])))
i--
dAtA[i] = 0x12
}
}
if m.Encryption != nil { if m.Encryption != nil {
dAtA[i] = 0xa {
i++ size, err := m.Encryption.MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintConfig(dAtA, i, uint64(m.Encryption.Size()))
n5, err := m.Encryption.MarshalTo(dAtA[i:])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n5 i -= size
i = encodeVarintConfig(dAtA, i, uint64(size))
} }
if len(m.RetryJoinLAN) > 0 { i--
for _, s := range m.RetryJoinLAN { dAtA[i] = 0xa
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) return len(dAtA) - i, nil
i++
i += copy(dAtA[i:], s)
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *GossipEncryption) Marshal() (dAtA []byte, err error) { func (m *GossipEncryption) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -870,46 +891,53 @@ func (m *GossipEncryption) Marshal() (dAtA []byte, err error) {
} }
func (m *GossipEncryption) MarshalTo(dAtA []byte) (int, error) { func (m *GossipEncryption) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GossipEncryption) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Key) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintConfig(dAtA, i, uint64(len(m.Key)))
i += copy(dAtA[i:], m.Key)
}
if m.VerifyIncoming {
dAtA[i] = 0x10
i++
if m.VerifyIncoming {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if m.VerifyOutgoing {
dAtA[i] = 0x18
i++
if m.VerifyOutgoing {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if m.VerifyOutgoing {
i--
if m.VerifyOutgoing {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x18
}
if m.VerifyIncoming {
i--
if m.VerifyIncoming {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x10
}
if len(m.Key) > 0 {
i -= len(m.Key)
copy(dAtA[i:], m.Key)
i = encodeVarintConfig(dAtA, i, uint64(len(m.Key)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *TLS) Marshal() (dAtA []byte, err error) { func (m *TLS) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -917,62 +945,70 @@ func (m *TLS) Marshal() (dAtA []byte, err error) {
} }
func (m *TLS) MarshalTo(dAtA []byte) (int, 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 _ = i
var l int var l int
_ = l _ = l
if m.VerifyOutgoing { if m.XXX_unrecognized != nil {
dAtA[i] = 0x8 i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
if m.VerifyOutgoing { }
if m.PreferServerCipherSuites {
i--
if m.PreferServerCipherSuites {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
} dAtA[i] = 0x28
if m.VerifyServerHostname {
dAtA[i] = 0x10
i++
if m.VerifyServerHostname {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if len(m.CipherSuites) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintConfig(dAtA, i, uint64(len(m.CipherSuites)))
i += copy(dAtA[i:], m.CipherSuites)
} }
if len(m.MinVersion) > 0 { if len(m.MinVersion) > 0 {
dAtA[i] = 0x22 i -= len(m.MinVersion)
i++ copy(dAtA[i:], m.MinVersion)
i = encodeVarintConfig(dAtA, i, uint64(len(m.MinVersion))) i = encodeVarintConfig(dAtA, i, uint64(len(m.MinVersion)))
i += copy(dAtA[i:], m.MinVersion) i--
dAtA[i] = 0x22
} }
if m.PreferServerCipherSuites { if len(m.CipherSuites) > 0 {
dAtA[i] = 0x28 i -= len(m.CipherSuites)
i++ copy(dAtA[i:], m.CipherSuites)
if m.PreferServerCipherSuites { i = encodeVarintConfig(dAtA, i, uint64(len(m.CipherSuites)))
i--
dAtA[i] = 0x1a
}
if m.VerifyServerHostname {
i--
if m.VerifyServerHostname {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x10
} }
if m.XXX_unrecognized != nil { if m.VerifyOutgoing {
i += copy(dAtA[i:], m.XXX_unrecognized) i--
if m.VerifyOutgoing {
dAtA[i] = 1
} else {
dAtA[i] = 0
} }
return i, nil i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
} }
func (m *ACL) Marshal() (dAtA []byte, err error) { func (m *ACL) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -980,106 +1016,120 @@ func (m *ACL) Marshal() (dAtA []byte, err error) {
} }
func (m *ACL) MarshalTo(dAtA []byte) (int, error) { func (m *ACL) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ACL) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.Enabled { if m.XXX_unrecognized != nil {
dAtA[i] = 0x8 i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
if m.Enabled { }
if m.MSPDisableBootstrap {
i--
if m.MSPDisableBootstrap {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x58
} }
if len(m.PolicyTTL) > 0 { if m.EnableTokenPersistence {
dAtA[i] = 0x12 i--
i++ if m.EnableTokenPersistence {
i = encodeVarintConfig(dAtA, i, uint64(len(m.PolicyTTL)))
i += copy(dAtA[i:], m.PolicyTTL)
}
if len(m.RoleTTL) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintConfig(dAtA, i, uint64(len(m.RoleTTL)))
i += copy(dAtA[i:], m.RoleTTL)
}
if len(m.TokenTTL) > 0 {
dAtA[i] = 0x22
i++
i = encodeVarintConfig(dAtA, i, uint64(len(m.TokenTTL)))
i += copy(dAtA[i:], m.TokenTTL)
}
if len(m.DownPolicy) > 0 {
dAtA[i] = 0x2a
i++
i = encodeVarintConfig(dAtA, i, uint64(len(m.DownPolicy)))
i += copy(dAtA[i:], m.DownPolicy)
}
if len(m.DefaultPolicy) > 0 {
dAtA[i] = 0x32
i++
i = encodeVarintConfig(dAtA, i, uint64(len(m.DefaultPolicy)))
i += copy(dAtA[i:], m.DefaultPolicy)
}
if m.EnableKeyListPolicy {
dAtA[i] = 0x38
i++
if m.EnableKeyListPolicy {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x50
}
if len(m.DisabledTTL) > 0 {
i -= len(m.DisabledTTL)
copy(dAtA[i:], m.DisabledTTL)
i = encodeVarintConfig(dAtA, i, uint64(len(m.DisabledTTL)))
i--
dAtA[i] = 0x4a
} }
if m.Tokens != nil { if m.Tokens != nil {
dAtA[i] = 0x42 {
i++ size, err := m.Tokens.MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintConfig(dAtA, i, uint64(m.Tokens.Size()))
n6, err := m.Tokens.MarshalTo(dAtA[i:])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n6 i -= size
i = encodeVarintConfig(dAtA, i, uint64(size))
} }
if len(m.DisabledTTL) > 0 { i--
dAtA[i] = 0x4a dAtA[i] = 0x42
i++
i = encodeVarintConfig(dAtA, i, uint64(len(m.DisabledTTL)))
i += copy(dAtA[i:], m.DisabledTTL)
} }
if m.EnableTokenPersistence { if m.EnableKeyListPolicy {
dAtA[i] = 0x50 i--
i++ if m.EnableKeyListPolicy {
if m.EnableTokenPersistence {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x38
} }
if m.MSPDisableBootstrap { if len(m.DefaultPolicy) > 0 {
dAtA[i] = 0x58 i -= len(m.DefaultPolicy)
i++ copy(dAtA[i:], m.DefaultPolicy)
if m.MSPDisableBootstrap { i = encodeVarintConfig(dAtA, i, uint64(len(m.DefaultPolicy)))
i--
dAtA[i] = 0x32
}
if len(m.DownPolicy) > 0 {
i -= len(m.DownPolicy)
copy(dAtA[i:], m.DownPolicy)
i = encodeVarintConfig(dAtA, i, uint64(len(m.DownPolicy)))
i--
dAtA[i] = 0x2a
}
if len(m.TokenTTL) > 0 {
i -= len(m.TokenTTL)
copy(dAtA[i:], m.TokenTTL)
i = encodeVarintConfig(dAtA, i, uint64(len(m.TokenTTL)))
i--
dAtA[i] = 0x22
}
if len(m.RoleTTL) > 0 {
i -= len(m.RoleTTL)
copy(dAtA[i:], m.RoleTTL)
i = encodeVarintConfig(dAtA, i, uint64(len(m.RoleTTL)))
i--
dAtA[i] = 0x1a
}
if len(m.PolicyTTL) > 0 {
i -= len(m.PolicyTTL)
copy(dAtA[i:], m.PolicyTTL)
i = encodeVarintConfig(dAtA, i, uint64(len(m.PolicyTTL)))
i--
dAtA[i] = 0x12
}
if m.Enabled {
i--
if m.Enabled {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x8
} }
if m.XXX_unrecognized != nil { return len(dAtA) - i, nil
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *ACLTokens) Marshal() (dAtA []byte, err error) { func (m *ACLTokens) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1087,62 +1137,75 @@ func (m *ACLTokens) Marshal() (dAtA []byte, err error) {
} }
func (m *ACLTokens) MarshalTo(dAtA []byte) (int, error) { func (m *ACLTokens) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ACLTokens) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Master) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintConfig(dAtA, i, uint64(len(m.Master)))
i += copy(dAtA[i:], m.Master)
}
if len(m.Replication) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintConfig(dAtA, i, uint64(len(m.Replication)))
i += copy(dAtA[i:], m.Replication)
}
if len(m.AgentMaster) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintConfig(dAtA, i, uint64(len(m.AgentMaster)))
i += copy(dAtA[i:], m.AgentMaster)
}
if len(m.Default) > 0 {
dAtA[i] = 0x22
i++
i = encodeVarintConfig(dAtA, i, uint64(len(m.Default)))
i += copy(dAtA[i:], m.Default)
}
if len(m.Agent) > 0 {
dAtA[i] = 0x2a
i++
i = encodeVarintConfig(dAtA, i, uint64(len(m.Agent)))
i += copy(dAtA[i:], m.Agent)
} }
if len(m.ManagedServiceProvider) > 0 { if len(m.ManagedServiceProvider) > 0 {
for _, msg := range m.ManagedServiceProvider { for iNdEx := len(m.ManagedServiceProvider) - 1; iNdEx >= 0; iNdEx-- {
dAtA[i] = 0x32 {
i++ size, err := m.ManagedServiceProvider[iNdEx].MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintConfig(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n i -= size
i = encodeVarintConfig(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x32
} }
} }
if m.XXX_unrecognized != nil { if len(m.Agent) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Agent)
copy(dAtA[i:], m.Agent)
i = encodeVarintConfig(dAtA, i, uint64(len(m.Agent)))
i--
dAtA[i] = 0x2a
} }
return i, nil if len(m.Default) > 0 {
i -= len(m.Default)
copy(dAtA[i:], m.Default)
i = encodeVarintConfig(dAtA, i, uint64(len(m.Default)))
i--
dAtA[i] = 0x22
}
if len(m.AgentMaster) > 0 {
i -= len(m.AgentMaster)
copy(dAtA[i:], m.AgentMaster)
i = encodeVarintConfig(dAtA, i, uint64(len(m.AgentMaster)))
i--
dAtA[i] = 0x1a
}
if len(m.Replication) > 0 {
i -= len(m.Replication)
copy(dAtA[i:], m.Replication)
i = encodeVarintConfig(dAtA, i, uint64(len(m.Replication)))
i--
dAtA[i] = 0x12
}
if len(m.Master) > 0 {
i -= len(m.Master)
copy(dAtA[i:], m.Master)
i = encodeVarintConfig(dAtA, i, uint64(len(m.Master)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *ACLServiceProviderToken) Marshal() (dAtA []byte, err error) { func (m *ACLServiceProviderToken) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1150,32 +1213,40 @@ func (m *ACLServiceProviderToken) Marshal() (dAtA []byte, err error) {
} }
func (m *ACLServiceProviderToken) MarshalTo(dAtA []byte) (int, error) { func (m *ACLServiceProviderToken) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ACLServiceProviderToken) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.AccessorID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintConfig(dAtA, i, uint64(len(m.AccessorID)))
i += copy(dAtA[i:], m.AccessorID)
} }
if len(m.SecretID) > 0 { if len(m.SecretID) > 0 {
dAtA[i] = 0x12 i -= len(m.SecretID)
i++ copy(dAtA[i:], m.SecretID)
i = encodeVarintConfig(dAtA, i, uint64(len(m.SecretID))) i = encodeVarintConfig(dAtA, i, uint64(len(m.SecretID)))
i += copy(dAtA[i:], m.SecretID) i--
dAtA[i] = 0x12
} }
if m.XXX_unrecognized != nil { if len(m.AccessorID) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.AccessorID)
copy(dAtA[i:], m.AccessorID)
i = encodeVarintConfig(dAtA, i, uint64(len(m.AccessorID)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *AutoEncrypt) Marshal() (dAtA []byte, err error) { func (m *AutoEncrypt) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1183,74 +1254,70 @@ func (m *AutoEncrypt) Marshal() (dAtA []byte, err error) {
} }
func (m *AutoEncrypt) MarshalTo(dAtA []byte) (int, error) { func (m *AutoEncrypt) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *AutoEncrypt) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.TLS { if m.XXX_unrecognized != nil {
dAtA[i] = 0x8 i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
if m.TLS { }
if m.AllowTLS {
i--
if m.AllowTLS {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
} dAtA[i] = 0x20
if len(m.DNSSAN) > 0 {
for _, s := range m.DNSSAN {
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.IPSAN) > 0 { if len(m.IPSAN) > 0 {
for _, s := range m.IPSAN { for iNdEx := len(m.IPSAN) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.IPSAN[iNdEx])
copy(dAtA[i:], m.IPSAN[iNdEx])
i = encodeVarintConfig(dAtA, i, uint64(len(m.IPSAN[iNdEx])))
i--
dAtA[i] = 0x1a 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 m.AllowTLS { if len(m.DNSSAN) > 0 {
dAtA[i] = 0x20 for iNdEx := len(m.DNSSAN) - 1; iNdEx >= 0; iNdEx-- {
i++ i -= len(m.DNSSAN[iNdEx])
if m.AllowTLS { copy(dAtA[i:], m.DNSSAN[iNdEx])
i = encodeVarintConfig(dAtA, i, uint64(len(m.DNSSAN[iNdEx])))
i--
dAtA[i] = 0x12
}
}
if m.TLS {
i--
if m.TLS {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x8
} }
if m.XXX_unrecognized != nil { return len(dAtA) - i, nil
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func encodeVarintConfig(dAtA []byte, offset int, v uint64) int { func encodeVarintConfig(dAtA []byte, offset int, v uint64) int {
offset -= sovConfig(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *Config) Size() (n int) { func (m *Config) Size() (n int) {
if m == nil { if m == nil {
@ -1510,14 +1577,7 @@ func (m *AutoEncrypt) Size() (n int) {
} }
func sovConfig(x uint64) (n int) { func sovConfig(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozConfig(x uint64) (n int) { func sozConfig(x uint64) (n int) {
return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63))))

View File

@ -10,6 +10,7 @@ import (
pbcommon "github.com/hashicorp/consul/proto/pbcommon" pbcommon "github.com/hashicorp/consul/proto/pbcommon"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -76,7 +77,7 @@ func (m *CARoots) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CARoots.Marshal(b, m, deterministic) return xxx_messageInfo_CARoots.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -194,7 +195,7 @@ func (m *CARoot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CARoot.Marshal(b, m, deterministic) return xxx_messageInfo_CARoot.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -368,7 +369,7 @@ func (m *IssuedCert) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_IssuedCert.Marshal(b, m, deterministic) return xxx_messageInfo_IssuedCert.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -521,7 +522,7 @@ var fileDescriptor_80627e709958eb04 = []byte{
func (m *CARoots) Marshal() (dAtA []byte, err error) { func (m *CARoots) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -529,54 +530,66 @@ func (m *CARoots) Marshal() (dAtA []byte, err error) {
} }
func (m *CARoots) MarshalTo(dAtA []byte) (int, error) { func (m *CARoots) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *CARoots) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ActiveRootID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintConnect(dAtA, i, uint64(len(m.ActiveRootID)))
i += copy(dAtA[i:], m.ActiveRootID)
}
if len(m.TrustDomain) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintConnect(dAtA, i, uint64(len(m.TrustDomain)))
i += copy(dAtA[i:], m.TrustDomain)
}
if len(m.Roots) > 0 {
for _, msg := range m.Roots {
dAtA[i] = 0x1a
i++
i = encodeVarintConnect(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
} }
if m.QueryMeta != nil { if m.QueryMeta != nil {
dAtA[i] = 0x22 {
i++ size, err := m.QueryMeta.MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintConnect(dAtA, i, uint64(m.QueryMeta.Size()))
n1, err := m.QueryMeta.MarshalTo(dAtA[i:])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n1 i -= size
i = encodeVarintConnect(dAtA, i, uint64(size))
} }
if m.XXX_unrecognized != nil { i--
i += copy(dAtA[i:], m.XXX_unrecognized) dAtA[i] = 0x22
} }
return i, nil if len(m.Roots) > 0 {
for iNdEx := len(m.Roots) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Roots[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintConnect(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
}
}
if len(m.TrustDomain) > 0 {
i -= len(m.TrustDomain)
copy(dAtA[i:], m.TrustDomain)
i = encodeVarintConnect(dAtA, i, uint64(len(m.TrustDomain)))
i--
dAtA[i] = 0x12
}
if len(m.ActiveRootID) > 0 {
i -= len(m.ActiveRootID)
copy(dAtA[i:], m.ActiveRootID)
i = encodeVarintConnect(dAtA, i, uint64(len(m.ActiveRootID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *CARoot) Marshal() (dAtA []byte, err error) { func (m *CARoot) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -584,145 +597,161 @@ func (m *CARoot) Marshal() (dAtA []byte, err error) {
} }
func (m *CARoot) MarshalTo(dAtA []byte) (int, error) { func (m *CARoot) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *CARoot) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintConnect(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
} }
if len(m.Name) > 0 { if m.RaftIndex != nil {
dAtA[i] = 0x12 {
i++ size, err := m.RaftIndex.MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintConnect(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
}
if m.SerialNumber != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintConnect(dAtA, i, uint64(m.SerialNumber))
}
if len(m.SigningKeyID) > 0 {
dAtA[i] = 0x22
i++
i = encodeVarintConnect(dAtA, i, uint64(len(m.SigningKeyID)))
i += copy(dAtA[i:], m.SigningKeyID)
}
if len(m.ExternalTrustDomain) > 0 {
dAtA[i] = 0x2a
i++
i = encodeVarintConnect(dAtA, i, uint64(len(m.ExternalTrustDomain)))
i += copy(dAtA[i:], m.ExternalTrustDomain)
}
if m.NotBefore != nil {
dAtA[i] = 0x32
i++
i = encodeVarintConnect(dAtA, i, uint64(m.NotBefore.Size()))
n2, err := m.NotBefore.MarshalTo(dAtA[i:])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n2 i -= size
i = encodeVarintConnect(dAtA, i, uint64(size))
} }
if m.NotAfter != nil { i--
dAtA[i] = 0x3a dAtA[i] = 0x1
i++ i--
i = encodeVarintConnect(dAtA, i, uint64(m.NotAfter.Size())) dAtA[i] = 0x82
n3, err := m.NotAfter.MarshalTo(dAtA[i:]) }
if m.PrivateKeyBits != 0 {
i = encodeVarintConnect(dAtA, i, uint64(m.PrivateKeyBits))
i--
dAtA[i] = 0x78
}
if len(m.PrivateKeyType) > 0 {
i -= len(m.PrivateKeyType)
copy(dAtA[i:], m.PrivateKeyType)
i = encodeVarintConnect(dAtA, i, uint64(len(m.PrivateKeyType)))
i--
dAtA[i] = 0x72
}
if m.RotatedOutAt != nil {
{
size, err := m.RotatedOutAt.MarshalToSizedBuffer(dAtA[:i])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n3 i -= size
i = encodeVarintConnect(dAtA, i, uint64(size))
} }
if len(m.RootCert) > 0 { i--
dAtA[i] = 0x42 dAtA[i] = 0x6a
i++
i = encodeVarintConnect(dAtA, i, uint64(len(m.RootCert)))
i += copy(dAtA[i:], m.RootCert)
}
if len(m.IntermediateCerts) > 0 {
for _, s := range m.IntermediateCerts {
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.SigningCert) > 0 {
dAtA[i] = 0x52
i++
i = encodeVarintConnect(dAtA, i, uint64(len(m.SigningCert)))
i += copy(dAtA[i:], m.SigningCert)
}
if len(m.SigningKey) > 0 {
dAtA[i] = 0x5a
i++
i = encodeVarintConnect(dAtA, i, uint64(len(m.SigningKey)))
i += copy(dAtA[i:], m.SigningKey)
} }
if m.Active { if m.Active {
dAtA[i] = 0x60 i--
i++
if m.Active { if m.Active {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x60
} }
if m.RotatedOutAt != nil { if len(m.SigningKey) > 0 {
dAtA[i] = 0x6a i -= len(m.SigningKey)
i++ copy(dAtA[i:], m.SigningKey)
i = encodeVarintConnect(dAtA, i, uint64(m.RotatedOutAt.Size())) i = encodeVarintConnect(dAtA, i, uint64(len(m.SigningKey)))
n4, err := m.RotatedOutAt.MarshalTo(dAtA[i:]) i--
dAtA[i] = 0x5a
}
if len(m.SigningCert) > 0 {
i -= len(m.SigningCert)
copy(dAtA[i:], m.SigningCert)
i = encodeVarintConnect(dAtA, i, uint64(len(m.SigningCert)))
i--
dAtA[i] = 0x52
}
if len(m.IntermediateCerts) > 0 {
for iNdEx := len(m.IntermediateCerts) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.IntermediateCerts[iNdEx])
copy(dAtA[i:], m.IntermediateCerts[iNdEx])
i = encodeVarintConnect(dAtA, i, uint64(len(m.IntermediateCerts[iNdEx])))
i--
dAtA[i] = 0x4a
}
}
if len(m.RootCert) > 0 {
i -= len(m.RootCert)
copy(dAtA[i:], m.RootCert)
i = encodeVarintConnect(dAtA, i, uint64(len(m.RootCert)))
i--
dAtA[i] = 0x42
}
if m.NotAfter != nil {
{
size, err := m.NotAfter.MarshalToSizedBuffer(dAtA[:i])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n4 i -= size
i = encodeVarintConnect(dAtA, i, uint64(size))
} }
if len(m.PrivateKeyType) > 0 { i--
dAtA[i] = 0x72 dAtA[i] = 0x3a
i++
i = encodeVarintConnect(dAtA, i, uint64(len(m.PrivateKeyType)))
i += copy(dAtA[i:], m.PrivateKeyType)
} }
if m.PrivateKeyBits != 0 { if m.NotBefore != nil {
dAtA[i] = 0x78 {
i++ size, err := m.NotBefore.MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintConnect(dAtA, i, uint64(m.PrivateKeyBits))
}
if m.RaftIndex != nil {
dAtA[i] = 0x82
i++
dAtA[i] = 0x1
i++
i = encodeVarintConnect(dAtA, i, uint64(m.RaftIndex.Size()))
n5, err := m.RaftIndex.MarshalTo(dAtA[i:])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n5 i -= size
i = encodeVarintConnect(dAtA, i, uint64(size))
} }
if m.XXX_unrecognized != nil { i--
i += copy(dAtA[i:], m.XXX_unrecognized) dAtA[i] = 0x32
} }
return i, nil if len(m.ExternalTrustDomain) > 0 {
i -= len(m.ExternalTrustDomain)
copy(dAtA[i:], m.ExternalTrustDomain)
i = encodeVarintConnect(dAtA, i, uint64(len(m.ExternalTrustDomain)))
i--
dAtA[i] = 0x2a
}
if len(m.SigningKeyID) > 0 {
i -= len(m.SigningKeyID)
copy(dAtA[i:], m.SigningKeyID)
i = encodeVarintConnect(dAtA, i, uint64(len(m.SigningKeyID)))
i--
dAtA[i] = 0x22
}
if m.SerialNumber != 0 {
i = encodeVarintConnect(dAtA, i, uint64(m.SerialNumber))
i--
dAtA[i] = 0x18
}
if len(m.Name) > 0 {
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintConnect(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0x12
}
if len(m.ID) > 0 {
i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintConnect(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *IssuedCert) Marshal() (dAtA []byte, err error) { func (m *IssuedCert) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -730,106 +759,129 @@ func (m *IssuedCert) Marshal() (dAtA []byte, err error) {
} }
func (m *IssuedCert) MarshalTo(dAtA []byte) (int, error) { func (m *IssuedCert) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *IssuedCert) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.SerialNumber) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintConnect(dAtA, i, uint64(len(m.SerialNumber)))
i += copy(dAtA[i:], m.SerialNumber)
}
if len(m.CertPEM) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintConnect(dAtA, i, uint64(len(m.CertPEM)))
i += copy(dAtA[i:], m.CertPEM)
}
if len(m.PrivateKeyPEM) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintConnect(dAtA, i, uint64(len(m.PrivateKeyPEM)))
i += copy(dAtA[i:], m.PrivateKeyPEM)
}
if len(m.Service) > 0 {
dAtA[i] = 0x22
i++
i = encodeVarintConnect(dAtA, i, uint64(len(m.Service)))
i += copy(dAtA[i:], m.Service)
}
if len(m.ServiceURI) > 0 {
dAtA[i] = 0x2a
i++
i = encodeVarintConnect(dAtA, i, uint64(len(m.ServiceURI)))
i += copy(dAtA[i:], m.ServiceURI)
}
if len(m.Agent) > 0 {
dAtA[i] = 0x32
i++
i = encodeVarintConnect(dAtA, i, uint64(len(m.Agent)))
i += copy(dAtA[i:], m.Agent)
}
if len(m.AgentURI) > 0 {
dAtA[i] = 0x3a
i++
i = encodeVarintConnect(dAtA, i, uint64(len(m.AgentURI)))
i += copy(dAtA[i:], m.AgentURI)
}
if m.ValidAfter != nil {
dAtA[i] = 0x42
i++
i = encodeVarintConnect(dAtA, i, uint64(m.ValidAfter.Size()))
n6, err := m.ValidAfter.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n6
}
if m.ValidBefore != nil {
dAtA[i] = 0x4a
i++
i = encodeVarintConnect(dAtA, i, uint64(m.ValidBefore.Size()))
n7, err := m.ValidBefore.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n7
}
if m.EnterpriseMeta != nil {
dAtA[i] = 0x52
i++
i = encodeVarintConnect(dAtA, i, uint64(m.EnterpriseMeta.Size()))
n8, err := m.EnterpriseMeta.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n8
} }
if m.RaftIndex != nil { if m.RaftIndex != nil {
dAtA[i] = 0x5a {
i++ size, err := m.RaftIndex.MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintConnect(dAtA, i, uint64(m.RaftIndex.Size()))
n9, err := m.RaftIndex.MarshalTo(dAtA[i:])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n9 i -= size
i = encodeVarintConnect(dAtA, i, uint64(size))
} }
if m.XXX_unrecognized != nil { i--
i += copy(dAtA[i:], m.XXX_unrecognized) dAtA[i] = 0x5a
} }
return i, nil if m.EnterpriseMeta != nil {
{
size, err := m.EnterpriseMeta.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintConnect(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x52
}
if m.ValidBefore != nil {
{
size, err := m.ValidBefore.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintConnect(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x4a
}
if m.ValidAfter != nil {
{
size, err := m.ValidAfter.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintConnect(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x42
}
if len(m.AgentURI) > 0 {
i -= len(m.AgentURI)
copy(dAtA[i:], m.AgentURI)
i = encodeVarintConnect(dAtA, i, uint64(len(m.AgentURI)))
i--
dAtA[i] = 0x3a
}
if len(m.Agent) > 0 {
i -= len(m.Agent)
copy(dAtA[i:], m.Agent)
i = encodeVarintConnect(dAtA, i, uint64(len(m.Agent)))
i--
dAtA[i] = 0x32
}
if len(m.ServiceURI) > 0 {
i -= len(m.ServiceURI)
copy(dAtA[i:], m.ServiceURI)
i = encodeVarintConnect(dAtA, i, uint64(len(m.ServiceURI)))
i--
dAtA[i] = 0x2a
}
if len(m.Service) > 0 {
i -= len(m.Service)
copy(dAtA[i:], m.Service)
i = encodeVarintConnect(dAtA, i, uint64(len(m.Service)))
i--
dAtA[i] = 0x22
}
if len(m.PrivateKeyPEM) > 0 {
i -= len(m.PrivateKeyPEM)
copy(dAtA[i:], m.PrivateKeyPEM)
i = encodeVarintConnect(dAtA, i, uint64(len(m.PrivateKeyPEM)))
i--
dAtA[i] = 0x1a
}
if len(m.CertPEM) > 0 {
i -= len(m.CertPEM)
copy(dAtA[i:], m.CertPEM)
i = encodeVarintConnect(dAtA, i, uint64(len(m.CertPEM)))
i--
dAtA[i] = 0x12
}
if len(m.SerialNumber) > 0 {
i -= len(m.SerialNumber)
copy(dAtA[i:], m.SerialNumber)
i = encodeVarintConnect(dAtA, i, uint64(len(m.SerialNumber)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintConnect(dAtA []byte, offset int, v uint64) int { func encodeVarintConnect(dAtA []byte, offset int, v uint64) int {
offset -= sovConnect(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *CARoots) Size() (n int) { func (m *CARoots) Size() (n int) {
if m == nil { if m == nil {
@ -993,14 +1045,7 @@ func (m *IssuedCert) Size() (n int) {
} }
func sovConnect(x uint64) (n int) { func sovConnect(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozConnect(x uint64) (n int) { func sozConnect(x uint64) (n int) {
return sovConnect(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovConnect(uint64((x << 1) ^ uint64((int64(x) >> 63))))