mirror of https://github.com/hashicorp/consul
758 lines
19 KiB
Go
758 lines
19 KiB
Go
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||
|
// source: agent/agentpb/auto_config.proto
|
||
|
|
||
|
package agentpb
|
||
|
|
||
|
import (
|
||
|
fmt "fmt"
|
||
|
proto "github.com/golang/protobuf/proto"
|
||
|
config "github.com/hashicorp/consul/agent/agentpb/config"
|
||
|
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
|
||
|
// Cluster.AutoConfig 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_c842365210d144b0, []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 Cluster.AutoConfig request
|
||
|
type AutoConfigResponse struct {
|
||
|
Config *config.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_c842365210d144b0, []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() *config.Config {
|
||
|
if m != nil {
|
||
|
return m.Config
|
||
|
}
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
proto.RegisterType((*AutoConfigRequest)(nil), "agentpb.AutoConfigRequest")
|
||
|
proto.RegisterType((*AutoConfigResponse)(nil), "agentpb.AutoConfigResponse")
|
||
|
}
|
||
|
|
||
|
func init() { proto.RegisterFile("agent/agentpb/auto_config.proto", fileDescriptor_c842365210d144b0) }
|
||
|
|
||
|
var fileDescriptor_c842365210d144b0 = []byte{
|
||
|
// 258 bytes of a gzipped FileDescriptorProto
|
||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0x4c, 0x4f, 0xcd,
|
||
|
0x2b, 0xd1, 0x07, 0x93, 0x05, 0x49, 0xfa, 0x89, 0xa5, 0x25, 0xf9, 0xf1, 0xc9, 0xf9, 0x79, 0x69,
|
||
|
0x99, 0xe9, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xec, 0x50, 0x29, 0x29, 0x45, 0x54, 0x95,
|
||
|
0x10, 0x45, 0xfa, 0xc8, 0x6a, 0x95, 0xa6, 0x32, 0x72, 0x09, 0x3a, 0x96, 0x96, 0xe4, 0x3b, 0x83,
|
||
|
0x05, 0x83, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0xe4, 0xb8, 0xb8, 0x5c, 0x12, 0x4b, 0x12,
|
||
|
0x93, 0x53, 0xf3, 0x4a, 0x52, 0x8b, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x90, 0x44, 0x84,
|
||
|
0x84, 0xb8, 0x58, 0xfc, 0xf2, 0x53, 0x52, 0x25, 0x98, 0xc0, 0x32, 0x60, 0xb6, 0x90, 0x04, 0x17,
|
||
|
0x7b, 0x70, 0x6a, 0x7a, 0x6e, 0x6a, 0x5e, 0x89, 0x04, 0x0b, 0x58, 0x18, 0xc6, 0x15, 0x12, 0xe0,
|
||
|
0x62, 0xf6, 0x0a, 0x0f, 0x91, 0x60, 0x05, 0x8b, 0x82, 0x98, 0x42, 0x0a, 0x5c, 0xdc, 0xce, 0xf9,
|
||
|
0x79, 0xc5, 0xa5, 0x39, 0x21, 0xf9, 0xd9, 0xa9, 0x79, 0x12, 0x6c, 0x60, 0x19, 0x64, 0x21, 0x25,
|
||
|
0x1b, 0x2e, 0x21, 0x64, 0x67, 0x15, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x0a, 0xa9, 0x71, 0xb1, 0x41,
|
||
|
0x44, 0xc0, 0x6e, 0xe2, 0x36, 0xe2, 0xd3, 0x83, 0x7a, 0x06, 0xaa, 0x0e, 0x2a, 0xeb, 0x64, 0x7d,
|
||
|
0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0xce, 0x78, 0x2c, 0xc7,
|
||
|
0x10, 0xa5, 0x99, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x91, 0x58,
|
||
|
0x9c, 0x91, 0x99, 0x9c, 0x5f, 0x54, 0x00, 0x0a, 0x8a, 0xe2, 0xd2, 0x1c, 0x7d, 0x94, 0x60, 0x4a,
|
||
|
0x62, 0x03, 0x87, 0x8c, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x8c, 0xf1, 0x75, 0x68, 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 = &config.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")
|
||
|
)
|