mirror of https://github.com/hashicorp/consul
757 lines
19 KiB
Go
757 lines
19 KiB
Go
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||
|
// source: proto/pbautoconf/auto_config.proto
|
||
|
|
||
|
package pbautoconf
|
||
|
|
||
|
import (
|
||
|
fmt "fmt"
|
||
|
proto "github.com/golang/protobuf/proto"
|
||
|
pbconfig "github.com/hashicorp/consul/proto/pbconfig"
|
||
|
io "io"
|
||
|
math "math"
|
||
|
)
|
||
|
|
||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||
|
var _ = proto.Marshal
|
||
|
var _ = fmt.Errorf
|
||
|
var _ = math.Inf
|
||
|
|
||
|
// This is a compile-time assertion to ensure that this generated file
|
||
|
// is compatible with the proto package it is being compiled against.
|
||
|
// A compilation error at this line likely means your copy of the
|
||
|
// proto package needs to be updated.
|
||
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||
|
|
||
|
// AutoConfigRequest is the data structure to be sent along with the
|
||
|
// AutoConfig.InitialConfiguration RPC
|
||
|
type AutoConfigRequest struct {
|
||
|
// Datacenter is the local datacenter name. This wont actually be set by clients
|
||
|
// but rather will be set by the servers to allow for forwarding to
|
||
|
// the leader. If it ever happens to be set and differs from the local datacenters
|
||
|
// name then an error should be returned.
|
||
|
Datacenter string `protobuf:"bytes,1,opt,name=Datacenter,proto3" json:"Datacenter,omitempty"`
|
||
|
// Node is the node name that the requester would like to assume
|
||
|
// the identity of.
|
||
|
Node string `protobuf:"bytes,2,opt,name=Node,proto3" json:"Node,omitempty"`
|
||
|
// Segment is the network segment that the requester would like to join
|
||
|
Segment string `protobuf:"bytes,4,opt,name=Segment,proto3" json:"Segment,omitempty"`
|
||
|
// JWT is a signed JSON Web Token used to authorize the request
|
||
|
JWT string `protobuf:"bytes,5,opt,name=JWT,proto3" json:"JWT,omitempty"`
|
||
|
// ConsulToken is a Consul ACL token that the agent requesting the
|
||
|
// configuration already has.
|
||
|
ConsulToken string `protobuf:"bytes,6,opt,name=ConsulToken,proto3" json:"ConsulToken,omitempty"`
|
||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||
|
XXX_unrecognized []byte `json:"-"`
|
||
|
XXX_sizecache int32 `json:"-"`
|
||
|
}
|
||
|
|
||
|
func (m *AutoConfigRequest) Reset() { *m = AutoConfigRequest{} }
|
||
|
func (m *AutoConfigRequest) String() string { return proto.CompactTextString(m) }
|
||
|
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)
|
||
|
}
|
||
|
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.MarshalTo(b)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return b[:n], nil
|
||
|
}
|
||
|
}
|
||
|
func (m *AutoConfigRequest) XXX_Merge(src proto.Message) {
|
||
|
xxx_messageInfo_AutoConfigRequest.Merge(m, src)
|
||
|
}
|
||
|
func (m *AutoConfigRequest) XXX_Size() int {
|
||
|
return m.Size()
|
||
|
}
|
||
|
func (m *AutoConfigRequest) XXX_DiscardUnknown() {
|
||
|
xxx_messageInfo_AutoConfigRequest.DiscardUnknown(m)
|
||
|
}
|
||
|
|
||
|
var xxx_messageInfo_AutoConfigRequest proto.InternalMessageInfo
|
||
|
|
||
|
func (m *AutoConfigRequest) GetDatacenter() string {
|
||
|
if m != nil {
|
||
|
return m.Datacenter
|
||
|
}
|
||
|
return ""
|
||
|
}
|
||
|
|
||
|
func (m *AutoConfigRequest) GetNode() string {
|
||
|
if m != nil {
|
||
|
return m.Node
|
||
|
}
|
||
|
return ""
|
||
|
}
|
||
|
|
||
|
func (m *AutoConfigRequest) GetSegment() string {
|
||
|
if m != nil {
|
||
|
return m.Segment
|
||
|
}
|
||
|
return ""
|
||
|
}
|
||
|
|
||
|
func (m *AutoConfigRequest) GetJWT() string {
|
||
|
if m != nil {
|
||
|
return m.JWT
|
||
|
}
|
||
|
return ""
|
||
|
}
|
||
|
|
||
|
func (m *AutoConfigRequest) GetConsulToken() string {
|
||
|
if m != nil {
|
||
|
return m.ConsulToken
|
||
|
}
|
||
|
return ""
|
||
|
}
|
||
|
|
||
|
// AutoConfigResponse is the data structure sent in response to a AutoConfig.InitialConfiguration request
|
||
|
type AutoConfigResponse struct {
|
||
|
Config *pbconfig.Config `protobuf:"bytes,1,opt,name=Config,proto3" json:"Config,omitempty"`
|
||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||
|
XXX_unrecognized []byte `json:"-"`
|
||
|
XXX_sizecache int32 `json:"-"`
|
||
|
}
|
||
|
|
||
|
func (m *AutoConfigResponse) Reset() { *m = AutoConfigResponse{} }
|
||
|
func (m *AutoConfigResponse) String() string { return proto.CompactTextString(m) }
|
||
|
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)
|
||
|
}
|
||
|
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.MarshalTo(b)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return b[:n], nil
|
||
|
}
|
||
|
}
|
||
|
func (m *AutoConfigResponse) XXX_Merge(src proto.Message) {
|
||
|
xxx_messageInfo_AutoConfigResponse.Merge(m, src)
|
||
|
}
|
||
|
func (m *AutoConfigResponse) XXX_Size() int {
|
||
|
return m.Size()
|
||
|
}
|
||
|
func (m *AutoConfigResponse) XXX_DiscardUnknown() {
|
||
|
xxx_messageInfo_AutoConfigResponse.DiscardUnknown(m)
|
||
|
}
|
||
|
|
||
|
var xxx_messageInfo_AutoConfigResponse proto.InternalMessageInfo
|
||
|
|
||
|
func (m *AutoConfigResponse) GetConfig() *pbconfig.Config {
|
||
|
if m != nil {
|
||
|
return m.Config
|
||
|
}
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
proto.RegisterType((*AutoConfigRequest)(nil), "autoconf.AutoConfigRequest")
|
||
|
proto.RegisterType((*AutoConfigResponse)(nil), "autoconf.AutoConfigResponse")
|
||
|
}
|
||
|
|
||
|
func init() { proto.RegisterFile("proto/pbautoconf/auto_config.proto", fileDescriptor_ccc5af992e5daf69) }
|
||
|
|
||
|
var fileDescriptor_ccc5af992e5daf69 = []byte{
|
||
|
// 256 bytes of a gzipped FileDescriptorProto
|
||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2a, 0x28, 0xca, 0x2f,
|
||
|
0xc9, 0xd7, 0x2f, 0x48, 0x4a, 0x2c, 0x2d, 0xc9, 0x4f, 0xce, 0xcf, 0x4b, 0xd3, 0x07, 0x31, 0xe2,
|
||
|
0x41, 0xac, 0xcc, 0x74, 0x3d, 0xb0, 0xa4, 0x10, 0x07, 0x4c, 0x4e, 0x4a, 0x1a, 0xa6, 0x1a, 0x22,
|
||
|
0xaf, 0x8f, 0xac, 0x4c, 0x69, 0x2a, 0x23, 0x97, 0xa0, 0x63, 0x69, 0x49, 0xbe, 0x33, 0x58, 0x30,
|
||
|
0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44, 0x48, 0x8e, 0x8b, 0xcb, 0x25, 0xb1, 0x24, 0x31, 0x39,
|
||
|
0x35, 0xaf, 0x24, 0xb5, 0x48, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0x49, 0x44, 0x48, 0x88,
|
||
|
0x8b, 0xc5, 0x2f, 0x3f, 0x25, 0x55, 0x82, 0x09, 0x2c, 0x03, 0x66, 0x0b, 0x49, 0x70, 0xb1, 0x07,
|
||
|
0xa7, 0xa6, 0xe7, 0xa6, 0xe6, 0x95, 0x48, 0xb0, 0x80, 0x85, 0x61, 0x5c, 0x21, 0x01, 0x2e, 0x66,
|
||
|
0xaf, 0xf0, 0x10, 0x09, 0x56, 0xb0, 0x28, 0x88, 0x29, 0xa4, 0xc0, 0xc5, 0xed, 0x9c, 0x9f, 0x57,
|
||
|
0x5c, 0x9a, 0x13, 0x92, 0x9f, 0x9d, 0x9a, 0x27, 0xc1, 0x06, 0x96, 0x41, 0x16, 0x52, 0xb2, 0xe1,
|
||
|
0x12, 0x42, 0x76, 0x56, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x90, 0x1a, 0x17, 0x1b, 0x44, 0x04,
|
||
|
0xec, 0x26, 0x6e, 0x23, 0x3e, 0x3d, 0xa8, 0x67, 0xa0, 0xea, 0xa0, 0xb2, 0x4e, 0x76, 0x27, 0x1e,
|
||
|
0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x8c, 0xc7, 0x72, 0x0c, 0x51,
|
||
|
0x3a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x19, 0x89, 0xc5, 0x19,
|
||
|
0x99, 0xc9, 0xf9, 0x45, 0x05, 0xa0, 0xa0, 0x28, 0x2e, 0xcd, 0xd1, 0x47, 0x0f, 0xce, 0x24, 0x36,
|
||
|
0xb0, 0x88, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x46, 0x7e, 0xde, 0xed, 0x69, 0x01, 0x00, 0x00,
|
||
|
}
|
||
|
|
||
|
func (m *AutoConfigRequest) Marshal() (dAtA []byte, err error) {
|
||
|
size := m.Size()
|
||
|
dAtA = make([]byte, size)
|
||
|
n, err := m.MarshalTo(dAtA)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return dAtA[:n], nil
|
||
|
}
|
||
|
|
||
|
func (m *AutoConfigRequest) MarshalTo(dAtA []byte) (int, error) {
|
||
|
var i int
|
||
|
_ = i
|
||
|
var l int
|
||
|
_ = l
|
||
|
if len(m.Datacenter) > 0 {
|
||
|
dAtA[i] = 0xa
|
||
|
i++
|
||
|
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 m.XXX_unrecognized != nil {
|
||
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||
|
}
|
||
|
return i, nil
|
||
|
}
|
||
|
|
||
|
func (m *AutoConfigResponse) Marshal() (dAtA []byte, err error) {
|
||
|
size := m.Size()
|
||
|
dAtA = make([]byte, size)
|
||
|
n, err := m.MarshalTo(dAtA)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return dAtA[:n], nil
|
||
|
}
|
||
|
|
||
|
func (m *AutoConfigResponse) MarshalTo(dAtA []byte) (int, error) {
|
||
|
var i int
|
||
|
_ = i
|
||
|
var l int
|
||
|
_ = l
|
||
|
if m.Config != nil {
|
||
|
dAtA[i] = 0xa
|
||
|
i++
|
||
|
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.XXX_unrecognized != nil {
|
||
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||
|
}
|
||
|
return i, nil
|
||
|
}
|
||
|
|
||
|
func encodeVarintAutoConfig(dAtA []byte, offset int, v uint64) int {
|
||
|
for v >= 1<<7 {
|
||
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||
|
v >>= 7
|
||
|
offset++
|
||
|
}
|
||
|
dAtA[offset] = uint8(v)
|
||
|
return offset + 1
|
||
|
}
|
||
|
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))
|
||
|
}
|
||
|
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.XXX_unrecognized != nil {
|
||
|
n += len(m.XXX_unrecognized)
|
||
|
}
|
||
|
return n
|
||
|
}
|
||
|
|
||
|
func sovAutoConfig(x uint64) (n int) {
|
||
|
for {
|
||
|
n++
|
||
|
x >>= 7
|
||
|
if x == 0 {
|
||
|
break
|
||
|
}
|
||
|
}
|
||
|
return n
|
||
|
}
|
||
|
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
|
||
|
default:
|
||
|
iNdEx = preIndex
|
||
|
skippy, err := skipAutoConfig(dAtA[iNdEx:])
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
if skippy < 0 {
|
||
|
return ErrInvalidLengthAutoConfig
|
||
|
}
|
||
|
if (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
|
||
|
default:
|
||
|
iNdEx = preIndex
|
||
|
skippy, err := skipAutoConfig(dAtA[iNdEx:])
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
if skippy < 0 {
|
||
|
return ErrInvalidLengthAutoConfig
|
||
|
}
|
||
|
if (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
|
||
|
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
|
||
|
}
|
||
|
}
|
||
|
return iNdEx, nil
|
||
|
case 1:
|
||
|
iNdEx += 8
|
||
|
return iNdEx, nil
|
||
|
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
|
||
|
if iNdEx < 0 {
|
||
|
return 0, ErrInvalidLengthAutoConfig
|
||
|
}
|
||
|
return iNdEx, nil
|
||
|
case 3:
|
||
|
for {
|
||
|
var innerWire uint64
|
||
|
var start int = iNdEx
|
||
|
for shift := uint(0); ; shift += 7 {
|
||
|
if shift >= 64 {
|
||
|
return 0, ErrIntOverflowAutoConfig
|
||
|
}
|
||
|
if iNdEx >= l {
|
||
|
return 0, io.ErrUnexpectedEOF
|
||
|
}
|
||
|
b := dAtA[iNdEx]
|
||
|
iNdEx++
|
||
|
innerWire |= (uint64(b) & 0x7F) << shift
|
||
|
if b < 0x80 {
|
||
|
break
|
||
|
}
|
||
|
}
|
||
|
innerWireType := int(innerWire & 0x7)
|
||
|
if innerWireType == 4 {
|
||
|
break
|
||
|
}
|
||
|
next, err := skipAutoConfig(dAtA[start:])
|
||
|
if err != nil {
|
||
|
return 0, err
|
||
|
}
|
||
|
iNdEx = start + next
|
||
|
if iNdEx < 0 {
|
||
|
return 0, ErrInvalidLengthAutoConfig
|
||
|
}
|
||
|
}
|
||
|
return iNdEx, nil
|
||
|
case 4:
|
||
|
return iNdEx, nil
|
||
|
case 5:
|
||
|
iNdEx += 4
|
||
|
return iNdEx, nil
|
||
|
default:
|
||
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||
|
}
|
||
|
}
|
||
|
panic("unreachable")
|
||
|
}
|
||
|
|
||
|
var (
|
||
|
ErrInvalidLengthAutoConfig = fmt.Errorf("proto: negative length found during unmarshaling")
|
||
|
ErrIntOverflowAutoConfig = fmt.Errorf("proto: integer overflow")
|
||
|
)
|