remove gogo pbconnect, pbconfig and pbautoconf

This commit is contained in:
Eric 2022-03-23 09:25:56 -04:00
parent 13c6959b2b
commit 467f771d74
10 changed files with 288 additions and 5499 deletions

View File

@ -5,6 +5,15 @@ echo $PWD
if [[ "$FILENAME" =~ .*pbcommon/.* ]]; then
echo "$FILENAME no gogo"
./build-support/scripts/proto-gen-no-gogo.sh $1 $2 $3
elif [[ "$FILENAME" =~ .*pbconnect/.* ]]; then
echo "$FILENAME no gogo"
./build-support/scripts/proto-gen-no-gogo.sh $1 $2 $3
elif [[ "$FILENAME" =~ .*pbconfig/.* ]]; then
echo "$FILENAME no gogo"
./build-support/scripts/proto-gen-no-gogo.sh $1 $2 $3
elif [[ "$FILENAME" =~ .*pbautoconf/.* ]]; then
echo "$FILENAME no gogo"
./build-support/scripts/proto-gen-no-gogo.sh $1 $2 $3
else
echo "$FILENAME gogo"
./build-support/scripts/proto-gen.sh $1 $2 $3

View File

@ -1,4 +1,4 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: proto/pbautoconf/auto_config.proto
package pbautoconf
@ -8,9 +8,7 @@ import (
proto "github.com/golang/protobuf/proto"
pbconfig "github.com/hashicorp/consul/proto/pbconfig"
pbconnect "github.com/hashicorp/consul/proto/pbconnect"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
@ -58,26 +56,18 @@ func (*AutoConfigRequest) ProtoMessage() {}
func (*AutoConfigRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_ccc5af992e5daf69, []int{0}
}
func (m *AutoConfigRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
return xxx_messageInfo_AutoConfigRequest.Unmarshal(m, b)
}
func (m *AutoConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AutoConfigRequest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
return xxx_messageInfo_AutoConfigRequest.Marshal(b, m, deterministic)
}
func (m *AutoConfigRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_AutoConfigRequest.Merge(m, src)
}
func (m *AutoConfigRequest) XXX_Size() int {
return m.Size()
return xxx_messageInfo_AutoConfigRequest.Size(m)
}
func (m *AutoConfigRequest) XXX_DiscardUnknown() {
xxx_messageInfo_AutoConfigRequest.DiscardUnknown(m)
@ -156,26 +146,18 @@ func (*AutoConfigResponse) ProtoMessage() {}
func (*AutoConfigResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_ccc5af992e5daf69, []int{1}
}
func (m *AutoConfigResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
return xxx_messageInfo_AutoConfigResponse.Unmarshal(m, b)
}
func (m *AutoConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AutoConfigResponse.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
return xxx_messageInfo_AutoConfigResponse.Marshal(b, m, deterministic)
}
func (m *AutoConfigResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_AutoConfigResponse.Merge(m, src)
}
func (m *AutoConfigResponse) XXX_Size() int {
return m.Size()
return xxx_messageInfo_AutoConfigResponse.Size(m)
}
func (m *AutoConfigResponse) XXX_DiscardUnknown() {
xxx_messageInfo_AutoConfigResponse.DiscardUnknown(m)
@ -221,814 +203,27 @@ func init() {
}
var fileDescriptor_ccc5af992e5daf69 = []byte{
// 361 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcf, 0x4a, 0xc3, 0x40,
0x10, 0xc6, 0x8d, 0xad, 0xfd, 0xb3, 0x01, 0xa9, 0xdb, 0xcb, 0x52, 0x35,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0xcf, 0xf8, 0x23, 0xde, 0xfb, 0xb0, 0x08, 0x35, 0xf7, 0x50, 0x31,
0x48, 0x25, 0xe8, 0x01, 0xa9, 0xe5, 0x44, 0x2f, 0x61, 0x0f, 0xb6, 0xdd, 0xe2, 0x38, 0x45, 0xaf,
0xb0, 0xf4, 0x90, 0xd4, 0xfd, 0x21, 0x07, 0x40, 0xa5, 0x77, 0xb2, 0x07, 0x2d, 0xb7, 0xbc, 0x53,
0xc1, 0x79, 0x59, 0xa0, 0xa7, 0xc4, 0xf6, 0x45, 0x82, 0xd1, 0x2c, 0x0a, 0x03, 0x14, 0xac, 0xa2,
0xfb, 0xed, 0x9f, 0xfe, 0x95, 0x52, 0xa9, 0x98, 0x66, 0x0d, 0x6e, 0xf6, 0xe8, 0x31, 0x69, 0x5f,
0x3e, 0x63, 0x12, 0xf8, 0x43, 0x83, 0x2a, 0x56, 0xed, 0x56, 0xfa, 0x4d, 0xfe, 0x9f, 0x3a, 0x3f,
0x7b, 0x5b, 0x3b, 0xd6, 0xfb, 0xda, 0xb1, 0x3e, 0xd7, 0x8e, 0xf5, 0xf2, 0xe5, 0x6c, 0xdc, 0x1f,
0xcd, 0x23, 0x5c, 0xa4, 0x13, 0x37, 0x84, 0x95, 0xb7, 0x08, 0xd4, 0x22, 0x0a, 0x21, 0x89, 0xb3,
0x2f, 0xaa, 0xd2, 0xa5, 0xf7, 0xf7, 0x9f, 0x99, 0xd4, 0x34, 0x39, 0xf9, 0x0e, 0x00, 0x00, 0xff,
0xff, 0x65, 0x57, 0x2e, 0x30, 0x4e, 0x02, 0x00, 0x00,
// 340 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcd, 0x4a, 0xc3, 0x40,
0x10, 0xc7, 0x89, 0xad, 0xfd, 0x98, 0x80, 0xd4, 0xed, 0x65, 0xa9, 0x1f, 0x94, 0x1e, 0xa4, 0x88,
0x24,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x19, 0x2a, 0x2d, 0xd9, 0x19, 0xb4, 0x4a,
0x62, 0x97, 0xf0, 0x27, 0x07, 0x41, 0x75, 0x9c, 0xaa, 0x57, 0x59, 0x76, 0x0e, 0xed, 0x68, 0x2a,
0x10, 0x49, 0xdb, 0x9d, 0xfc, 0x49, 0x2f, 0xa8, 0xef, 0x54, 0x71, 0x51, 0x17, 0xd8, 0x35, 0xf8,
0x91, 0xcc, 0x29, 0x5d, 0xa5, 0x49, 0x4c, 0x92, 0x37, 0x6c, 0xbf, 0xff, 0xd3, 0xbf, 0xd7, 0xda,
0xc8, 0x65, 0xd1, 0x10, 0x6e, 0x8f, 0x5d, 0x42, 0xff, 0xee, 0x83, 0xf2, 0x38, 0x9a, 0x3a, 0x54,
0xf3, 0xe6, 0xb0, 0x31, 0xee, 0x8a, 0xff, 0xd4, 0x4d, 0xf0, 0x72, 0xb1, 0x4e, 0x69, 0x63, 0x16,
0x41, 0x82, 0xbb, 0x70, 0x13, 0xeb, 0x4d, 0x9a, 0x60, 0x9e, 0x15, 0x5f, 0x50, 0x9b, 0x6d, 0xf8,
0xf7, 0x1f, 0x59, 0xb4, 0x2c, 0xb9, 0xfa, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x29, 0xae, 0x66, 0x30,
0x3e, 0x02, 0x00, 0x00,
}
func (m *AutoConfigRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *AutoConfigRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *AutoConfigRequest) 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.Partition) > 0 {
i -= len(m.Partition)
copy(dAtA[i:], m.Partition)
i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.Partition)))
i--
dAtA[i] = 0x42
}
if len(m.CSR) > 0 {
i -= len(m.CSR)
copy(dAtA[i:], m.CSR)
i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.CSR)))
i--
dAtA[i] = 0x3a
}
if len(m.ConsulToken) > 0 {
i -= len(m.ConsulToken)
copy(dAtA[i:], m.ConsulToken)
i = encodeVarintAutoConfig(dAtA, i, uint64(len(m.ConsulToken)))
i--
dAtA[i] = 0x32
}
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) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *AutoConfigResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *AutoConfigResponse) 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.ExtraCACertificates) > 0 {
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
}
}
if m.Certificate != nil {
{
size, err := m.Certificate.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
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 {
offset -= sovAutoConfig(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *AutoConfigRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Datacenter)
if l > 0 {
n += 1 + l + sovAutoConfig(uint64(l))
}
l = len(m.Node)
if l > 0 {
n += 1 + l + sovAutoConfig(uint64(l))
}
l = len(m.Segment)
if l > 0 {
n += 1 + l + sovAutoConfig(uint64(l))
}
l = len(m.JWT)
if l > 0 {
n += 1 + l + sovAutoConfig(uint64(l))
}
l = len(m.ConsulToken)
if l > 0 {
n += 1 + l + sovAutoConfig(uint64(l))
}
l = len(m.CSR)
if l > 0 {
n += 1 + l + sovAutoConfig(uint64(l))
}
l = len(m.Partition)
if l > 0 {
n += 1 + l + sovAutoConfig(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *AutoConfigResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Config != nil {
l = m.Config.Size()
n += 1 + l + sovAutoConfig(uint64(l))
}
if m.CARoots != nil {
l = m.CARoots.Size()
n += 1 + l + sovAutoConfig(uint64(l))
}
if m.Certificate != nil {
l = m.Certificate.Size()
n += 1 + l + sovAutoConfig(uint64(l))
}
if len(m.ExtraCACertificates) > 0 {
for _, s := range m.ExtraCACertificates {
l = len(s)
n += 1 + l + sovAutoConfig(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovAutoConfig(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozAutoConfig(x uint64) (n int) {
return sovAutoConfig(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *AutoConfigRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: AutoConfigRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: AutoConfigRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Datacenter", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthAutoConfig
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthAutoConfig
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Datacenter = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthAutoConfig
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthAutoConfig
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Node = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Segment", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthAutoConfig
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthAutoConfig
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Segment = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field JWT", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthAutoConfig
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthAutoConfig
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.JWT = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ConsulToken", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthAutoConfig
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthAutoConfig
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ConsulToken = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 7:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field CSR", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthAutoConfig
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthAutoConfig
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.CSR = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 8:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Partition", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthAutoConfig
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthAutoConfig
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Partition = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipAutoConfig(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthAutoConfig
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *AutoConfigResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: AutoConfigResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: AutoConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthAutoConfig
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthAutoConfig
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Config == nil {
m.Config = &pbconfig.Config{}
}
if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field CARoots", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthAutoConfig
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthAutoConfig
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.CARoots == nil {
m.CARoots = &pbconnect.CARoots{}
}
if err := m.CARoots.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Certificate", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthAutoConfig
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthAutoConfig
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Certificate == nil {
m.Certificate = &pbconnect.IssuedCert{}
}
if err := m.Certificate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ExtraCACertificates", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthAutoConfig
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthAutoConfig
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ExtraCACertificates = append(m.ExtraCACertificates, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipAutoConfig(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthAutoConfig
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipAutoConfig(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowAutoConfig
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthAutoConfig
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupAutoConfig
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthAutoConfig
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthAutoConfig = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowAutoConfig = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupAutoConfig = fmt.Errorf("proto: unexpected end of group")
)

View File

@ -54,3 +54,17 @@ func QueryOptionsFromStructs(t *structs.QueryOptions, s *QueryOptions) {
s.MustRevalidate = t.MustRevalidate
s.Filter = t.Filter
}
func RaftIndexToStructs(s *RaftIndex, t *structs.RaftIndex) {
if s == nil {
return
}
t.CreateIndex = s.CreateIndex
t.ModifyIndex = s.ModifyIndex
}
func RaftIndexFromStructs(t *structs.RaftIndex, s *RaftIndex) {
if s == nil {
return
}
s.CreateIndex = t.CreateIndex
s.ModifyIndex = t.ModifyIndex
}

View File

@ -23,6 +23,13 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// RaftIndex is used to track the index used while creating
// or modifying a given struct type.
//
// mog annotation:
//
// target=github.com/hashicorp/consul/agent/structs.RaftIndex
// output=common.gen.go
// name=Structs
// ignore-fields=state,sizeCache,unknownFields
type RaftIndex struct {
// @gotags: bexpr:"-"
CreateIndex uint64 `protobuf:"varint,1,opt,name=CreateIndex,proto3" json:"CreateIndex,omitempty" bexpr:"-"`

View File

@ -9,6 +9,13 @@ import "google/protobuf/duration.proto";
// RaftIndex is used to track the index used while creating
// or modifying a given struct type.
//
// mog annotation:
//
// target=github.com/hashicorp/consul/agent/structs.RaftIndex
// output=common.gen.go
// name=Structs
// ignore-fields=state,sizeCache,unknownFields
message RaftIndex {
// @gotags: bexpr:"-"
uint64 CreateIndex = 1;

File diff suppressed because it is too large Load Diff

View File

@ -13,14 +13,14 @@ func CARootToStructsCARoot(s *CARoot, t *structs.CARoot) {
t.SerialNumber = s.SerialNumber
t.SigningKeyID = s.SigningKeyID
t.ExternalTrustDomain = s.ExternalTrustDomain
t.NotBefore = structs.TimeFromProtoGogo(s.NotBefore)
t.NotAfter = structs.TimeFromProtoGogo(s.NotAfter)
t.NotBefore = structs.TimeFromProto(s.NotBefore)
t.NotAfter = structs.TimeFromProto(s.NotAfter)
t.RootCert = s.RootCert
t.IntermediateCerts = s.IntermediateCerts
t.SigningCert = s.SigningCert
t.SigningKey = s.SigningKey
t.Active = s.Active
t.RotatedOutAt = structs.TimeFromProtoGogo(s.RotatedOutAt)
t.RotatedOutAt = structs.TimeFromProto(s.RotatedOutAt)
t.PrivateKeyType = s.PrivateKeyType
t.PrivateKeyBits = int(s.PrivateKeyBits)
t.RaftIndex = RaftIndexTo(s.RaftIndex)
@ -34,14 +34,14 @@ func CARootFromStructsCARoot(t *structs.CARoot, s *CARoot) {
s.SerialNumber = t.SerialNumber
s.SigningKeyID = t.SigningKeyID
s.ExternalTrustDomain = t.ExternalTrustDomain
s.NotBefore = structs.TimeToProtoGogo(t.NotBefore)
s.NotAfter = structs.TimeToProtoGogo(t.NotAfter)
s.NotBefore = structs.TimeToProto(t.NotBefore)
s.NotAfter = structs.TimeToProto(t.NotAfter)
s.RootCert = t.RootCert
s.IntermediateCerts = t.IntermediateCerts
s.SigningCert = t.SigningCert
s.SigningKey = t.SigningKey
s.Active = t.Active
s.RotatedOutAt = structs.TimeToProtoGogo(t.RotatedOutAt)
s.RotatedOutAt = structs.TimeToProto(t.RotatedOutAt)
s.PrivateKeyType = t.PrivateKeyType
s.PrivateKeyBits = int32(t.PrivateKeyBits)
s.RaftIndex = RaftIndexFrom(t.RaftIndex)
@ -93,8 +93,8 @@ func IssuedCertToStructsIssuedCert(s *IssuedCert, t *structs.IssuedCert) {
t.ServiceURI = s.ServiceURI
t.Agent = s.Agent
t.AgentURI = s.AgentURI
t.ValidAfter = structs.TimeFromProtoGogo(s.ValidAfter)
t.ValidBefore = structs.TimeFromProtoGogo(s.ValidBefore)
t.ValidAfter = structs.TimeFromProto(s.ValidAfter)
t.ValidBefore = structs.TimeFromProto(s.ValidBefore)
t.EnterpriseMeta = EnterpriseMetaTo(s.EnterpriseMeta)
t.RaftIndex = RaftIndexTo(s.RaftIndex)
}
@ -109,8 +109,8 @@ func IssuedCertFromStructsIssuedCert(t *structs.IssuedCert, s *IssuedCert) {
s.ServiceURI = t.ServiceURI
s.Agent = t.Agent
s.AgentURI = t.AgentURI
s.ValidAfter = structs.TimeToProtoGogo(t.ValidAfter)
s.ValidBefore = structs.TimeToProtoGogo(t.ValidBefore)
s.ValidAfter = structs.TimeToProto(t.ValidAfter)
s.ValidBefore = structs.TimeToProto(t.ValidBefore)
s.EnterpriseMeta = EnterpriseMetaFrom(t.EnterpriseMeta)
s.RaftIndex = RaftIndexFrom(t.RaftIndex)
}

View File

@ -2,42 +2,42 @@ package pbconnect
import (
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/consul/proto/pbcommongogo"
"github.com/hashicorp/consul/proto/pbcommon"
)
func QueryMetaFrom(f structs.QueryMeta) *pbcommongogo.QueryMeta {
t := new(pbcommongogo.QueryMeta)
pbcommongogo.QueryMetaFromStructs(&f, t)
func QueryMetaFrom(f structs.QueryMeta) *pbcommon.QueryMeta {
t := new(pbcommon.QueryMeta)
pbcommon.QueryMetaFromStructs(&f, t)
return t
}
func QueryMetaTo(f *pbcommongogo.QueryMeta) structs.QueryMeta {
func QueryMetaTo(f *pbcommon.QueryMeta) structs.QueryMeta {
t := new(structs.QueryMeta)
pbcommongogo.QueryMetaToStructs(f, t)
pbcommon.QueryMetaToStructs(f, t)
return *t
}
func RaftIndexFrom(f structs.RaftIndex) *pbcommongogo.RaftIndex {
t := new(pbcommongogo.RaftIndex)
pbcommongogo.RaftIndexFromStructs(&f, t)
func RaftIndexFrom(f structs.RaftIndex) *pbcommon.RaftIndex {
t := new(pbcommon.RaftIndex)
pbcommon.RaftIndexFromStructs(&f, t)
return t
}
func RaftIndexTo(f *pbcommongogo.RaftIndex) structs.RaftIndex {
func RaftIndexTo(f *pbcommon.RaftIndex) structs.RaftIndex {
t := new(structs.RaftIndex)
pbcommongogo.RaftIndexToStructs(f, t)
pbcommon.RaftIndexToStructs(f, t)
return *t
}
func EnterpriseMetaFrom(f structs.EnterpriseMeta) *pbcommongogo.EnterpriseMeta {
t := new(pbcommongogo.EnterpriseMeta)
pbcommongogo.EnterpriseMetaFromStructs(&f, t)
func EnterpriseMetaFrom(f structs.EnterpriseMeta) *pbcommon.EnterpriseMeta {
t := new(pbcommon.EnterpriseMeta)
pbcommon.EnterpriseMetaFromStructs(&f, t)
return t
}
func EnterpriseMetaTo(f *pbcommongogo.EnterpriseMeta) structs.EnterpriseMeta {
func EnterpriseMetaTo(f *pbcommon.EnterpriseMeta) structs.EnterpriseMeta {
t := new(structs.EnterpriseMeta)
pbcommongogo.EnterpriseMetaToStructs(f, t)
pbcommon.EnterpriseMetaToStructs(f, t)
return *t
}

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@ package connect;
option go_package = "github.com/hashicorp/consul/proto/pbconnect";
import "google/protobuf/timestamp.proto";
import "proto/pbcommongogo/common.proto";
import "proto/pbcommon/common.proto";
// CARoots is the list of all currently trusted CA Roots.
//
@ -50,7 +50,7 @@ message CARoots {
// QueryMeta here is mainly used to contain the latest Raft Index that could
// be used to perform a blocking query.
// mog: func-to=QueryMetaTo func-from=QueryMetaFrom
commongogo.QueryMeta QueryMeta = 4;
common.QueryMeta QueryMeta = 4;
}
// CARoot is the trusted CA Root.
@ -87,9 +87,9 @@ message CARoot {
string ExternalTrustDomain = 5;
// Time validity bounds.
// mog: func-to=structs.TimeFromProtoGogo func-from=structs.TimeToProtoGogo
// mog: func-to=structs.TimeFromProto func-from=structs.TimeToProto
google.protobuf.Timestamp NotBefore = 6;
// mog: func-to=structs.TimeFromProtoGogo func-from=structs.TimeToProtoGogo
// mog: func-to=structs.TimeFromProto func-from=structs.TimeToProto
google.protobuf.Timestamp NotAfter = 7;
// RootCert is the PEM-encoded public certificate.
@ -114,7 +114,7 @@ message CARoot {
// RotatedOutAt is the time at which this CA was removed from the state.
// This will only be set on roots that have been rotated out from being the
// active root.
// mog: func-to=structs.TimeFromProtoGogo func-from=structs.TimeToProtoGogo
// mog: func-to=structs.TimeFromProto func-from=structs.TimeToProto
google.protobuf.Timestamp RotatedOutAt = 13;
// PrivateKeyType is the type of the private key used to sign certificates. It
@ -129,9 +129,11 @@ message CARoot {
int32 PrivateKeyBits = 15;
// mog: func-to=RaftIndexTo func-from=RaftIndexFrom
commongogo.RaftIndex RaftIndex = 16;
common.RaftIndex RaftIndex = 16;
}
// RaftIndex is used to track the index used while creating
// or modifying a given struct type.
//
// mog annotation:
//
@ -161,15 +163,15 @@ message IssuedCert {
// ValidAfter and ValidBefore are the validity periods for the
// certificate.
// mog: func-to=structs.TimeFromProtoGogo func-from=structs.TimeToProtoGogo
// mog: func-to=structs.TimeFromProto func-from=structs.TimeToProto
google.protobuf.Timestamp ValidAfter = 8;
// mog: func-to=structs.TimeFromProtoGogo func-from=structs.TimeToProtoGogo
// mog: func-to=structs.TimeFromProto func-from=structs.TimeToProto
google.protobuf.Timestamp ValidBefore = 9;
// EnterpriseMeta is the Consul Enterprise specific metadata
// mog: func-to=EnterpriseMetaTo func-from=EnterpriseMetaFrom
commongogo.EnterpriseMeta EnterpriseMeta = 10;
common.EnterpriseMeta EnterpriseMeta = 10;
// mog: func-to=RaftIndexTo func-from=RaftIndexFrom
commongogo.RaftIndex RaftIndex = 11;
common.RaftIndex RaftIndex = 11;
}