From f7f9879dabc9b3c212fbc6b5f563030ab70e9b9c Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Fri, 18 Sep 2020 14:02:46 -0400 Subject: [PATCH] proto: split pbservice into multiple files There are many types in this package, splitting them into node, service, healthcheck helps show the relationship between these types. --- proto/pbservice/healthcheck.pb.binary.go | 48 + proto/pbservice/healthcheck.pb.go | 3495 +++++++ proto/pbservice/healthcheck.proto | 144 + proto/pbservice/node.pb.binary.go | 38 + proto/pbservice/node.pb.go | 2205 ++++ proto/pbservice/node.proto | 115 + ...ucts.pb.binary.go => service.pb.binary.go} | 132 +- proto/pbservice/service.pb.go | 3664 +++++++ proto/pbservice/service.proto | 256 + proto/pbservice/structs.pb.go | 8942 ----------------- proto/pbservice/structs.proto | 403 - proto/pbsubscribe/subscribe.pb.go | 68 +- proto/pbsubscribe/subscribe.proto | 2 +- 13 files changed, 10031 insertions(+), 9481 deletions(-) create mode 100644 proto/pbservice/healthcheck.pb.binary.go create mode 100644 proto/pbservice/healthcheck.pb.go create mode 100644 proto/pbservice/healthcheck.proto create mode 100644 proto/pbservice/node.pb.binary.go create mode 100644 proto/pbservice/node.pb.go create mode 100644 proto/pbservice/node.proto rename proto/pbservice/{structs.pb.binary.go => service.pb.binary.go} (57%) create mode 100644 proto/pbservice/service.pb.go create mode 100644 proto/pbservice/service.proto delete mode 100644 proto/pbservice/structs.pb.go delete mode 100644 proto/pbservice/structs.proto diff --git a/proto/pbservice/healthcheck.pb.binary.go b/proto/pbservice/healthcheck.pb.binary.go new file mode 100644 index 0000000000..f46fb01e0b --- /dev/null +++ b/proto/pbservice/healthcheck.pb.binary.go @@ -0,0 +1,48 @@ +// Code generated by protoc-gen-go-binary. DO NOT EDIT. +// source: proto/pbservice/healthcheck.proto + +package pbservice + +import ( + "github.com/golang/protobuf/proto" +) + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *HealthCheck) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *HealthCheck) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *HeaderValue) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *HeaderValue) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *HealthCheckDefinition) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *HealthCheckDefinition) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *CheckType) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *CheckType) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} diff --git a/proto/pbservice/healthcheck.pb.go b/proto/pbservice/healthcheck.pb.go new file mode 100644 index 0000000000..676d8c2b9e --- /dev/null +++ b/proto/pbservice/healthcheck.pb.go @@ -0,0 +1,3495 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: proto/pbservice/healthcheck.proto + +package pbservice + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + proto "github.com/golang/protobuf/proto" + pbcommon "github.com/hashicorp/consul/proto/pbcommon" + github_com_hashicorp_consul_types "github.com/hashicorp/consul/types" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// HealthCheck represents a single check on a given node +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.HealthCheck +// output=healthcheck.gen.go +// name=Structs +type HealthCheck struct { + Node string `protobuf:"bytes,1,opt,name=Node,proto3" json:"Node,omitempty"` + CheckID github_com_hashicorp_consul_types.CheckID `protobuf:"bytes,2,opt,name=CheckID,proto3,casttype=github.com/hashicorp/consul/types.CheckID" json:"CheckID,omitempty"` + Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"` + Status string `protobuf:"bytes,4,opt,name=Status,proto3" json:"Status,omitempty"` + Notes string `protobuf:"bytes,5,opt,name=Notes,proto3" json:"Notes,omitempty"` + Output string `protobuf:"bytes,6,opt,name=Output,proto3" json:"Output,omitempty"` + ServiceID string `protobuf:"bytes,7,opt,name=ServiceID,proto3" json:"ServiceID,omitempty"` + ServiceName string `protobuf:"bytes,8,opt,name=ServiceName,proto3" json:"ServiceName,omitempty"` + ServiceTags []string `protobuf:"bytes,9,rep,name=ServiceTags,proto3" json:"ServiceTags,omitempty"` + Type string `protobuf:"bytes,12,opt,name=Type,proto3" json:"Type,omitempty"` + Definition HealthCheckDefinition `protobuf:"bytes,10,opt,name=Definition,proto3" json:"Definition"` + // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs + pbcommon.RaftIndex `protobuf:"bytes,11,opt,name=RaftIndex,proto3,embedded=RaftIndex" json:"RaftIndex"` + // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs + EnterpriseMeta pbcommon.EnterpriseMeta `protobuf:"bytes,13,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta"` +} + +func (m *HealthCheck) Reset() { *m = HealthCheck{} } +func (m *HealthCheck) String() string { return proto.CompactTextString(m) } +func (*HealthCheck) ProtoMessage() {} +func (*HealthCheck) Descriptor() ([]byte, []int) { + return fileDescriptor_8a6f7448747c9fbe, []int{0} +} +func (m *HealthCheck) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HealthCheck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HealthCheck.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HealthCheck) XXX_Merge(src proto.Message) { + xxx_messageInfo_HealthCheck.Merge(m, src) +} +func (m *HealthCheck) XXX_Size() int { + return m.Size() +} +func (m *HealthCheck) XXX_DiscardUnknown() { + xxx_messageInfo_HealthCheck.DiscardUnknown(m) +} + +var xxx_messageInfo_HealthCheck proto.InternalMessageInfo + +type HeaderValue struct { + Value []string `protobuf:"bytes,1,rep,name=Value,proto3" json:"Value,omitempty"` +} + +func (m *HeaderValue) Reset() { *m = HeaderValue{} } +func (m *HeaderValue) String() string { return proto.CompactTextString(m) } +func (*HeaderValue) ProtoMessage() {} +func (*HeaderValue) Descriptor() ([]byte, []int) { + return fileDescriptor_8a6f7448747c9fbe, []int{1} +} +func (m *HeaderValue) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HeaderValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HeaderValue.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HeaderValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_HeaderValue.Merge(m, src) +} +func (m *HeaderValue) XXX_Size() int { + return m.Size() +} +func (m *HeaderValue) XXX_DiscardUnknown() { + xxx_messageInfo_HeaderValue.DiscardUnknown(m) +} + +var xxx_messageInfo_HeaderValue proto.InternalMessageInfo + +// HealthCheckDefinition of a single HealthCheck. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.HealthCheckDefinition +// output=healthcheck.gen.go +// name=Structs +type HealthCheckDefinition struct { + HTTP string `protobuf:"bytes,1,opt,name=HTTP,proto3" json:"HTTP,omitempty"` + TLSSkipVerify bool `protobuf:"varint,2,opt,name=TLSSkipVerify,proto3" json:"TLSSkipVerify,omitempty"` + // mog: func-to=MapHeadersToStructs func-from=NewMapHeadersFromStructs + Header map[string]HeaderValue `protobuf:"bytes,3,rep,name=Header,proto3" json:"Header" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Method string `protobuf:"bytes,4,opt,name=Method,proto3" json:"Method,omitempty"` + Body string `protobuf:"bytes,18,opt,name=Body,proto3" json:"Body,omitempty"` + TCP string `protobuf:"bytes,5,opt,name=TCP,proto3" json:"TCP,omitempty"` + Interval time.Duration `protobuf:"bytes,6,opt,name=Interval,proto3,stdduration" json:"Interval"` + // mog: func-to=uint func-from=uint32 + OutputMaxSize uint32 `protobuf:"varint,9,opt,name=OutputMaxSize,proto3" json:"OutputMaxSize,omitempty"` + Timeout time.Duration `protobuf:"bytes,7,opt,name=Timeout,proto3,stdduration" json:"Timeout"` + DeregisterCriticalServiceAfter time.Duration `protobuf:"bytes,8,opt,name=DeregisterCriticalServiceAfter,proto3,stdduration" json:"DeregisterCriticalServiceAfter"` + ScriptArgs []string `protobuf:"bytes,10,rep,name=ScriptArgs,proto3" json:"ScriptArgs,omitempty"` + DockerContainerID string `protobuf:"bytes,11,opt,name=DockerContainerID,proto3" json:"DockerContainerID,omitempty"` + Shell string `protobuf:"bytes,12,opt,name=Shell,proto3" json:"Shell,omitempty"` + GRPC string `protobuf:"bytes,13,opt,name=GRPC,proto3" json:"GRPC,omitempty"` + GRPCUseTLS bool `protobuf:"varint,14,opt,name=GRPCUseTLS,proto3" json:"GRPCUseTLS,omitempty"` + AliasNode string `protobuf:"bytes,15,opt,name=AliasNode,proto3" json:"AliasNode,omitempty"` + AliasService string `protobuf:"bytes,16,opt,name=AliasService,proto3" json:"AliasService,omitempty"` + TTL time.Duration `protobuf:"bytes,17,opt,name=TTL,proto3,stdduration" json:"TTL"` +} + +func (m *HealthCheckDefinition) Reset() { *m = HealthCheckDefinition{} } +func (m *HealthCheckDefinition) String() string { return proto.CompactTextString(m) } +func (*HealthCheckDefinition) ProtoMessage() {} +func (*HealthCheckDefinition) Descriptor() ([]byte, []int) { + return fileDescriptor_8a6f7448747c9fbe, []int{2} +} +func (m *HealthCheckDefinition) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HealthCheckDefinition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HealthCheckDefinition.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HealthCheckDefinition) XXX_Merge(src proto.Message) { + xxx_messageInfo_HealthCheckDefinition.Merge(m, src) +} +func (m *HealthCheckDefinition) XXX_Size() int { + return m.Size() +} +func (m *HealthCheckDefinition) XXX_DiscardUnknown() { + xxx_messageInfo_HealthCheckDefinition.DiscardUnknown(m) +} + +var xxx_messageInfo_HealthCheckDefinition proto.InternalMessageInfo + +// CheckType is used to create either the CheckMonitor or the CheckTTL. +// The following types are supported: Script, HTTP, TCP, Docker, TTL, GRPC, +// Alias. Script, +// HTTP, Docker, TCP and GRPC all require Interval. Only one of the types may +// to be provided: TTL or Script/Interval or HTTP/Interval or TCP/Interval or +// Docker/Interval or GRPC/Interval or AliasService. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.CheckType +// output=healthcheck.gen.go +// name=Structs +type CheckType struct { + CheckID github_com_hashicorp_consul_types.CheckID `protobuf:"bytes,1,opt,name=CheckID,proto3,casttype=github.com/hashicorp/consul/types.CheckID" json:"CheckID,omitempty"` + Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` + Status string `protobuf:"bytes,3,opt,name=Status,proto3" json:"Status,omitempty"` + Notes string `protobuf:"bytes,4,opt,name=Notes,proto3" json:"Notes,omitempty"` + ScriptArgs []string `protobuf:"bytes,5,rep,name=ScriptArgs,proto3" json:"ScriptArgs,omitempty"` + HTTP string `protobuf:"bytes,6,opt,name=HTTP,proto3" json:"HTTP,omitempty"` + // mog: func-to=MapHeadersToStructs func-from=NewMapHeadersFromStructs + Header map[string]HeaderValue `protobuf:"bytes,20,rep,name=Header,proto3" json:"Header" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Method string `protobuf:"bytes,7,opt,name=Method,proto3" json:"Method,omitempty"` + Body string `protobuf:"bytes,26,opt,name=Body,proto3" json:"Body,omitempty"` + TCP string `protobuf:"bytes,8,opt,name=TCP,proto3" json:"TCP,omitempty"` + Interval time.Duration `protobuf:"bytes,9,opt,name=Interval,proto3,stdduration" json:"Interval"` + AliasNode string `protobuf:"bytes,10,opt,name=AliasNode,proto3" json:"AliasNode,omitempty"` + AliasService string `protobuf:"bytes,11,opt,name=AliasService,proto3" json:"AliasService,omitempty"` + DockerContainerID string `protobuf:"bytes,12,opt,name=DockerContainerID,proto3" json:"DockerContainerID,omitempty"` + Shell string `protobuf:"bytes,13,opt,name=Shell,proto3" json:"Shell,omitempty"` + GRPC string `protobuf:"bytes,14,opt,name=GRPC,proto3" json:"GRPC,omitempty"` + GRPCUseTLS bool `protobuf:"varint,15,opt,name=GRPCUseTLS,proto3" json:"GRPCUseTLS,omitempty"` + TLSSkipVerify bool `protobuf:"varint,16,opt,name=TLSSkipVerify,proto3" json:"TLSSkipVerify,omitempty"` + Timeout time.Duration `protobuf:"bytes,17,opt,name=Timeout,proto3,stdduration" json:"Timeout"` + TTL time.Duration `protobuf:"bytes,18,opt,name=TTL,proto3,stdduration" json:"TTL"` + // mog: func-to=int func-from=int32 + SuccessBeforePassing int32 `protobuf:"varint,21,opt,name=SuccessBeforePassing,proto3" json:"SuccessBeforePassing,omitempty"` + // mog: func-to=int func-from=int32 + FailuresBeforeCritical int32 `protobuf:"varint,22,opt,name=FailuresBeforeCritical,proto3" json:"FailuresBeforeCritical,omitempty"` + // Definition fields used when exposing checks through a proxy + ProxyHTTP string `protobuf:"bytes,23,opt,name=ProxyHTTP,proto3" json:"ProxyHTTP,omitempty"` + ProxyGRPC string `protobuf:"bytes,24,opt,name=ProxyGRPC,proto3" json:"ProxyGRPC,omitempty"` + // DeregisterCriticalServiceAfter, if >0, will cause the associated + // service, if any, to be deregistered if this check is critical for + // longer than this duration. + DeregisterCriticalServiceAfter time.Duration `protobuf:"bytes,19,opt,name=DeregisterCriticalServiceAfter,proto3,stdduration" json:"DeregisterCriticalServiceAfter"` + // mog: func-to=int func-from=int32 + OutputMaxSize int32 `protobuf:"varint,25,opt,name=OutputMaxSize,proto3" json:"OutputMaxSize,omitempty"` +} + +func (m *CheckType) Reset() { *m = CheckType{} } +func (m *CheckType) String() string { return proto.CompactTextString(m) } +func (*CheckType) ProtoMessage() {} +func (*CheckType) Descriptor() ([]byte, []int) { + return fileDescriptor_8a6f7448747c9fbe, []int{3} +} +func (m *CheckType) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CheckType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CheckType.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CheckType) XXX_Merge(src proto.Message) { + xxx_messageInfo_CheckType.Merge(m, src) +} +func (m *CheckType) XXX_Size() int { + return m.Size() +} +func (m *CheckType) XXX_DiscardUnknown() { + xxx_messageInfo_CheckType.DiscardUnknown(m) +} + +var xxx_messageInfo_CheckType proto.InternalMessageInfo + +func init() { + proto.RegisterType((*HealthCheck)(nil), "pbservice.HealthCheck") + proto.RegisterType((*HeaderValue)(nil), "pbservice.HeaderValue") + proto.RegisterType((*HealthCheckDefinition)(nil), "pbservice.HealthCheckDefinition") + proto.RegisterMapType((map[string]HeaderValue)(nil), "pbservice.HealthCheckDefinition.HeaderEntry") + proto.RegisterType((*CheckType)(nil), "pbservice.CheckType") + proto.RegisterMapType((map[string]HeaderValue)(nil), "pbservice.CheckType.HeaderEntry") +} + +func init() { proto.RegisterFile("proto/pbservice/healthcheck.proto", fileDescriptor_8a6f7448747c9fbe) } + +var fileDescriptor_8a6f7448747c9fbe = []byte{ + // 1009 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x6f, 0xe3, 0x44, + 0x18, 0x8e, 0x9b, 0x36, 0x8d, 0x27, 0x6d, 0xb7, 0x1d, 0xba, 0x65, 0xb6, 0x20, 0x27, 0x04, 0x0e, + 0x41, 0x14, 0x47, 0x2a, 0x02, 0x01, 0x12, 0xa0, 0x26, 0xd9, 0x8f, 0xa0, 0x76, 0x09, 0x8e, 0xd9, + 0x03, 0x17, 0xe4, 0x3a, 0x93, 0xc4, 0x8a, 0xe3, 0x89, 0xc6, 0xe3, 0xaa, 0xe1, 0xca, 0x1f, 0xe0, + 0xb8, 0x3f, 0xa9, 0xc7, 0x8a, 0x13, 0xa7, 0x02, 0xed, 0x99, 0x3f, 0xc0, 0x09, 0xcd, 0x3b, 0x76, + 0xea, 0x6c, 0xbc, 0xa4, 0xac, 0x76, 0x4f, 0x7e, 0xe7, 0xfd, 0x98, 0x8f, 0xf7, 0x7d, 0x9e, 0x27, + 0x41, 0xef, 0x4d, 0x38, 0x13, 0xac, 0x3e, 0x39, 0x0d, 0x29, 0x3f, 0xf3, 0x5c, 0x5a, 0x1f, 0x52, + 0xc7, 0x17, 0x43, 0x77, 0x48, 0xdd, 0x91, 0x09, 0x31, 0xac, 0xcf, 0x82, 0xfb, 0xc6, 0x80, 0xb1, + 0x81, 0x4f, 0xeb, 0x10, 0x38, 0x8d, 0xfa, 0xf5, 0x5e, 0xc4, 0x1d, 0xe1, 0xb1, 0x40, 0xa5, 0xee, + 0xbf, 0x93, 0xec, 0xe6, 0xb2, 0xf1, 0x98, 0x05, 0x75, 0xf5, 0x89, 0x83, 0xe5, 0xcc, 0xe0, 0x4f, + 0x2c, 0x0c, 0xe3, 0x84, 0xdd, 0x01, 0x1b, 0x30, 0x95, 0x24, 0x2d, 0xe5, 0xad, 0xfe, 0xb2, 0x8a, + 0x4a, 0x4f, 0xe0, 0x52, 0x4d, 0x79, 0x29, 0x8c, 0xd1, 0xea, 0x53, 0xd6, 0xa3, 0x44, 0xab, 0x68, + 0x35, 0xdd, 0x02, 0x1b, 0x3f, 0x46, 0xeb, 0x10, 0x6c, 0xb7, 0xc8, 0x8a, 0x74, 0x37, 0x3e, 0xfe, + 0xe7, 0xaa, 0xfc, 0xe1, 0xc0, 0x13, 0xc3, 0xe8, 0xd4, 0x74, 0xd9, 0xb8, 0x3e, 0x74, 0xc2, 0xa1, + 0xe7, 0x32, 0x3e, 0xa9, 0xbb, 0x2c, 0x08, 0x23, 0xbf, 0x2e, 0xa6, 0x13, 0x1a, 0x9a, 0x71, 0x91, + 0x95, 0x54, 0xc3, 0xe6, 0xce, 0x98, 0x92, 0x7c, 0xbc, 0xb9, 0x33, 0xa6, 0x78, 0x0f, 0x15, 0xba, + 0xc2, 0x11, 0x51, 0x48, 0x56, 0xc1, 0x1b, 0xaf, 0xf0, 0x2e, 0x5a, 0x7b, 0xca, 0x04, 0x0d, 0xc9, + 0x1a, 0xb8, 0xd5, 0x42, 0x66, 0x7f, 0x17, 0x89, 0x49, 0x24, 0x48, 0x41, 0x65, 0xab, 0x15, 0x7e, + 0x17, 0xe9, 0x5d, 0xd5, 0xc5, 0x76, 0x8b, 0xac, 0x43, 0xe8, 0xd6, 0x81, 0x2b, 0xa8, 0x14, 0x2f, + 0xe0, 0xf8, 0x22, 0xc4, 0xd3, 0xae, 0x54, 0x86, 0xed, 0x0c, 0x42, 0xa2, 0x57, 0xf2, 0xa9, 0x0c, + 0xe9, 0x92, 0x77, 0xb7, 0xa7, 0x13, 0x4a, 0x36, 0xd4, 0xdd, 0xa5, 0x8d, 0x1f, 0x21, 0xd4, 0xa2, + 0x7d, 0x2f, 0xf0, 0xe4, 0x90, 0x08, 0xaa, 0x68, 0xb5, 0xd2, 0x61, 0xc5, 0x9c, 0x0d, 0xd4, 0x4c, + 0x35, 0xf6, 0x36, 0xaf, 0xb1, 0x7a, 0x71, 0x55, 0xce, 0x59, 0xa9, 0x4a, 0xfc, 0x05, 0xd2, 0x2d, + 0xa7, 0x2f, 0xda, 0x41, 0x8f, 0x9e, 0x93, 0x12, 0x6c, 0xb3, 0x63, 0xc6, 0xd3, 0x9d, 0x05, 0x1a, + 0x45, 0x59, 0x77, 0x79, 0x55, 0xd6, 0xac, 0xdb, 0x6c, 0xdc, 0x42, 0x5b, 0x0f, 0x03, 0x41, 0xf9, + 0x84, 0x7b, 0x21, 0x3d, 0xa1, 0xc2, 0x21, 0x9b, 0x50, 0xbf, 0x97, 0xd4, 0xcf, 0x47, 0xe3, 0xc3, + 0x5f, 0xa8, 0xa9, 0xbe, 0x0f, 0x20, 0xe8, 0x51, 0xfe, 0xcc, 0xf1, 0x23, 0x2a, 0x7b, 0x0f, 0x06, + 0xd1, 0xa0, 0x0f, 0x6a, 0x51, 0xfd, 0xad, 0x80, 0xee, 0x67, 0xbe, 0x48, 0xf6, 0xe6, 0x89, 0x6d, + 0x77, 0x12, 0xd0, 0x48, 0x1b, 0x7f, 0x80, 0x36, 0xed, 0xe3, 0x6e, 0x77, 0xe4, 0x4d, 0x9e, 0x51, + 0xee, 0xf5, 0xa7, 0x00, 0x9d, 0xa2, 0x35, 0xef, 0xc4, 0xdf, 0xa2, 0x82, 0x3a, 0x98, 0xe4, 0x2b, + 0xf9, 0x5a, 0xe9, 0xf0, 0x60, 0x59, 0xf7, 0x4c, 0x95, 0xfe, 0x30, 0x10, 0x7c, 0x1a, 0x3f, 0x26, + 0xde, 0x41, 0x62, 0xe3, 0x84, 0x8a, 0x21, 0xeb, 0x25, 0x48, 0x52, 0x2b, 0x79, 0xbb, 0x06, 0xeb, + 0x4d, 0x09, 0x56, 0xb7, 0x93, 0x36, 0xde, 0x46, 0x79, 0xbb, 0xd9, 0x89, 0xb1, 0x25, 0x4d, 0xfc, + 0x0d, 0x2a, 0xb6, 0x65, 0x53, 0xce, 0x1c, 0x1f, 0xb0, 0x55, 0x3a, 0x7c, 0x60, 0x2a, 0x3e, 0x9a, + 0x09, 0x1f, 0xcd, 0x56, 0xcc, 0x47, 0x35, 0x8a, 0xe7, 0x7f, 0x94, 0x35, 0x6b, 0x56, 0x24, 0x1f, + 0xac, 0xc0, 0x78, 0xe2, 0x9c, 0x77, 0xbd, 0x9f, 0x29, 0xd1, 0x2b, 0x5a, 0x6d, 0xd3, 0x9a, 0x77, + 0xe2, 0xaf, 0xd0, 0xba, 0xed, 0x8d, 0x29, 0x8b, 0x04, 0xc0, 0xf4, 0x8e, 0xa7, 0x24, 0x35, 0x78, + 0x84, 0x8c, 0x16, 0xe5, 0x74, 0xe0, 0x85, 0x82, 0xf2, 0x26, 0xf7, 0x84, 0xe7, 0x3a, 0x7e, 0x0c, + 0xd3, 0xa3, 0xbe, 0xa0, 0x1c, 0xc0, 0x7d, 0xc7, 0x5d, 0x97, 0x6c, 0x85, 0x0d, 0x84, 0xba, 0x2e, + 0xf7, 0x26, 0xe2, 0x88, 0x0f, 0x42, 0x82, 0x00, 0x0b, 0x29, 0x0f, 0x3e, 0x40, 0x3b, 0x2d, 0xe6, + 0x8e, 0x28, 0x6f, 0xb2, 0x40, 0x38, 0x5e, 0x40, 0x79, 0xbb, 0x05, 0xf0, 0xd5, 0xad, 0xc5, 0x80, + 0x04, 0x55, 0x77, 0x48, 0x7d, 0x3f, 0x66, 0x90, 0x5a, 0xc8, 0xe1, 0x3c, 0xb6, 0x3a, 0x4d, 0x40, + 0xad, 0x6e, 0x81, 0x2d, 0xcf, 0x95, 0xdf, 0x1f, 0x42, 0x6a, 0x1f, 0x77, 0xc9, 0x16, 0xe0, 0x26, + 0xe5, 0x91, 0x64, 0x3f, 0xf2, 0x3d, 0x27, 0x04, 0xa1, 0xba, 0xa7, 0xc8, 0x3e, 0x73, 0xe0, 0x2a, + 0xda, 0x80, 0x45, 0xfc, 0x14, 0xb2, 0x0d, 0x09, 0x73, 0x3e, 0xfc, 0x29, 0xca, 0xdb, 0xf6, 0x31, + 0xd9, 0xb9, 0x7b, 0xaf, 0x64, 0xfe, 0xfe, 0xf7, 0x09, 0x4d, 0x00, 0x7e, 0x12, 0x44, 0x23, 0x3a, + 0x8d, 0x51, 0x2f, 0x4d, 0x7c, 0x80, 0xd6, 0xce, 0x80, 0x38, 0x2b, 0x31, 0x09, 0xe7, 0xd0, 0x9c, + 0xf0, 0xcb, 0x52, 0x49, 0x5f, 0xae, 0x7c, 0xae, 0x55, 0xff, 0x2e, 0x22, 0x1d, 0x20, 0x0e, 0x82, + 0x92, 0x52, 0x5a, 0xed, 0xb5, 0x28, 0xed, 0x4a, 0xa6, 0xd2, 0xe6, 0xb3, 0x95, 0x76, 0x35, 0xad, + 0xb4, 0xf3, 0xc3, 0x5f, 0x5b, 0x18, 0x7e, 0xc2, 0xf9, 0x42, 0x8a, 0xf3, 0x5f, 0xcf, 0xd8, 0xbc, + 0x0b, 0x6c, 0x4e, 0x6b, 0xe1, 0xec, 0x91, 0x77, 0x62, 0xf0, 0x7a, 0x26, 0x83, 0xf7, 0x17, 0x19, + 0x5c, 0xcc, 0x66, 0xb0, 0xfe, 0x2a, 0x0c, 0x9e, 0xc3, 0x15, 0x5a, 0x86, 0xab, 0x52, 0x06, 0xae, + 0x32, 0x19, 0xb1, 0xb1, 0x94, 0x11, 0x9b, 0x59, 0x8c, 0xd8, 0x7a, 0x29, 0x23, 0xee, 0x2d, 0x30, + 0x62, 0x41, 0x6c, 0xb7, 0xb3, 0xc4, 0x36, 0xa5, 0x3d, 0x3b, 0xaf, 0xa0, 0x3d, 0x31, 0x69, 0xf0, + 0xff, 0x23, 0x0d, 0x3e, 0x44, 0xbb, 0xdd, 0xc8, 0x75, 0x69, 0x18, 0x36, 0x68, 0x9f, 0x71, 0xda, + 0x71, 0xc2, 0xd0, 0x0b, 0x06, 0xe4, 0x7e, 0x45, 0xab, 0xad, 0x59, 0x99, 0x31, 0xfc, 0x19, 0xda, + 0x7b, 0xe4, 0x78, 0x7e, 0xc4, 0x69, 0x1c, 0x48, 0xf4, 0x89, 0xec, 0x41, 0xd5, 0x4b, 0xa2, 0x72, + 0x82, 0x1d, 0xce, 0xce, 0xa7, 0x80, 0xcc, 0xb7, 0xd5, 0x04, 0x67, 0x8e, 0x59, 0x14, 0xda, 0x4b, + 0x52, 0x51, 0xe8, 0xf1, 0x72, 0x69, 0x7d, 0xeb, 0xf5, 0x49, 0xeb, 0xc2, 0x8f, 0xc5, 0x03, 0x78, + 0xd7, 0xbc, 0xf3, 0x0d, 0xe8, 0x4d, 0xe3, 0xe4, 0xe2, 0x2f, 0x23, 0x77, 0x71, 0x6d, 0x68, 0x97, + 0xd7, 0x86, 0xf6, 0xe7, 0xb5, 0xa1, 0xfd, 0x7a, 0x63, 0xe4, 0x9e, 0xdf, 0x18, 0xb9, 0xcb, 0x1b, + 0x23, 0xf7, 0xfb, 0x8d, 0x91, 0xfb, 0xf1, 0xa3, 0xff, 0x92, 0x9b, 0x17, 0xfe, 0xcf, 0x9e, 0x16, + 0xc0, 0xf1, 0xc9, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x40, 0x1f, 0x5b, 0xd8, 0xe9, 0x0a, 0x00, + 0x00, +} + +func (m *HealthCheck) 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 *HealthCheck) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HealthCheck) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.EnterpriseMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHealthcheck(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x62 + } + { + size, err := m.RaftIndex.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHealthcheck(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + { + size, err := m.Definition.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHealthcheck(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + if len(m.ServiceTags) > 0 { + for iNdEx := len(m.ServiceTags) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ServiceTags[iNdEx]) + copy(dAtA[i:], m.ServiceTags[iNdEx]) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.ServiceTags[iNdEx]))) + i-- + dAtA[i] = 0x4a + } + } + if len(m.ServiceName) > 0 { + i -= len(m.ServiceName) + copy(dAtA[i:], m.ServiceName) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.ServiceName))) + i-- + dAtA[i] = 0x42 + } + if len(m.ServiceID) > 0 { + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.ServiceID))) + i-- + dAtA[i] = 0x3a + } + if len(m.Output) > 0 { + i -= len(m.Output) + copy(dAtA[i:], m.Output) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Output))) + i-- + dAtA[i] = 0x32 + } + if len(m.Notes) > 0 { + i -= len(m.Notes) + copy(dAtA[i:], m.Notes) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Notes))) + i-- + dAtA[i] = 0x2a + } + if len(m.Status) > 0 { + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0x22 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if len(m.CheckID) > 0 { + i -= len(m.CheckID) + copy(dAtA[i:], m.CheckID) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.CheckID))) + i-- + dAtA[i] = 0x12 + } + if len(m.Node) > 0 { + i -= len(m.Node) + copy(dAtA[i:], m.Node) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Node))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HeaderValue) 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 *HeaderValue) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HeaderValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + for iNdEx := len(m.Value) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Value[iNdEx]) + copy(dAtA[i:], m.Value[iNdEx]) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Value[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *HealthCheckDefinition) 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 *HealthCheckDefinition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HealthCheckDefinition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Body) > 0 { + i -= len(m.Body) + copy(dAtA[i:], m.Body) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Body))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + n4, err4 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.TTL, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.TTL):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintHealthcheck(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + if len(m.AliasService) > 0 { + i -= len(m.AliasService) + copy(dAtA[i:], m.AliasService) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.AliasService))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.AliasNode) > 0 { + i -= len(m.AliasNode) + copy(dAtA[i:], m.AliasNode) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.AliasNode))) + i-- + dAtA[i] = 0x7a + } + if m.GRPCUseTLS { + i-- + if m.GRPCUseTLS { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x70 + } + if len(m.GRPC) > 0 { + i -= len(m.GRPC) + copy(dAtA[i:], m.GRPC) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.GRPC))) + i-- + dAtA[i] = 0x6a + } + if len(m.Shell) > 0 { + i -= len(m.Shell) + copy(dAtA[i:], m.Shell) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Shell))) + i-- + dAtA[i] = 0x62 + } + if len(m.DockerContainerID) > 0 { + i -= len(m.DockerContainerID) + copy(dAtA[i:], m.DockerContainerID) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.DockerContainerID))) + i-- + dAtA[i] = 0x5a + } + if len(m.ScriptArgs) > 0 { + for iNdEx := len(m.ScriptArgs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ScriptArgs[iNdEx]) + copy(dAtA[i:], m.ScriptArgs[iNdEx]) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.ScriptArgs[iNdEx]))) + i-- + dAtA[i] = 0x52 + } + } + if m.OutputMaxSize != 0 { + i = encodeVarintHealthcheck(dAtA, i, uint64(m.OutputMaxSize)) + i-- + dAtA[i] = 0x48 + } + n5, err5 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DeregisterCriticalServiceAfter, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.DeregisterCriticalServiceAfter):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintHealthcheck(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x42 + n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Timeout, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintHealthcheck(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x3a + n7, err7 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Interval, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Interval):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintHealthcheck(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x32 + if len(m.TCP) > 0 { + i -= len(m.TCP) + copy(dAtA[i:], m.TCP) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.TCP))) + i-- + dAtA[i] = 0x2a + } + if len(m.Method) > 0 { + i -= len(m.Method) + copy(dAtA[i:], m.Method) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Method))) + i-- + dAtA[i] = 0x22 + } + if len(m.Header) > 0 { + for k := range m.Header { + v := m.Header[k] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHealthcheck(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintHealthcheck(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } + } + if m.TLSSkipVerify { + i-- + if m.TLSSkipVerify { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.HTTP) > 0 { + i -= len(m.HTTP) + copy(dAtA[i:], m.HTTP) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.HTTP))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CheckType) 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 *CheckType) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CheckType) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Body) > 0 { + i -= len(m.Body) + copy(dAtA[i:], m.Body) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Body))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xd2 + } + if m.OutputMaxSize != 0 { + i = encodeVarintHealthcheck(dAtA, i, uint64(m.OutputMaxSize)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc8 + } + if len(m.ProxyGRPC) > 0 { + i -= len(m.ProxyGRPC) + copy(dAtA[i:], m.ProxyGRPC) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.ProxyGRPC))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc2 + } + if len(m.ProxyHTTP) > 0 { + i -= len(m.ProxyHTTP) + copy(dAtA[i:], m.ProxyHTTP) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.ProxyHTTP))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if m.FailuresBeforeCritical != 0 { + i = encodeVarintHealthcheck(dAtA, i, uint64(m.FailuresBeforeCritical)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb0 + } + if m.SuccessBeforePassing != 0 { + i = encodeVarintHealthcheck(dAtA, i, uint64(m.SuccessBeforePassing)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa8 + } + if len(m.Header) > 0 { + for k := range m.Header { + v := m.Header[k] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHealthcheck(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintHealthcheck(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + } + n10, err10 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DeregisterCriticalServiceAfter, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.DeregisterCriticalServiceAfter):]) + if err10 != nil { + return 0, err10 + } + i -= n10 + i = encodeVarintHealthcheck(dAtA, i, uint64(n10)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + n11, err11 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.TTL, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.TTL):]) + if err11 != nil { + return 0, err11 + } + i -= n11 + i = encodeVarintHealthcheck(dAtA, i, uint64(n11)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + n12, err12 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Timeout, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout):]) + if err12 != nil { + return 0, err12 + } + i -= n12 + i = encodeVarintHealthcheck(dAtA, i, uint64(n12)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + if m.TLSSkipVerify { + i-- + if m.TLSSkipVerify { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.GRPCUseTLS { + i-- + if m.GRPCUseTLS { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x78 + } + if len(m.GRPC) > 0 { + i -= len(m.GRPC) + copy(dAtA[i:], m.GRPC) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.GRPC))) + i-- + dAtA[i] = 0x72 + } + if len(m.Shell) > 0 { + i -= len(m.Shell) + copy(dAtA[i:], m.Shell) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Shell))) + i-- + dAtA[i] = 0x6a + } + if len(m.DockerContainerID) > 0 { + i -= len(m.DockerContainerID) + copy(dAtA[i:], m.DockerContainerID) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.DockerContainerID))) + i-- + dAtA[i] = 0x62 + } + if len(m.AliasService) > 0 { + i -= len(m.AliasService) + copy(dAtA[i:], m.AliasService) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.AliasService))) + i-- + dAtA[i] = 0x5a + } + if len(m.AliasNode) > 0 { + i -= len(m.AliasNode) + copy(dAtA[i:], m.AliasNode) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.AliasNode))) + i-- + dAtA[i] = 0x52 + } + n13, err13 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Interval, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Interval):]) + if err13 != nil { + return 0, err13 + } + i -= n13 + i = encodeVarintHealthcheck(dAtA, i, uint64(n13)) + i-- + dAtA[i] = 0x4a + if len(m.TCP) > 0 { + i -= len(m.TCP) + copy(dAtA[i:], m.TCP) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.TCP))) + i-- + dAtA[i] = 0x42 + } + if len(m.Method) > 0 { + i -= len(m.Method) + copy(dAtA[i:], m.Method) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Method))) + i-- + dAtA[i] = 0x3a + } + if len(m.HTTP) > 0 { + i -= len(m.HTTP) + copy(dAtA[i:], m.HTTP) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.HTTP))) + i-- + dAtA[i] = 0x32 + } + if len(m.ScriptArgs) > 0 { + for iNdEx := len(m.ScriptArgs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ScriptArgs[iNdEx]) + copy(dAtA[i:], m.ScriptArgs[iNdEx]) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.ScriptArgs[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.Notes) > 0 { + i -= len(m.Notes) + copy(dAtA[i:], m.Notes) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Notes))) + i-- + dAtA[i] = 0x22 + } + if len(m.Status) > 0 { + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.CheckID) > 0 { + i -= len(m.CheckID) + copy(dAtA[i:], m.CheckID) + i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.CheckID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintHealthcheck(dAtA []byte, offset int, v uint64) int { + offset -= sovHealthcheck(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *HealthCheck) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Node) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.CheckID) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.Status) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.Notes) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.Output) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.ServiceID) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.ServiceName) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + if len(m.ServiceTags) > 0 { + for _, s := range m.ServiceTags { + l = len(s) + n += 1 + l + sovHealthcheck(uint64(l)) + } + } + l = m.Definition.Size() + n += 1 + l + sovHealthcheck(uint64(l)) + l = m.RaftIndex.Size() + n += 1 + l + sovHealthcheck(uint64(l)) + l = len(m.Type) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = m.EnterpriseMeta.Size() + n += 1 + l + sovHealthcheck(uint64(l)) + return n +} + +func (m *HeaderValue) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Value) > 0 { + for _, s := range m.Value { + l = len(s) + n += 1 + l + sovHealthcheck(uint64(l)) + } + } + return n +} + +func (m *HealthCheckDefinition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.HTTP) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + if m.TLSSkipVerify { + n += 2 + } + if len(m.Header) > 0 { + for k, v := range m.Header { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovHealthcheck(uint64(len(k))) + 1 + l + sovHealthcheck(uint64(l)) + n += mapEntrySize + 1 + sovHealthcheck(uint64(mapEntrySize)) + } + } + l = len(m.Method) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.TCP) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Interval) + n += 1 + l + sovHealthcheck(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout) + n += 1 + l + sovHealthcheck(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.DeregisterCriticalServiceAfter) + n += 1 + l + sovHealthcheck(uint64(l)) + if m.OutputMaxSize != 0 { + n += 1 + sovHealthcheck(uint64(m.OutputMaxSize)) + } + if len(m.ScriptArgs) > 0 { + for _, s := range m.ScriptArgs { + l = len(s) + n += 1 + l + sovHealthcheck(uint64(l)) + } + } + l = len(m.DockerContainerID) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.Shell) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.GRPC) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + if m.GRPCUseTLS { + n += 2 + } + l = len(m.AliasNode) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.AliasService) + if l > 0 { + n += 2 + l + sovHealthcheck(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.TTL) + n += 2 + l + sovHealthcheck(uint64(l)) + l = len(m.Body) + if l > 0 { + n += 2 + l + sovHealthcheck(uint64(l)) + } + return n +} + +func (m *CheckType) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CheckID) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.Status) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.Notes) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + if len(m.ScriptArgs) > 0 { + for _, s := range m.ScriptArgs { + l = len(s) + n += 1 + l + sovHealthcheck(uint64(l)) + } + } + l = len(m.HTTP) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.Method) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.TCP) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Interval) + n += 1 + l + sovHealthcheck(uint64(l)) + l = len(m.AliasNode) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.AliasService) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.DockerContainerID) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.Shell) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + l = len(m.GRPC) + if l > 0 { + n += 1 + l + sovHealthcheck(uint64(l)) + } + if m.GRPCUseTLS { + n += 2 + } + if m.TLSSkipVerify { + n += 3 + } + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout) + n += 2 + l + sovHealthcheck(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.TTL) + n += 2 + l + sovHealthcheck(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.DeregisterCriticalServiceAfter) + n += 2 + l + sovHealthcheck(uint64(l)) + if len(m.Header) > 0 { + for k, v := range m.Header { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovHealthcheck(uint64(len(k))) + 1 + l + sovHealthcheck(uint64(l)) + n += mapEntrySize + 2 + sovHealthcheck(uint64(mapEntrySize)) + } + } + if m.SuccessBeforePassing != 0 { + n += 2 + sovHealthcheck(uint64(m.SuccessBeforePassing)) + } + if m.FailuresBeforeCritical != 0 { + n += 2 + sovHealthcheck(uint64(m.FailuresBeforeCritical)) + } + l = len(m.ProxyHTTP) + if l > 0 { + n += 2 + l + sovHealthcheck(uint64(l)) + } + l = len(m.ProxyGRPC) + if l > 0 { + n += 2 + l + sovHealthcheck(uint64(l)) + } + if m.OutputMaxSize != 0 { + n += 2 + sovHealthcheck(uint64(m.OutputMaxSize)) + } + l = len(m.Body) + if l > 0 { + n += 2 + l + sovHealthcheck(uint64(l)) + } + return n +} + +func sovHealthcheck(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozHealthcheck(x uint64) (n int) { + return sovHealthcheck(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *HealthCheck) 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 ErrIntOverflowHealthcheck + } + 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: HealthCheck: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HealthCheck: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Node = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CheckID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CheckID = github_com_hashicorp_consul_types.CheckID(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Notes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Notes = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Output", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Output = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceTags", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceTags = append(m.ServiceTags, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Definition", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Definition.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftIndex", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RaftIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EnterpriseMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.EnterpriseMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHealthcheck(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHealthcheck + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthHealthcheck + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HeaderValue) 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 ErrIntOverflowHealthcheck + } + 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: HeaderValue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HeaderValue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHealthcheck(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHealthcheck + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthHealthcheck + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HealthCheckDefinition) 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 ErrIntOverflowHealthcheck + } + 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: HealthCheckDefinition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HealthCheckDefinition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HTTP", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HTTP = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TLSSkipVerify", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TLSSkipVerify = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = make(map[string]HeaderValue) + } + var mapkey string + mapvalue := &HeaderValue{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthHealthcheck + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthHealthcheck + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthHealthcheck + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &HeaderValue{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipHealthcheck(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHealthcheck + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Header[mapkey] = *mapvalue + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Method = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TCP", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TCP = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Interval, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Timeout, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeregisterCriticalServiceAfter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.DeregisterCriticalServiceAfter, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OutputMaxSize", wireType) + } + m.OutputMaxSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OutputMaxSize |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ScriptArgs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ScriptArgs = append(m.ScriptArgs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DockerContainerID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DockerContainerID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shell", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Shell = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GRPC", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GRPC = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GRPCUseTLS", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.GRPCUseTLS = bool(v != 0) + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AliasNode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AliasNode = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AliasService", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AliasService = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.TTL, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Body = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHealthcheck(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHealthcheck + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthHealthcheck + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CheckType) 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 ErrIntOverflowHealthcheck + } + 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: CheckType: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CheckType: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CheckID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CheckID = github_com_hashicorp_consul_types.CheckID(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Notes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Notes = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ScriptArgs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ScriptArgs = append(m.ScriptArgs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HTTP", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HTTP = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Method = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TCP", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TCP = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Interval, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AliasNode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AliasNode = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AliasService", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AliasService = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DockerContainerID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DockerContainerID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shell", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Shell = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GRPC", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GRPC = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GRPCUseTLS", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.GRPCUseTLS = bool(v != 0) + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TLSSkipVerify", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TLSSkipVerify = bool(v != 0) + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Timeout, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.TTL, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeregisterCriticalServiceAfter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.DeregisterCriticalServiceAfter, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = make(map[string]HeaderValue) + } + var mapkey string + mapvalue := &HeaderValue{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthHealthcheck + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthHealthcheck + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthHealthcheck + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &HeaderValue{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipHealthcheck(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHealthcheck + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Header[mapkey] = *mapvalue + iNdEx = postIndex + case 21: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SuccessBeforePassing", wireType) + } + m.SuccessBeforePassing = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SuccessBeforePassing |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 22: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FailuresBeforeCritical", wireType) + } + m.FailuresBeforeCritical = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FailuresBeforeCritical |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProxyHTTP", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProxyHTTP = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 24: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProxyGRPC", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProxyGRPC = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 25: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OutputMaxSize", wireType) + } + m.OutputMaxSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OutputMaxSize |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 26: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthcheck + } + 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 ErrInvalidLengthHealthcheck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHealthcheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Body = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHealthcheck(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHealthcheck + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthHealthcheck + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipHealthcheck(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, ErrIntOverflowHealthcheck + } + 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, ErrIntOverflowHealthcheck + } + 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, ErrIntOverflowHealthcheck + } + 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, ErrInvalidLengthHealthcheck + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthHealthcheck + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowHealthcheck + } + 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 := skipHealthcheck(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthHealthcheck + } + } + 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 ( + ErrInvalidLengthHealthcheck = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowHealthcheck = fmt.Errorf("proto: integer overflow") +) diff --git a/proto/pbservice/healthcheck.proto b/proto/pbservice/healthcheck.proto new file mode 100644 index 0000000000..7a14b31c8f --- /dev/null +++ b/proto/pbservice/healthcheck.proto @@ -0,0 +1,144 @@ +syntax = "proto3"; + +package pbservice; + +option go_package = "github.com/hashicorp/consul/proto/pbservice"; + +import "google/protobuf/duration.proto"; +import "proto/pbcommon/common.proto"; +import "proto/pbcommon/common_oss.proto"; + +// This fake import path is replaced by the build script with a versioned path +import "gogoproto/gogo.proto"; + +option (gogoproto.goproto_unkeyed_all) = false; +option (gogoproto.goproto_unrecognized_all) = false; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.goproto_sizecache_all) = false; + +// HealthCheck represents a single check on a given node +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.HealthCheck +// output=healthcheck.gen.go +// name=Structs +message HealthCheck { + string Node = 1; + string CheckID = 2 [(gogoproto.casttype) = "github.com/hashicorp/consul/types.CheckID"]; + string Name = 3; + string Status = 4; // The current check status + string Notes = 5; // Additional notes with the status + string Output = 6; // Holds output of script runs + string ServiceID = 7; // optional associated service + string ServiceName = 8; // optional service name + repeated string ServiceTags = 9; // optional service tags + string Type = 12; // Check type: http/ttl/tcp/etc + + HealthCheckDefinition Definition = 10 [(gogoproto.nullable) = false]; + + // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs + common.RaftIndex RaftIndex = 11 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + + // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs + common.EnterpriseMeta EnterpriseMeta = 13 [(gogoproto.nullable) = false]; +} + +message HeaderValue { + repeated string Value = 1; +} + +// HealthCheckDefinition of a single HealthCheck. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.HealthCheckDefinition +// output=healthcheck.gen.go +// name=Structs +message HealthCheckDefinition { + string HTTP = 1; + bool TLSSkipVerify = 2; + + // mog: func-to=MapHeadersToStructs func-from=NewMapHeadersFromStructs + map Header = 3 [(gogoproto.nullable) = false]; + string Method = 4; + string Body = 18; + string TCP = 5; + google.protobuf.Duration Interval = 6 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + + // mog: func-to=uint func-from=uint32 + uint32 OutputMaxSize = 9; + google.protobuf.Duration Timeout = 7 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + google.protobuf.Duration DeregisterCriticalServiceAfter = 8 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + repeated string ScriptArgs = 10; + string DockerContainerID = 11; + string Shell = 12; + string GRPC = 13; + bool GRPCUseTLS = 14; + string AliasNode = 15; + string AliasService = 16; + google.protobuf.Duration TTL = 17 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; +} + +// CheckType is used to create either the CheckMonitor or the CheckTTL. +// The following types are supported: Script, HTTP, TCP, Docker, TTL, GRPC, +// Alias. Script, +// HTTP, Docker, TCP and GRPC all require Interval. Only one of the types may +// to be provided: TTL or Script/Interval or HTTP/Interval or TCP/Interval or +// Docker/Interval or GRPC/Interval or AliasService. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.CheckType +// output=healthcheck.gen.go +// name=Structs +message CheckType { + string CheckID = 1 [(gogoproto.casttype) = "github.com/hashicorp/consul/types.CheckID"]; + string Name = 2; + string Status = 3; + string Notes = 4; + + repeated string ScriptArgs = 5; + string HTTP = 6; + // mog: func-to=MapHeadersToStructs func-from=NewMapHeadersFromStructs + map Header = 20 [(gogoproto.nullable) = false]; + string Method = 7; + string Body = 26; + string TCP = 8; + google.protobuf.Duration Interval = 9 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + + string AliasNode = 10; + string AliasService = 11; + string DockerContainerID = 12; + string Shell = 13; + string GRPC = 14; + bool GRPCUseTLS = 15; + bool TLSSkipVerify = 16; + google.protobuf.Duration Timeout = 17 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + google.protobuf.Duration TTL = 18 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + + // mog: func-to=int func-from=int32 + int32 SuccessBeforePassing = 21; + // mog: func-to=int func-from=int32 + int32 FailuresBeforeCritical = 22; + + // Definition fields used when exposing checks through a proxy + string ProxyHTTP = 23; + string ProxyGRPC = 24; + + // DeregisterCriticalServiceAfter, if >0, will cause the associated + // service, if any, to be deregistered if this check is critical for + // longer than this duration. + google.protobuf.Duration DeregisterCriticalServiceAfter = 19 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + + // mog: func-to=int func-from=int32 + int32 OutputMaxSize = 25; +} \ No newline at end of file diff --git a/proto/pbservice/node.pb.binary.go b/proto/pbservice/node.pb.binary.go new file mode 100644 index 0000000000..b7533436fb --- /dev/null +++ b/proto/pbservice/node.pb.binary.go @@ -0,0 +1,38 @@ +// Code generated by protoc-gen-go-binary. DO NOT EDIT. +// source: proto/pbservice/node.proto + +package pbservice + +import ( + "github.com/golang/protobuf/proto" +) + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *CheckServiceNode) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *CheckServiceNode) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *Node) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *Node) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *NodeService) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *NodeService) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} diff --git a/proto/pbservice/node.pb.go b/proto/pbservice/node.pb.go new file mode 100644 index 0000000000..4f8df95608 --- /dev/null +++ b/proto/pbservice/node.pb.go @@ -0,0 +1,2205 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: proto/pbservice/node.proto + +package pbservice + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/golang/protobuf/proto" + github_com_hashicorp_consul_agent_structs "github.com/hashicorp/consul/agent/structs" + pbcommon "github.com/hashicorp/consul/proto/pbcommon" + github_com_hashicorp_consul_types "github.com/hashicorp/consul/types" + io "io" + math "math" + math_bits "math/bits" +) + +// 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 + +// CheckServiceNode is used to provide the node, its service +// definition, as well as a HealthCheck that is associated. +type CheckServiceNode struct { + Node *Node `protobuf:"bytes,1,opt,name=Node,proto3" json:"Node,omitempty"` + Service *NodeService `protobuf:"bytes,2,opt,name=Service,proto3" json:"Service,omitempty"` + Checks []*HealthCheck `protobuf:"bytes,3,rep,name=Checks,proto3" json:"Checks,omitempty"` +} + +func (m *CheckServiceNode) Reset() { *m = CheckServiceNode{} } +func (m *CheckServiceNode) String() string { return proto.CompactTextString(m) } +func (*CheckServiceNode) ProtoMessage() {} +func (*CheckServiceNode) Descriptor() ([]byte, []int) { + return fileDescriptor_bbc215b78fa95fe5, []int{0} +} +func (m *CheckServiceNode) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CheckServiceNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CheckServiceNode.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CheckServiceNode) XXX_Merge(src proto.Message) { + xxx_messageInfo_CheckServiceNode.Merge(m, src) +} +func (m *CheckServiceNode) XXX_Size() int { + return m.Size() +} +func (m *CheckServiceNode) XXX_DiscardUnknown() { + xxx_messageInfo_CheckServiceNode.DiscardUnknown(m) +} + +var xxx_messageInfo_CheckServiceNode proto.InternalMessageInfo + +// Node contains information about a node. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.Node +// output=node.gen.go +// name=Structs +type Node struct { + ID github_com_hashicorp_consul_types.NodeID `protobuf:"bytes,1,opt,name=ID,proto3,casttype=github.com/hashicorp/consul/types.NodeID" json:"ID,omitempty"` + Node string `protobuf:"bytes,2,opt,name=Node,proto3" json:"Node,omitempty"` + Address string `protobuf:"bytes,3,opt,name=Address,proto3" json:"Address,omitempty"` + Datacenter string `protobuf:"bytes,4,opt,name=Datacenter,proto3" json:"Datacenter,omitempty"` + TaggedAddresses map[string]string `protobuf:"bytes,5,rep,name=TaggedAddresses,proto3" json:"TaggedAddresses,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Meta map[string]string `protobuf:"bytes,6,rep,name=Meta,proto3" json:"Meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs + pbcommon.RaftIndex `protobuf:"bytes,7,opt,name=RaftIndex,proto3,embedded=RaftIndex" json:"RaftIndex"` +} + +func (m *Node) Reset() { *m = Node{} } +func (m *Node) String() string { return proto.CompactTextString(m) } +func (*Node) ProtoMessage() {} +func (*Node) Descriptor() ([]byte, []int) { + return fileDescriptor_bbc215b78fa95fe5, []int{1} +} +func (m *Node) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Node.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Node) XXX_Merge(src proto.Message) { + xxx_messageInfo_Node.Merge(m, src) +} +func (m *Node) XXX_Size() int { + return m.Size() +} +func (m *Node) XXX_DiscardUnknown() { + xxx_messageInfo_Node.DiscardUnknown(m) +} + +var xxx_messageInfo_Node proto.InternalMessageInfo + +// NodeService is a service provided by a node +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.NodeService +// output=node.gen.go +// name=Structs +type NodeService struct { + // Kind is the kind of service this is. Different kinds of services may + // have differing validation, DNS behavior, etc. An empty kind will default + // to the Default kind. See ServiceKind for the full list of kinds. + Kind github_com_hashicorp_consul_agent_structs.ServiceKind `protobuf:"bytes,1,opt,name=Kind,proto3,casttype=github.com/hashicorp/consul/agent/structs.ServiceKind" json:"Kind,omitempty"` + ID string `protobuf:"bytes,2,opt,name=ID,proto3" json:"ID,omitempty"` + Service string `protobuf:"bytes,3,opt,name=Service,proto3" json:"Service,omitempty"` + Tags []string `protobuf:"bytes,4,rep,name=Tags,proto3" json:"Tags,omitempty"` + Address string `protobuf:"bytes,5,opt,name=Address,proto3" json:"Address,omitempty"` + // mog: func-to=MapStringServiceAddressToStructs func-from=NewMapStringServiceAddressFromStructs + TaggedAddresses map[string]ServiceAddress `protobuf:"bytes,15,rep,name=TaggedAddresses,proto3" json:"TaggedAddresses" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Meta map[string]string `protobuf:"bytes,6,rep,name=Meta,proto3" json:"Meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // mog: func-to=int func-from=int32 + Port int32 `protobuf:"varint,7,opt,name=Port,proto3" json:"Port,omitempty"` + // mog: func-to=WeightsPtrToStructs func-from=NewWeightsPtrFromStructs + Weights *Weights `protobuf:"bytes,8,opt,name=Weights,proto3" json:"Weights,omitempty"` + EnableTagOverride bool `protobuf:"varint,9,opt,name=EnableTagOverride,proto3" json:"EnableTagOverride,omitempty"` + // Proxy is the configuration set for Kind = connect-proxy. It is mandatory in + // that case and an error to be set for any other kind. This config is part of + // a proxy service definition and is distinct from but shares some fields with + // the Connect.Proxy which configures a managed proxy as part of the actual + // service's definition. This duplication is ugly but seemed better than the + // alternative which was to re-use the same struct fields for both cases even + // though the semantics are different and the non-shred fields make no sense + // in the other case. ProxyConfig may be a more natural name here, but it's + // confusing for the UX because one of the fields in ConnectProxyConfig is + // also called just "Config" + Proxy ConnectProxyConfig `protobuf:"bytes,11,opt,name=Proxy,proto3" json:"Proxy"` + // Connect are the Connect settings for a service. This is purposely NOT + // a pointer so that we never have to nil-check this. + Connect ServiceConnect `protobuf:"bytes,12,opt,name=Connect,proto3" json:"Connect"` + // LocallyRegisteredAsSidecar is private as it is only used by a local agent + // state to track if the service was registered from a nested sidecar_service + // block. We need to track that so we can know whether we need to deregister + // it automatically too if it's removed from the service definition or if the + // parent service is deregistered. Relying only on ID would cause us to + // deregister regular services if they happen to be registered using the same + // ID scheme as our sidecars do by default. We could use meta but that gets + // unpleasant because we can't use the consul- prefix from an agent (reserved + // for use internally but in practice that means within the state store or in + // responses only), and it leaks the detail publicly which people might rely + // on which is a bit unpleasant for something that is meant to be config-file + // syntax sugar. Note this is not translated to ServiceNode and friends and + // may not be set on a NodeService that isn't the one the agent registered and + // keeps in it's local state. We never want this rendered in JSON as it's + // internal only. Right now our agent endpoints return api structs which don't + // include it but this is a safety net incase we change that or there is + // somewhere this is used in API output. + LocallyRegisteredAsSidecar bool `protobuf:"varint,13,opt,name=LocallyRegisteredAsSidecar,proto3" json:"LocallyRegisteredAsSidecar,omitempty"` + // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs + EnterpriseMeta pbcommon.EnterpriseMeta `protobuf:"bytes,16,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta"` + // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs + pbcommon.RaftIndex `protobuf:"bytes,14,opt,name=RaftIndex,proto3,embedded=RaftIndex" json:"RaftIndex"` +} + +func (m *NodeService) Reset() { *m = NodeService{} } +func (m *NodeService) String() string { return proto.CompactTextString(m) } +func (*NodeService) ProtoMessage() {} +func (*NodeService) Descriptor() ([]byte, []int) { + return fileDescriptor_bbc215b78fa95fe5, []int{2} +} +func (m *NodeService) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NodeService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NodeService.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NodeService) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeService.Merge(m, src) +} +func (m *NodeService) XXX_Size() int { + return m.Size() +} +func (m *NodeService) XXX_DiscardUnknown() { + xxx_messageInfo_NodeService.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeService proto.InternalMessageInfo + +func init() { + proto.RegisterType((*CheckServiceNode)(nil), "pbservice.CheckServiceNode") + proto.RegisterType((*Node)(nil), "pbservice.Node") + proto.RegisterMapType((map[string]string)(nil), "pbservice.Node.MetaEntry") + proto.RegisterMapType((map[string]string)(nil), "pbservice.Node.TaggedAddressesEntry") + proto.RegisterType((*NodeService)(nil), "pbservice.NodeService") + proto.RegisterMapType((map[string]string)(nil), "pbservice.NodeService.MetaEntry") + proto.RegisterMapType((map[string]ServiceAddress)(nil), "pbservice.NodeService.TaggedAddressesEntry") +} + +func init() { proto.RegisterFile("proto/pbservice/node.proto", fileDescriptor_bbc215b78fa95fe5) } + +var fileDescriptor_bbc215b78fa95fe5 = []byte{ + // 746 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x5d, 0x6f, 0xd3, 0x30, + 0x14, 0x6d, 0xda, 0x74, 0x5d, 0x3d, 0xd8, 0x87, 0x35, 0x21, 0x53, 0xb4, 0xb4, 0x0c, 0x1e, 0x26, + 0x6d, 0x24, 0x88, 0x0f, 0x41, 0x11, 0x42, 0x5a, 0xd7, 0x49, 0x54, 0xb0, 0x31, 0x65, 0x93, 0x90, + 0x40, 0x08, 0xb9, 0x89, 0x97, 0x46, 0xeb, 0xe2, 0xca, 0x76, 0xa7, 0xf5, 0x0f, 0xf0, 0xcc, 0x23, + 0xfc, 0xa3, 0xf1, 0xb6, 0x47, 0x9e, 0x2a, 0x58, 0xff, 0xc5, 0x9e, 0x90, 0x1d, 0xb7, 0x4b, 0xb3, + 0x32, 0x31, 0x89, 0x27, 0x3b, 0xf7, 0x9c, 0x7b, 0x7c, 0xed, 0x7b, 0x6e, 0x0b, 0x4a, 0x1d, 0x46, + 0x05, 0x75, 0x3a, 0x4d, 0x4e, 0xd8, 0x51, 0xe8, 0x11, 0x27, 0xa2, 0x3e, 0xb1, 0x55, 0x10, 0x16, + 0x47, 0xd1, 0xd2, 0x9d, 0x21, 0xcd, 0xa3, 0x87, 0x87, 0x34, 0x72, 0xe2, 0x25, 0xe6, 0x95, 0xca, + 0x13, 0xc1, 0xcf, 0x94, 0x73, 0x4d, 0xb8, 0x9b, 0x3e, 0xa4, 0x45, 0x70, 0x5b, 0xb4, 0xbc, 0x16, + 0xf1, 0x0e, 0x34, 0x65, 0x29, 0x4d, 0xd1, 0xab, 0x86, 0x17, 0x03, 0x1a, 0xd0, 0x98, 0x22, 0x77, + 0x71, 0x74, 0xf9, 0xbb, 0x01, 0xe6, 0x37, 0xa4, 0xc8, 0x6e, 0x4c, 0xde, 0xa6, 0x3e, 0x81, 0xf7, + 0x80, 0x29, 0x57, 0x64, 0x54, 0x8c, 0x95, 0x99, 0x47, 0x73, 0xf6, 0x48, 0xd2, 0x96, 0x61, 0x57, + 0x81, 0xf0, 0x21, 0x28, 0xe8, 0x1c, 0x94, 0x55, 0xbc, 0x5b, 0x29, 0x9e, 0x46, 0xdd, 0x21, 0x0d, + 0xda, 0x60, 0x4a, 0x1d, 0xc5, 0x51, 0xae, 0x92, 0x4b, 0x25, 0xbc, 0x56, 0xd7, 0x51, 0xb0, 0xab, + 0x59, 0xcb, 0x3f, 0x72, 0x71, 0x1d, 0xf0, 0x25, 0xc8, 0x36, 0xea, 0xaa, 0x9a, 0x62, 0x6d, 0xed, + 0xbc, 0x5f, 0x5e, 0x09, 0x42, 0xd1, 0xea, 0x36, 0x6d, 0x8f, 0x1e, 0x3a, 0x2d, 0xcc, 0x5b, 0xa1, + 0x47, 0x59, 0xc7, 0xf1, 0x68, 0xc4, 0xbb, 0x6d, 0x47, 0xf4, 0x3a, 0x84, 0xab, 0x02, 0x1a, 0x75, + 0x37, 0xdb, 0xa8, 0x43, 0xa8, 0x6f, 0x23, 0xab, 0x2c, 0xea, 0xe2, 0x11, 0x28, 0xac, 0xfb, 0x3e, + 0x23, 0x5c, 0xd6, 0x22, 0xc3, 0xc3, 0x4f, 0x68, 0x01, 0x50, 0xc7, 0x02, 0x7b, 0x24, 0x12, 0x84, + 0x21, 0x53, 0x81, 0x89, 0x08, 0xdc, 0x06, 0x73, 0x7b, 0x38, 0x08, 0x88, 0xaf, 0x13, 0x08, 0x47, + 0x79, 0x75, 0x9b, 0xfb, 0xa9, 0xeb, 0xdb, 0x29, 0xda, 0x66, 0x24, 0x58, 0xcf, 0x4d, 0x27, 0xc3, + 0x07, 0xc0, 0xdc, 0x22, 0x02, 0xa3, 0x29, 0x25, 0x72, 0x3b, 0x2d, 0x22, 0xb1, 0x38, 0x53, 0xd1, + 0x60, 0x15, 0x14, 0x5d, 0xbc, 0x2f, 0x1a, 0x91, 0x4f, 0x8e, 0x51, 0x41, 0xbd, 0xfb, 0x82, 0xad, + 0xad, 0x34, 0x02, 0x6a, 0xd3, 0x27, 0xfd, 0x72, 0xe6, 0xb4, 0x5f, 0x36, 0xdc, 0x0b, 0x76, 0xa9, + 0x06, 0x16, 0x27, 0x95, 0x04, 0xe7, 0x41, 0xee, 0x80, 0xf4, 0xe2, 0xe7, 0x75, 0xe5, 0x16, 0x2e, + 0x82, 0xfc, 0x11, 0x6e, 0x77, 0x87, 0x4f, 0x16, 0x7f, 0xbc, 0xc8, 0x3e, 0x37, 0x4a, 0xcf, 0x40, + 0x71, 0x54, 0xd1, 0x75, 0x12, 0x97, 0xbf, 0x14, 0xc0, 0x4c, 0xc2, 0x14, 0x70, 0x0b, 0x98, 0x6f, + 0xc2, 0xc8, 0xd7, 0x4d, 0xad, 0x9e, 0xf7, 0xcb, 0x4f, 0xaf, 0x6a, 0x2a, 0x0e, 0x48, 0x24, 0x1c, + 0x2e, 0x58, 0xd7, 0x13, 0xdc, 0xd6, 0x22, 0x52, 0xc0, 0x55, 0x32, 0x70, 0x56, 0x39, 0x24, 0x3e, + 0x55, 0xf6, 0x1c, 0x5d, 0x98, 0x53, 0xf7, 0x77, 0x78, 0x30, 0x04, 0xe6, 0x1e, 0x0e, 0x38, 0x32, + 0x2b, 0x39, 0xe9, 0x06, 0xb9, 0x4f, 0xba, 0x21, 0x3f, 0xee, 0x86, 0x8f, 0x97, 0xbb, 0x3d, 0xa7, + 0x1a, 0xb5, 0x3a, 0xd9, 0xec, 0x13, 0x9b, 0x5e, 0x33, 0x65, 0x3b, 0x2e, 0xb7, 0xfe, 0xc9, 0x58, + 0xeb, 0x2b, 0x7f, 0x51, 0x4c, 0x3b, 0x00, 0x02, 0x73, 0x87, 0x32, 0xa1, 0x9a, 0x9f, 0x77, 0xd5, + 0x1e, 0xae, 0x81, 0xc2, 0x7b, 0x12, 0x06, 0x2d, 0xc1, 0xd1, 0xb4, 0xf2, 0x04, 0x4c, 0x88, 0x69, + 0xc4, 0x1d, 0x52, 0xe0, 0x1a, 0x58, 0xd8, 0x8c, 0x70, 0xb3, 0x4d, 0xf6, 0x70, 0xf0, 0xee, 0x88, + 0x30, 0x16, 0xfa, 0x04, 0x15, 0x2b, 0xc6, 0xca, 0xb4, 0x7b, 0x19, 0x80, 0x55, 0x90, 0xdf, 0x61, + 0xf4, 0xb8, 0x87, 0x66, 0x94, 0xf2, 0x52, 0x42, 0x79, 0x83, 0x46, 0x11, 0xf1, 0x84, 0x82, 0x37, + 0x68, 0xb4, 0x1f, 0x06, 0xfa, 0xaa, 0x71, 0x06, 0xac, 0x82, 0x82, 0xa6, 0xa0, 0x1b, 0x2a, 0x39, + 0x69, 0x6f, 0x7d, 0x3f, 0x4d, 0xd0, 0x89, 0x43, 0x3e, 0x7c, 0x05, 0x4a, 0x6f, 0xa9, 0x87, 0xdb, + 0xed, 0x9e, 0x4b, 0x82, 0x90, 0x0b, 0xc2, 0x88, 0xbf, 0xce, 0x77, 0x43, 0x9f, 0x78, 0x98, 0xa1, + 0x9b, 0xaa, 0xd8, 0x2b, 0x18, 0xb0, 0x0e, 0x66, 0x37, 0xe5, 0xbc, 0x76, 0x58, 0xc8, 0x89, 0x7a, + 0xe5, 0x79, 0xfd, 0x23, 0xa5, 0x87, 0x65, 0x1c, 0xd5, 0xc7, 0xa7, 0x72, 0xc6, 0xa7, 0x6d, 0xf6, + 0x5a, 0xd3, 0xf6, 0xe9, 0x9f, 0xa7, 0xcd, 0x49, 0x0e, 0xcd, 0xc4, 0x37, 0xd2, 0x12, 0xff, 0x63, + 0x10, 0x6b, 0x5b, 0x27, 0xbf, 0xad, 0xcc, 0xc9, 0x99, 0x65, 0x9c, 0x9e, 0x59, 0xc6, 0xaf, 0x33, + 0xcb, 0xf8, 0x3a, 0xb0, 0x32, 0xdf, 0x06, 0x56, 0xe6, 0x74, 0x60, 0x65, 0x7e, 0x0e, 0xac, 0xcc, + 0x87, 0xd5, 0xab, 0x06, 0x31, 0xf5, 0x1f, 0xd3, 0x9c, 0x52, 0x81, 0xc7, 0x7f, 0x02, 0x00, 0x00, + 0xff, 0xff, 0x1c, 0x8f, 0xa3, 0x91, 0x05, 0x07, 0x00, 0x00, +} + +func (m *CheckServiceNode) 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 *CheckServiceNode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CheckServiceNode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Checks) > 0 { + for iNdEx := len(m.Checks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Checks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Service != nil { + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Node != nil { + { + size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Node) 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 *Node) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.RaftIndex.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if len(m.Meta) > 0 { + for k := range m.Meta { + v := m.Meta[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintNode(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintNode(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintNode(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if len(m.TaggedAddresses) > 0 { + for k := range m.TaggedAddresses { + v := m.TaggedAddresses[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintNode(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintNode(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintNode(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.Datacenter) > 0 { + i -= len(m.Datacenter) + copy(dAtA[i:], m.Datacenter) + i = encodeVarintNode(dAtA, i, uint64(len(m.Datacenter))) + i-- + dAtA[i] = 0x22 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintNode(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x1a + } + if len(m.Node) > 0 { + i -= len(m.Node) + copy(dAtA[i:], m.Node) + i = encodeVarintNode(dAtA, i, uint64(len(m.Node))) + i-- + dAtA[i] = 0x12 + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintNode(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NodeService) 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 *NodeService) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeService) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.EnterpriseMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + if len(m.TaggedAddresses) > 0 { + for k := range m.TaggedAddresses { + v := m.TaggedAddresses[k] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintNode(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintNode(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x7a + } + } + { + size, err := m.RaftIndex.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + if m.LocallyRegisteredAsSidecar { + i-- + if m.LocallyRegisteredAsSidecar { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + } + { + size, err := m.Connect.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + { + size, err := m.Proxy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + if m.EnableTagOverride { + i-- + if m.EnableTagOverride { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + if m.Weights != nil { + { + size, err := m.Weights.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Port != 0 { + i = encodeVarintNode(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x38 + } + if len(m.Meta) > 0 { + for k := range m.Meta { + v := m.Meta[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintNode(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintNode(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintNode(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintNode(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x2a + } + if len(m.Tags) > 0 { + for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Tags[iNdEx]) + copy(dAtA[i:], m.Tags[iNdEx]) + i = encodeVarintNode(dAtA, i, uint64(len(m.Tags[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Service) > 0 { + i -= len(m.Service) + copy(dAtA[i:], m.Service) + i = encodeVarintNode(dAtA, i, uint64(len(m.Service))) + i-- + dAtA[i] = 0x1a + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintNode(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0x12 + } + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintNode(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintNode(dAtA []byte, offset int, v uint64) int { + offset -= sovNode(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *CheckServiceNode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Node != nil { + l = m.Node.Size() + n += 1 + l + sovNode(uint64(l)) + } + if m.Service != nil { + l = m.Service.Size() + n += 1 + l + sovNode(uint64(l)) + } + if len(m.Checks) > 0 { + for _, e := range m.Checks { + l = e.Size() + n += 1 + l + sovNode(uint64(l)) + } + } + return n +} + +func (m *Node) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovNode(uint64(l)) + } + l = len(m.Node) + if l > 0 { + n += 1 + l + sovNode(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovNode(uint64(l)) + } + l = len(m.Datacenter) + if l > 0 { + n += 1 + l + sovNode(uint64(l)) + } + if len(m.TaggedAddresses) > 0 { + for k, v := range m.TaggedAddresses { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovNode(uint64(len(k))) + 1 + len(v) + sovNode(uint64(len(v))) + n += mapEntrySize + 1 + sovNode(uint64(mapEntrySize)) + } + } + if len(m.Meta) > 0 { + for k, v := range m.Meta { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovNode(uint64(len(k))) + 1 + len(v) + sovNode(uint64(len(v))) + n += mapEntrySize + 1 + sovNode(uint64(mapEntrySize)) + } + } + l = m.RaftIndex.Size() + n += 1 + l + sovNode(uint64(l)) + return n +} + +func (m *NodeService) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Kind) + if l > 0 { + n += 1 + l + sovNode(uint64(l)) + } + l = len(m.ID) + if l > 0 { + n += 1 + l + sovNode(uint64(l)) + } + l = len(m.Service) + if l > 0 { + n += 1 + l + sovNode(uint64(l)) + } + if len(m.Tags) > 0 { + for _, s := range m.Tags { + l = len(s) + n += 1 + l + sovNode(uint64(l)) + } + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovNode(uint64(l)) + } + if len(m.Meta) > 0 { + for k, v := range m.Meta { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovNode(uint64(len(k))) + 1 + len(v) + sovNode(uint64(len(v))) + n += mapEntrySize + 1 + sovNode(uint64(mapEntrySize)) + } + } + if m.Port != 0 { + n += 1 + sovNode(uint64(m.Port)) + } + if m.Weights != nil { + l = m.Weights.Size() + n += 1 + l + sovNode(uint64(l)) + } + if m.EnableTagOverride { + n += 2 + } + l = m.Proxy.Size() + n += 1 + l + sovNode(uint64(l)) + l = m.Connect.Size() + n += 1 + l + sovNode(uint64(l)) + if m.LocallyRegisteredAsSidecar { + n += 2 + } + l = m.RaftIndex.Size() + n += 1 + l + sovNode(uint64(l)) + if len(m.TaggedAddresses) > 0 { + for k, v := range m.TaggedAddresses { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovNode(uint64(len(k))) + 1 + l + sovNode(uint64(l)) + n += mapEntrySize + 1 + sovNode(uint64(mapEntrySize)) + } + } + l = m.EnterpriseMeta.Size() + n += 2 + l + sovNode(uint64(l)) + return n +} + +func sovNode(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozNode(x uint64) (n int) { + return sovNode(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *CheckServiceNode) 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 ErrIntOverflowNode + } + 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: CheckServiceNode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CheckServiceNode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Node == nil { + m.Node = &Node{} + } + if err := m.Node.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Service == nil { + m.Service = &NodeService{} + } + if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Checks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Checks = append(m.Checks, &HealthCheck{}) + if err := m.Checks[len(m.Checks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNode(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Node) 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 ErrIntOverflowNode + } + 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: Node: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Node: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + 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 ErrInvalidLengthNode + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = github_com_hashicorp_consul_types.NodeID(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 ErrIntOverflowNode + } + 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 ErrInvalidLengthNode + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Node = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + 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 ErrInvalidLengthNode + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowNode + } + 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 ErrInvalidLengthNode + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Datacenter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TaggedAddresses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TaggedAddresses == nil { + m.TaggedAddresses = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthNode + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthNode + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthNode + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthNode + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipNode(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.TaggedAddresses[mapkey] = mapvalue + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Meta == nil { + m.Meta = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthNode + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthNode + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthNode + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthNode + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipNode(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Meta[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftIndex", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RaftIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNode(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NodeService) 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 ErrIntOverflowNode + } + 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: NodeService: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NodeService: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + 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 ErrInvalidLengthNode + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = github_com_hashicorp_consul_agent_structs.ServiceKind(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + 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 ErrInvalidLengthNode + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + 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 ErrInvalidLengthNode + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Service = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + 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 ErrInvalidLengthNode + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tags = append(m.Tags, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + 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 ErrInvalidLengthNode + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Meta == nil { + m.Meta = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthNode + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthNode + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthNode + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthNode + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipNode(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Meta[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + m.Port = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Port |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Weights", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Weights == nil { + m.Weights = &Weights{} + } + if err := m.Weights.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableTagOverride", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableTagOverride = bool(v != 0) + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proxy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Proxy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Connect", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Connect.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LocallyRegisteredAsSidecar", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.LocallyRegisteredAsSidecar = bool(v != 0) + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftIndex", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RaftIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TaggedAddresses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TaggedAddresses == nil { + m.TaggedAddresses = make(map[string]ServiceAddress) + } + var mapkey string + mapvalue := &ServiceAddress{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthNode + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthNode + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthNode + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthNode + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &ServiceAddress{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipNode(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.TaggedAddresses[mapkey] = *mapvalue + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EnterpriseMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.EnterpriseMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNode(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipNode(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, ErrIntOverflowNode + } + 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, ErrIntOverflowNode + } + 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, ErrIntOverflowNode + } + 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, ErrInvalidLengthNode + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthNode + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNode + } + 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 := skipNode(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthNode + } + } + 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 ( + ErrInvalidLengthNode = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowNode = fmt.Errorf("proto: integer overflow") +) diff --git a/proto/pbservice/node.proto b/proto/pbservice/node.proto new file mode 100644 index 0000000000..ab52453fc8 --- /dev/null +++ b/proto/pbservice/node.proto @@ -0,0 +1,115 @@ +syntax = "proto3"; + +package pbservice; + +option go_package = "github.com/hashicorp/consul/proto/pbservice"; + +import "proto/pbcommon/common.proto"; +import "proto/pbcommon/common_oss.proto"; +import "proto/pbservice/healthcheck.proto"; +import "proto/pbservice/service.proto"; + +// This fake import path is replaced by the build script with a versioned path +import "gogoproto/gogo.proto"; + +option (gogoproto.goproto_unkeyed_all) = false; +option (gogoproto.goproto_unrecognized_all) = false; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.goproto_sizecache_all) = false; + +// CheckServiceNode is used to provide the node, its service +// definition, as well as a HealthCheck that is associated. +message CheckServiceNode { + Node Node = 1; + NodeService Service = 2; + repeated HealthCheck Checks = 3; +} + +// Node contains information about a node. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.Node +// output=node.gen.go +// name=Structs +message Node { + string ID = 1 [(gogoproto.casttype) = "github.com/hashicorp/consul/types.NodeID"]; + + string Node = 2; + string Address = 3; + string Datacenter = 4; + map TaggedAddresses = 5; + map Meta = 6; + + // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs + common.RaftIndex RaftIndex = 7 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +// NodeService is a service provided by a node +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.NodeService +// output=node.gen.go +// name=Structs +message NodeService { + // Kind is the kind of service this is. Different kinds of services may + // have differing validation, DNS behavior, etc. An empty kind will default + // to the Default kind. See ServiceKind for the full list of kinds. + string Kind = 1 [(gogoproto.casttype) = "github.com/hashicorp/consul/agent/structs.ServiceKind"]; + + string ID = 2; + string Service = 3; + repeated string Tags = 4; + string Address = 5; + // mog: func-to=MapStringServiceAddressToStructs func-from=NewMapStringServiceAddressFromStructs + map TaggedAddresses = 15 [(gogoproto.nullable) = false]; + map Meta = 6; + // mog: func-to=int func-from=int32 + int32 Port = 7; + + // mog: func-to=WeightsPtrToStructs func-from=NewWeightsPtrFromStructs + Weights Weights = 8; + bool EnableTagOverride = 9; + + // Proxy is the configuration set for Kind = connect-proxy. It is mandatory in + // that case and an error to be set for any other kind. This config is part of + // a proxy service definition and is distinct from but shares some fields with + // the Connect.Proxy which configures a managed proxy as part of the actual + // service's definition. This duplication is ugly but seemed better than the + // alternative which was to re-use the same struct fields for both cases even + // though the semantics are different and the non-shred fields make no sense + // in the other case. ProxyConfig may be a more natural name here, but it's + // confusing for the UX because one of the fields in ConnectProxyConfig is + // also called just "Config" + ConnectProxyConfig Proxy = 11 [(gogoproto.nullable) = false]; + + // Connect are the Connect settings for a service. This is purposely NOT + // a pointer so that we never have to nil-check this. + ServiceConnect Connect = 12 [(gogoproto.nullable) = false]; + + // LocallyRegisteredAsSidecar is private as it is only used by a local agent + // state to track if the service was registered from a nested sidecar_service + // block. We need to track that so we can know whether we need to deregister + // it automatically too if it's removed from the service definition or if the + // parent service is deregistered. Relying only on ID would cause us to + // deregister regular services if they happen to be registered using the same + // ID scheme as our sidecars do by default. We could use meta but that gets + // unpleasant because we can't use the consul- prefix from an agent (reserved + // for use internally but in practice that means within the state store or in + // responses only), and it leaks the detail publicly which people might rely + // on which is a bit unpleasant for something that is meant to be config-file + // syntax sugar. Note this is not translated to ServiceNode and friends and + // may not be set on a NodeService that isn't the one the agent registered and + // keeps in it's local state. We never want this rendered in JSON as it's + // internal only. Right now our agent endpoints return api structs which don't + // include it but this is a safety net incase we change that or there is + // somewhere this is used in API output. + bool LocallyRegisteredAsSidecar = 13; + + // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs + common.EnterpriseMeta EnterpriseMeta = 16 [(gogoproto.nullable) = false]; + + // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs + common.RaftIndex RaftIndex = 14 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/proto/pbservice/structs.pb.binary.go b/proto/pbservice/service.pb.binary.go similarity index 57% rename from proto/pbservice/structs.pb.binary.go rename to proto/pbservice/service.pb.binary.go index aac1f73a0a..2f012d3f1a 100644 --- a/proto/pbservice/structs.pb.binary.go +++ b/proto/pbservice/service.pb.binary.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-binary. DO NOT EDIT. -// source: proto/pbservice/structs.proto +// source: proto/pbservice/service.proto package pbservice @@ -7,86 +7,6 @@ import ( "github.com/golang/protobuf/proto" ) -// MarshalBinary implements encoding.BinaryMarshaler -func (msg *Node) MarshalBinary() ([]byte, error) { - return proto.Marshal(msg) -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler -func (msg *Node) UnmarshalBinary(b []byte) error { - return proto.Unmarshal(b, msg) -} - -// MarshalBinary implements encoding.BinaryMarshaler -func (msg *ServiceDefinition) MarshalBinary() ([]byte, error) { - return proto.Marshal(msg) -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler -func (msg *ServiceDefinition) UnmarshalBinary(b []byte) error { - return proto.Unmarshal(b, msg) -} - -// MarshalBinary implements encoding.BinaryMarshaler -func (msg *ServiceAddress) MarshalBinary() ([]byte, error) { - return proto.Marshal(msg) -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler -func (msg *ServiceAddress) UnmarshalBinary(b []byte) error { - return proto.Unmarshal(b, msg) -} - -// MarshalBinary implements encoding.BinaryMarshaler -func (msg *HealthCheck) MarshalBinary() ([]byte, error) { - return proto.Marshal(msg) -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler -func (msg *HealthCheck) UnmarshalBinary(b []byte) error { - return proto.Unmarshal(b, msg) -} - -// MarshalBinary implements encoding.BinaryMarshaler -func (msg *HeaderValue) MarshalBinary() ([]byte, error) { - return proto.Marshal(msg) -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler -func (msg *HeaderValue) UnmarshalBinary(b []byte) error { - return proto.Unmarshal(b, msg) -} - -// MarshalBinary implements encoding.BinaryMarshaler -func (msg *HealthCheckDefinition) MarshalBinary() ([]byte, error) { - return proto.Marshal(msg) -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler -func (msg *HealthCheckDefinition) UnmarshalBinary(b []byte) error { - return proto.Unmarshal(b, msg) -} - -// MarshalBinary implements encoding.BinaryMarshaler -func (msg *CheckServiceNode) MarshalBinary() ([]byte, error) { - return proto.Marshal(msg) -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler -func (msg *CheckServiceNode) UnmarshalBinary(b []byte) error { - return proto.Unmarshal(b, msg) -} - -// MarshalBinary implements encoding.BinaryMarshaler -func (msg *NodeService) MarshalBinary() ([]byte, error) { - return proto.Marshal(msg) -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler -func (msg *NodeService) UnmarshalBinary(b []byte) error { - return proto.Unmarshal(b, msg) -} - // MarshalBinary implements encoding.BinaryMarshaler func (msg *ConnectProxyConfig) MarshalBinary() ([]byte, error) { return proto.Marshal(msg) @@ -117,16 +37,6 @@ func (msg *ServiceConnect) UnmarshalBinary(b []byte) error { return proto.Unmarshal(b, msg) } -// MarshalBinary implements encoding.BinaryMarshaler -func (msg *Weights) MarshalBinary() ([]byte, error) { - return proto.Marshal(msg) -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler -func (msg *Weights) UnmarshalBinary(b []byte) error { - return proto.Unmarshal(b, msg) -} - // MarshalBinary implements encoding.BinaryMarshaler func (msg *ExposeConfig) MarshalBinary() ([]byte, error) { return proto.Marshal(msg) @@ -147,16 +57,6 @@ func (msg *ExposePath) UnmarshalBinary(b []byte) error { return proto.Unmarshal(b, msg) } -// MarshalBinary implements encoding.BinaryMarshaler -func (msg *CheckType) MarshalBinary() ([]byte, error) { - return proto.Marshal(msg) -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler -func (msg *CheckType) UnmarshalBinary(b []byte) error { - return proto.Unmarshal(b, msg) -} - // MarshalBinary implements encoding.BinaryMarshaler func (msg *MeshGatewayConfig) MarshalBinary() ([]byte, error) { return proto.Marshal(msg) @@ -166,3 +66,33 @@ func (msg *MeshGatewayConfig) MarshalBinary() ([]byte, error) { func (msg *MeshGatewayConfig) UnmarshalBinary(b []byte) error { return proto.Unmarshal(b, msg) } + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *ServiceDefinition) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *ServiceDefinition) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *ServiceAddress) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *ServiceAddress) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *Weights) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *Weights) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} diff --git a/proto/pbservice/service.pb.go b/proto/pbservice/service.pb.go new file mode 100644 index 0000000000..f08541f15d --- /dev/null +++ b/proto/pbservice/service.pb.go @@ -0,0 +1,3664 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: proto/pbservice/service.proto + +package pbservice + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + types "github.com/gogo/protobuf/types" + proto "github.com/golang/protobuf/proto" + github_com_hashicorp_consul_agent_structs "github.com/hashicorp/consul/agent/structs" + pbcommon "github.com/hashicorp/consul/proto/pbcommon" + io "io" + math "math" + math_bits "math/bits" +) + +// 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 + +// ConnectProxyConfig describes the configuration needed for any proxy managed +// or unmanaged. It describes a single logical service's listener and optionally +// upstreams and sidecar-related config for a single instance. To describe a +// centralized proxy that routed traffic for multiple services, a different one +// of these would be needed for each, sharing the same LogicalProxyID. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.ConnectProxyConfig +// output=service.gen.go +// name=Structs +type ConnectProxyConfig struct { + // DestinationServiceName is required and is the name of the service to accept + // traffic for. + DestinationServiceName string `protobuf:"bytes,1,opt,name=DestinationServiceName,proto3" json:"DestinationServiceName,omitempty"` + // DestinationServiceID is optional and should only be specified for + // "side-car" style proxies where the proxy is in front of just a single + // instance of the service. It should be set to the service ID of the instance + // being represented which must be registered to the same agent. It's valid to + // provide a service ID that does not yet exist to avoid timing issues when + // bootstrapping a service with a proxy. + DestinationServiceID string `protobuf:"bytes,2,opt,name=DestinationServiceID,proto3" json:"DestinationServiceID,omitempty"` + // LocalServiceAddress is the address of the local service instance. It is + // optional and should only be specified for "side-car" style proxies. It will + // default to 127.0.0.1 if the proxy is a "side-car" (DestinationServiceID is + // set) but otherwise will be ignored. + LocalServiceAddress string `protobuf:"bytes,3,opt,name=LocalServiceAddress,proto3" json:"LocalServiceAddress,omitempty"` + // LocalServicePort is the port of the local service instance. It is optional + // and should only be specified for "side-car" style proxies. It will default + // to the registered port for the instance if the proxy is a "side-car" + // (DestinationServiceID is set) but otherwise will be ignored. + // mog: func-to=int func-from=int32 + LocalServicePort int32 `protobuf:"varint,4,opt,name=LocalServicePort,proto3" json:"LocalServicePort,omitempty"` + // Config is the arbitrary configuration data provided with the proxy + // registration. + // mog: func-to=MapStringInterfaceToStructs func-from=NewMapStringInterfaceFromStructs + Config *types.Struct `protobuf:"bytes,5,opt,name=Config,proto3" json:"Config,omitempty"` + // Upstreams describes any upstream dependencies the proxy instance should + // setup. + // mog: func-to=UpstreamsToStructs func-from=NewUpstreamsFromStructs + Upstreams []Upstream `protobuf:"bytes,6,rep,name=Upstreams,proto3" json:"Upstreams"` + // MeshGateway defines the mesh gateway configuration for this upstream + MeshGateway MeshGatewayConfig `protobuf:"bytes,7,opt,name=MeshGateway,proto3" json:"MeshGateway"` + // Expose defines whether checks or paths are exposed through the proxy + Expose ExposeConfig `protobuf:"bytes,8,opt,name=Expose,proto3" json:"Expose"` +} + +func (m *ConnectProxyConfig) Reset() { *m = ConnectProxyConfig{} } +func (m *ConnectProxyConfig) String() string { return proto.CompactTextString(m) } +func (*ConnectProxyConfig) ProtoMessage() {} +func (*ConnectProxyConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_cbb99233b75fb80b, []int{0} +} +func (m *ConnectProxyConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConnectProxyConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConnectProxyConfig.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConnectProxyConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConnectProxyConfig.Merge(m, src) +} +func (m *ConnectProxyConfig) XXX_Size() int { + return m.Size() +} +func (m *ConnectProxyConfig) XXX_DiscardUnknown() { + xxx_messageInfo_ConnectProxyConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_ConnectProxyConfig proto.InternalMessageInfo + +// Upstream represents a single upstream dependency for a service or proxy. It +// describes the mechanism used to discover instances to communicate with (the +// Target) as well as any potential client configuration that may be useful such +// as load balancer options, timeouts etc. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.Upstream +// output=service.gen.go +// name=Structs +// ignore-fields=IngressHosts +type Upstream struct { + // Destination fields are the required ones for determining what this upstream + // points to. Depending on DestinationType some other fields below might + // further restrict the set of instances allowable. + // + // DestinationType would be better as an int constant but even with custom + // JSON marshallers it causes havoc with all the mapstructure mangling we do + // on service definitions in various places. + DestinationType string `protobuf:"bytes,1,opt,name=DestinationType,proto3" json:"DestinationType,omitempty"` + DestinationNamespace string `protobuf:"bytes,2,opt,name=DestinationNamespace,proto3" json:"DestinationNamespace,omitempty"` + DestinationName string `protobuf:"bytes,3,opt,name=DestinationName,proto3" json:"DestinationName,omitempty"` + // Datacenter that the service discovery request should be run against. Note + // for prepared queries, the actual results might be from a different + // datacenter. + Datacenter string `protobuf:"bytes,4,opt,name=Datacenter,proto3" json:"Datacenter,omitempty"` + // LocalBindAddress is the ip address a side-car proxy should listen on for + // traffic destined for this upstream service. Default if empty is 127.0.0.1. + LocalBindAddress string `protobuf:"bytes,5,opt,name=LocalBindAddress,proto3" json:"LocalBindAddress,omitempty"` + // LocalBindPort is the ip address a side-car proxy should listen on for + // traffic destined for this upstream service. Required. + // mog: func-to=int func-from=int32 + LocalBindPort int32 `protobuf:"varint,6,opt,name=LocalBindPort,proto3" json:"LocalBindPort,omitempty"` + // Config is an opaque config that is specific to the proxy process being run. + // It can be used to pass arbitrary configuration for this specific upstream + // to the proxy. + // mog: func-to=MapStringInterfaceToStructs func-from=NewMapStringInterfaceFromStructs + Config *types.Struct `protobuf:"bytes,7,opt,name=Config,proto3" json:"Config,omitempty"` + // MeshGateway is the configuration for mesh gateway usage of this upstream + MeshGateway MeshGatewayConfig `protobuf:"bytes,8,opt,name=MeshGateway,proto3" json:"MeshGateway"` +} + +func (m *Upstream) Reset() { *m = Upstream{} } +func (m *Upstream) String() string { return proto.CompactTextString(m) } +func (*Upstream) ProtoMessage() {} +func (*Upstream) Descriptor() ([]byte, []int) { + return fileDescriptor_cbb99233b75fb80b, []int{1} +} +func (m *Upstream) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Upstream) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Upstream.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Upstream) XXX_Merge(src proto.Message) { + xxx_messageInfo_Upstream.Merge(m, src) +} +func (m *Upstream) XXX_Size() int { + return m.Size() +} +func (m *Upstream) XXX_DiscardUnknown() { + xxx_messageInfo_Upstream.DiscardUnknown(m) +} + +var xxx_messageInfo_Upstream proto.InternalMessageInfo + +// ServiceConnect are the shared Connect settings between all service +// definitions from the agent to the state store. +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.ServiceConnect +// output=service.gen.go +// name=Structs +type ServiceConnect struct { + // Native is true when this service can natively understand Connect. + Native bool `protobuf:"varint,1,opt,name=Native,proto3" json:"Native,omitempty"` + // SidecarService is a nested Service Definition to register at the same time. + // It's purely a convenience mechanism to allow specifying a sidecar service + // along with the application service definition. It's nested nature allows + // all of the fields to be defaulted which can reduce the amount of + // boilerplate needed to register a sidecar service separately, but the end + // result is identical to just making a second service registration via any + // other means. + // mog: func-to=ServiceDefinitionPtrToStructs func-from=NewServiceDefinitionPtrFromStructs + SidecarService *ServiceDefinition `protobuf:"bytes,3,opt,name=SidecarService,proto3" json:"SidecarService,omitempty"` +} + +func (m *ServiceConnect) Reset() { *m = ServiceConnect{} } +func (m *ServiceConnect) String() string { return proto.CompactTextString(m) } +func (*ServiceConnect) ProtoMessage() {} +func (*ServiceConnect) Descriptor() ([]byte, []int) { + return fileDescriptor_cbb99233b75fb80b, []int{2} +} +func (m *ServiceConnect) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServiceConnect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ServiceConnect.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ServiceConnect) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceConnect.Merge(m, src) +} +func (m *ServiceConnect) XXX_Size() int { + return m.Size() +} +func (m *ServiceConnect) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceConnect.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceConnect proto.InternalMessageInfo + +// ExposeConfig describes HTTP paths to expose through Envoy outside of Connect. +// Users can expose individual paths and/or all HTTP/GRPC paths for checks. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.ExposeConfig +// output=service.gen.go +// name=Structs +type ExposeConfig struct { + // Checks defines whether paths associated with Consul checks will be exposed. + // This flag triggers exposing all HTTP and GRPC check paths registered for the service. + Checks bool `protobuf:"varint,1,opt,name=Checks,proto3" json:"Checks,omitempty"` + // Paths is the list of paths exposed through the proxy. + // mog: func-to=ExposePathSliceToStructs func-from=NewExposePathSliceFromStructs + Paths []ExposePath `protobuf:"bytes,2,rep,name=Paths,proto3" json:"Paths"` +} + +func (m *ExposeConfig) Reset() { *m = ExposeConfig{} } +func (m *ExposeConfig) String() string { return proto.CompactTextString(m) } +func (*ExposeConfig) ProtoMessage() {} +func (*ExposeConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_cbb99233b75fb80b, []int{3} +} +func (m *ExposeConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExposeConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExposeConfig.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ExposeConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExposeConfig.Merge(m, src) +} +func (m *ExposeConfig) XXX_Size() int { + return m.Size() +} +func (m *ExposeConfig) XXX_DiscardUnknown() { + xxx_messageInfo_ExposeConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_ExposeConfig proto.InternalMessageInfo + +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.ExposePath +// output=service.gen.go +// name=Structs +type ExposePath struct { + // ListenerPort defines the port of the proxy's listener for exposed paths. + // mog: func-to=int func-from=int32 + ListenerPort int32 `protobuf:"varint,1,opt,name=ListenerPort,proto3" json:"ListenerPort,omitempty"` + // ExposePath is the path to expose through the proxy, ie. "/metrics." + Path string `protobuf:"bytes,2,opt,name=Path,proto3" json:"Path,omitempty"` + // LocalPathPort is the port that the service is listening on for the given path. + // mog: func-to=int func-from=int32 + LocalPathPort int32 `protobuf:"varint,3,opt,name=LocalPathPort,proto3" json:"LocalPathPort,omitempty"` + // Protocol describes the upstream's service protocol. + // Valid values are "http" and "http2", defaults to "http" + Protocol string `protobuf:"bytes,4,opt,name=Protocol,proto3" json:"Protocol,omitempty"` + // ParsedFromCheck is set if this path was parsed from a registered check + ParsedFromCheck bool `protobuf:"varint,5,opt,name=ParsedFromCheck,proto3" json:"ParsedFromCheck,omitempty"` +} + +func (m *ExposePath) Reset() { *m = ExposePath{} } +func (m *ExposePath) String() string { return proto.CompactTextString(m) } +func (*ExposePath) ProtoMessage() {} +func (*ExposePath) Descriptor() ([]byte, []int) { + return fileDescriptor_cbb99233b75fb80b, []int{4} +} +func (m *ExposePath) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExposePath) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExposePath.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ExposePath) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExposePath.Merge(m, src) +} +func (m *ExposePath) XXX_Size() int { + return m.Size() +} +func (m *ExposePath) XXX_DiscardUnknown() { + xxx_messageInfo_ExposePath.DiscardUnknown(m) +} + +var xxx_messageInfo_ExposePath proto.InternalMessageInfo + +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.MeshGatewayConfig +// output=service.gen.go +// name=Structs +type MeshGatewayConfig struct { + Mode github_com_hashicorp_consul_agent_structs.MeshGatewayMode `protobuf:"bytes,1,opt,name=Mode,proto3,casttype=github.com/hashicorp/consul/agent/structs.MeshGatewayMode" json:"Mode,omitempty"` +} + +func (m *MeshGatewayConfig) Reset() { *m = MeshGatewayConfig{} } +func (m *MeshGatewayConfig) String() string { return proto.CompactTextString(m) } +func (*MeshGatewayConfig) ProtoMessage() {} +func (*MeshGatewayConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_cbb99233b75fb80b, []int{5} +} +func (m *MeshGatewayConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MeshGatewayConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MeshGatewayConfig.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MeshGatewayConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_MeshGatewayConfig.Merge(m, src) +} +func (m *MeshGatewayConfig) XXX_Size() int { + return m.Size() +} +func (m *MeshGatewayConfig) XXX_DiscardUnknown() { + xxx_messageInfo_MeshGatewayConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_MeshGatewayConfig proto.InternalMessageInfo + +// ServiceDefinition is used to JSON decode the Service definitions. For +// documentation on specific fields see NodeService which is better documented. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.ServiceDefinition +// output=service.gen.go +// name=Structs +type ServiceDefinition struct { + Kind github_com_hashicorp_consul_agent_structs.ServiceKind `protobuf:"bytes,1,opt,name=Kind,proto3,casttype=github.com/hashicorp/consul/agent/structs.ServiceKind" json:"Kind,omitempty"` + ID string `protobuf:"bytes,2,opt,name=ID,proto3" json:"ID,omitempty"` + Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"` + Tags []string `protobuf:"bytes,4,rep,name=Tags,proto3" json:"Tags,omitempty"` + Address string `protobuf:"bytes,5,opt,name=Address,proto3" json:"Address,omitempty"` + // mog: func-to=MapStringServiceAddressToStructs func-from=NewMapStringServiceAddressFromStructs + TaggedAddresses map[string]ServiceAddress `protobuf:"bytes,16,rep,name=TaggedAddresses,proto3" json:"TaggedAddresses" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Meta map[string]string `protobuf:"bytes,6,rep,name=Meta,proto3" json:"Meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // mog: func-to=int func-from=int32 + Port int32 `protobuf:"varint,7,opt,name=Port,proto3" json:"Port,omitempty"` + Check CheckType `protobuf:"bytes,8,opt,name=Check,proto3" json:"Check"` + // mog: func-to=CheckTypesToStructs func-from=NewCheckTypesFromStructs + Checks []*CheckType `protobuf:"bytes,9,rep,name=Checks,proto3" json:"Checks,omitempty"` + // mog: func-to=WeightsPtrToStructs func-from=NewWeightsPtrFromStructs + Weights *Weights `protobuf:"bytes,10,opt,name=Weights,proto3" json:"Weights,omitempty"` + Token string `protobuf:"bytes,11,opt,name=Token,proto3" json:"Token,omitempty"` + EnableTagOverride bool `protobuf:"varint,12,opt,name=EnableTagOverride,proto3" json:"EnableTagOverride,omitempty"` + // Proxy is the configuration set for Kind = connect-proxy. It is mandatory in + // that case and an error to be set for any other kind. This config is part of + // a proxy service definition and is distinct from but shares some fields with + // the Connect.Proxy which configures a managed proxy as part of the actual + // service's definition. This duplication is ugly but seemed better than the + // alternative which was to re-use the same struct fields for both cases even + // though the semantics are different and the non-shared fields make no sense + // in the other case. ProxyConfig may be a more natural name here, but it's + // confusing for the UX because one of the fields in ConnectProxyConfig is + // also called just "Config" + // mog: func-to=ConnectProxyConfigPtrToStructs func-from=NewConnectProxyConfigPtrFromStructs + Proxy *ConnectProxyConfig `protobuf:"bytes,14,opt,name=Proxy,proto3" json:"Proxy,omitempty"` + // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs + EnterpriseMeta pbcommon.EnterpriseMeta `protobuf:"bytes,17,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta"` + // mog: func-to=ServiceConnectPtrToStructs func-from=NewServiceConnectPtrFromStructs + Connect *ServiceConnect `protobuf:"bytes,15,opt,name=Connect,proto3" json:"Connect,omitempty"` +} + +func (m *ServiceDefinition) Reset() { *m = ServiceDefinition{} } +func (m *ServiceDefinition) String() string { return proto.CompactTextString(m) } +func (*ServiceDefinition) ProtoMessage() {} +func (*ServiceDefinition) Descriptor() ([]byte, []int) { + return fileDescriptor_cbb99233b75fb80b, []int{6} +} +func (m *ServiceDefinition) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServiceDefinition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ServiceDefinition.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ServiceDefinition) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceDefinition.Merge(m, src) +} +func (m *ServiceDefinition) XXX_Size() int { + return m.Size() +} +func (m *ServiceDefinition) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceDefinition.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceDefinition proto.InternalMessageInfo + +// Type to hold an address and port of a service +type ServiceAddress struct { + Address string `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"` + // mog: func-to=int func-from=int32 + Port int32 `protobuf:"varint,2,opt,name=Port,proto3" json:"Port,omitempty"` +} + +func (m *ServiceAddress) Reset() { *m = ServiceAddress{} } +func (m *ServiceAddress) String() string { return proto.CompactTextString(m) } +func (*ServiceAddress) ProtoMessage() {} +func (*ServiceAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_cbb99233b75fb80b, []int{7} +} +func (m *ServiceAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServiceAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ServiceAddress.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ServiceAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceAddress.Merge(m, src) +} +func (m *ServiceAddress) XXX_Size() int { + return m.Size() +} +func (m *ServiceAddress) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceAddress proto.InternalMessageInfo + +// Weights represent the weight used by DNS for a given status +type Weights struct { + // mog: func-to=int func-from=int32 + Passing int32 `protobuf:"varint,1,opt,name=Passing,proto3" json:"Passing,omitempty"` + // mog: func-to=int func-from=int32 + Warning int32 `protobuf:"varint,2,opt,name=Warning,proto3" json:"Warning,omitempty"` +} + +func (m *Weights) Reset() { *m = Weights{} } +func (m *Weights) String() string { return proto.CompactTextString(m) } +func (*Weights) ProtoMessage() {} +func (*Weights) Descriptor() ([]byte, []int) { + return fileDescriptor_cbb99233b75fb80b, []int{8} +} +func (m *Weights) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Weights) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Weights.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Weights) XXX_Merge(src proto.Message) { + xxx_messageInfo_Weights.Merge(m, src) +} +func (m *Weights) XXX_Size() int { + return m.Size() +} +func (m *Weights) XXX_DiscardUnknown() { + xxx_messageInfo_Weights.DiscardUnknown(m) +} + +var xxx_messageInfo_Weights proto.InternalMessageInfo + +func init() { + proto.RegisterType((*ConnectProxyConfig)(nil), "pbservice.ConnectProxyConfig") + proto.RegisterType((*Upstream)(nil), "pbservice.Upstream") + proto.RegisterType((*ServiceConnect)(nil), "pbservice.ServiceConnect") + proto.RegisterType((*ExposeConfig)(nil), "pbservice.ExposeConfig") + proto.RegisterType((*ExposePath)(nil), "pbservice.ExposePath") + proto.RegisterType((*MeshGatewayConfig)(nil), "pbservice.MeshGatewayConfig") + proto.RegisterType((*ServiceDefinition)(nil), "pbservice.ServiceDefinition") + proto.RegisterMapType((map[string]string)(nil), "pbservice.ServiceDefinition.MetaEntry") + proto.RegisterMapType((map[string]ServiceAddress)(nil), "pbservice.ServiceDefinition.TaggedAddressesEntry") + proto.RegisterType((*ServiceAddress)(nil), "pbservice.ServiceAddress") + proto.RegisterType((*Weights)(nil), "pbservice.Weights") +} + +func init() { proto.RegisterFile("proto/pbservice/service.proto", fileDescriptor_cbb99233b75fb80b) } + +var fileDescriptor_cbb99233b75fb80b = []byte{ + // 1052 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xdd, 0x6e, 0x1b, 0x45, + 0x14, 0xf6, 0xfa, 0x27, 0xb6, 0x4f, 0x42, 0x7e, 0xa6, 0x26, 0x2c, 0x51, 0xeb, 0x84, 0x15, 0x42, + 0x11, 0x44, 0xeb, 0x36, 0x51, 0x29, 0xad, 0x54, 0x24, 0x12, 0x07, 0x54, 0xd1, 0x14, 0xb3, 0x09, + 0xaa, 0x40, 0x42, 0x68, 0xb2, 0x9e, 0xac, 0x57, 0xb1, 0x77, 0xac, 0x9d, 0x49, 0xa8, 0x2f, 0xfb, + 0x06, 0x5c, 0xf2, 0x18, 0x3c, 0x46, 0x24, 0x6e, 0x7a, 0xc9, 0x55, 0x04, 0xc9, 0x5b, 0xf4, 0x0a, + 0xcd, 0x99, 0xd9, 0xcd, 0x7a, 0xd7, 0x44, 0xc0, 0x95, 0x67, 0xce, 0x39, 0xdf, 0x77, 0x76, 0xcf, + 0xf7, 0xcd, 0xac, 0xe1, 0xde, 0x38, 0xe6, 0x92, 0x77, 0xc6, 0xc7, 0x82, 0xc5, 0xe7, 0xa1, 0xcf, + 0x3a, 0xe6, 0xd7, 0xc5, 0x38, 0x69, 0xa6, 0x89, 0xb5, 0xbb, 0x01, 0xe7, 0xc1, 0x90, 0x75, 0x30, + 0x71, 0x7c, 0x76, 0xd2, 0x11, 0x32, 0x3e, 0xf3, 0xa5, 0x2e, 0x5c, 0x5b, 0x4f, 0x78, 0x7c, 0x3e, + 0x1a, 0xf1, 0xa8, 0xa3, 0x7f, 0x7e, 0xe2, 0x42, 0x98, 0x82, 0x0f, 0xf2, 0x8d, 0x06, 0x8c, 0x0e, + 0xe5, 0xc0, 0x1f, 0x30, 0xff, 0xd4, 0x94, 0xb4, 0x02, 0x1e, 0x70, 0x5d, 0xa6, 0x56, 0x3a, 0xea, + 0xfc, 0x5e, 0x01, 0xb2, 0xc7, 0xa3, 0x88, 0xf9, 0xb2, 0x17, 0xf3, 0x57, 0x93, 0x3d, 0x1e, 0x9d, + 0x84, 0x01, 0xf9, 0x14, 0x56, 0xbb, 0x4c, 0xc8, 0x30, 0xa2, 0x32, 0xe4, 0xd1, 0xa1, 0x26, 0x7d, + 0x41, 0x47, 0xcc, 0xb6, 0x36, 0xac, 0xcd, 0xa6, 0xf7, 0x0f, 0x59, 0xb2, 0x0d, 0xad, 0x62, 0xe6, + 0x59, 0xd7, 0x2e, 0x23, 0x6a, 0x66, 0x8e, 0xdc, 0x87, 0x3b, 0xcf, 0xb9, 0x4f, 0x87, 0x26, 0xf2, + 0x45, 0xbf, 0x1f, 0x33, 0x21, 0xec, 0x0a, 0x42, 0x66, 0xa5, 0xc8, 0xc7, 0xb0, 0x9c, 0x0d, 0xf7, + 0x78, 0x2c, 0xed, 0xea, 0x86, 0xb5, 0x59, 0xf3, 0x0a, 0x71, 0xf2, 0x10, 0xe6, 0xf4, 0x3b, 0xd9, + 0xb5, 0x0d, 0x6b, 0x73, 0x7e, 0xfb, 0x3d, 0x57, 0x4f, 0xda, 0x4d, 0x26, 0xed, 0x1e, 0xe2, 0xa4, + 0x77, 0xab, 0x17, 0x97, 0xeb, 0x96, 0x67, 0x8a, 0xc9, 0x23, 0x68, 0x7e, 0x37, 0x16, 0x32, 0x66, + 0x74, 0x24, 0xec, 0xb9, 0x8d, 0xca, 0xe6, 0xfc, 0xf6, 0x1d, 0x37, 0x1d, 0xaf, 0x9b, 0xe4, 0x10, + 0x55, 0xf2, 0x6e, 0x6a, 0x49, 0x17, 0xe6, 0x0f, 0x98, 0x18, 0x7c, 0x45, 0x25, 0xfb, 0x99, 0x4e, + 0xec, 0x3a, 0x36, 0xbd, 0x9b, 0x81, 0x66, 0xb2, 0xba, 0x97, 0xe1, 0xc8, 0xc2, 0xd4, 0x53, 0xef, + 0xbf, 0x1a, 0x73, 0xc1, 0xec, 0x86, 0x79, 0xea, 0x1b, 0x02, 0x9d, 0x98, 0xc2, 0x9a, 0x62, 0xe7, + 0x75, 0x05, 0x1a, 0xc9, 0xa3, 0x90, 0x4d, 0x58, 0xca, 0xcc, 0xfb, 0x68, 0x32, 0x4e, 0xc4, 0xcb, + 0x87, 0x73, 0xaa, 0x29, 0x21, 0xc5, 0x98, 0xfa, 0x6c, 0x86, 0x6a, 0x69, 0x2e, 0xc7, 0x8e, 0xd6, + 0xa8, 0x14, 0xd8, 0xd1, 0x13, 0x6d, 0x80, 0x2e, 0x95, 0xd4, 0x67, 0x91, 0x64, 0x31, 0xea, 0xd4, + 0xf4, 0x32, 0x91, 0x54, 0xcd, 0xdd, 0x30, 0xea, 0x27, 0xe2, 0xd7, 0xb0, 0xaa, 0x10, 0x27, 0x1f, + 0xc2, 0x3b, 0x69, 0x0c, 0x65, 0x9f, 0x43, 0xd9, 0xa7, 0x83, 0x19, 0xcd, 0xeb, 0xff, 0x45, 0xf3, + 0x9c, 0x74, 0x8d, 0xff, 0x25, 0x9d, 0x13, 0xc1, 0xa2, 0xf1, 0x9f, 0x39, 0x57, 0x64, 0x15, 0xe6, + 0x5e, 0x50, 0x19, 0x9e, 0xeb, 0xf9, 0x37, 0x3c, 0xb3, 0x23, 0x5d, 0x58, 0x3c, 0x0c, 0xfb, 0xcc, + 0xa7, 0xb1, 0x01, 0xe0, 0x04, 0xa7, 0x5b, 0x9a, 0x4c, 0x97, 0x9d, 0x84, 0x51, 0xa8, 0x46, 0xea, + 0xe5, 0x30, 0xce, 0xf7, 0xb0, 0x90, 0x75, 0x84, 0xea, 0xb6, 0xa7, 0x8e, 0xbd, 0x48, 0xba, 0xe9, + 0x1d, 0x79, 0x00, 0xb5, 0x1e, 0x95, 0x03, 0x61, 0x97, 0xd1, 0xcd, 0xef, 0x16, 0x1c, 0xa5, 0xb2, + 0xe6, 0x85, 0x74, 0xa5, 0xf3, 0x9b, 0x05, 0x70, 0x93, 0x23, 0x0e, 0x2c, 0x3c, 0x0f, 0x85, 0x64, + 0x11, 0x8b, 0x71, 0xf6, 0x16, 0xce, 0x7e, 0x2a, 0x46, 0x08, 0x54, 0x55, 0xad, 0xb1, 0x0e, 0xae, + 0x53, 0xd1, 0xd4, 0x06, 0x81, 0x95, 0x8c, 0x68, 0x49, 0x90, 0xac, 0x41, 0xa3, 0xa7, 0xe4, 0xf1, + 0xf9, 0xd0, 0x98, 0x24, 0xdd, 0x2b, 0xb3, 0xf5, 0x68, 0x2c, 0x58, 0xff, 0xcb, 0x98, 0x8f, 0xf0, + 0x7d, 0xd0, 0x21, 0x0d, 0x2f, 0x1f, 0x76, 0x4e, 0x60, 0xa5, 0xa0, 0x12, 0xf9, 0x16, 0xaa, 0x07, + 0xbc, 0x6f, 0xec, 0xbf, 0xfb, 0xf4, 0xed, 0xe5, 0xfa, 0xe3, 0x20, 0x94, 0x83, 0xb3, 0x63, 0xd7, + 0xe7, 0xa3, 0xce, 0x80, 0x8a, 0x41, 0xe8, 0xf3, 0x78, 0xdc, 0xf1, 0x79, 0x24, 0xce, 0x86, 0x1d, + 0x1a, 0xb0, 0x48, 0x9a, 0x0b, 0x58, 0x64, 0x45, 0x57, 0x24, 0x1e, 0x52, 0x39, 0xaf, 0xeb, 0xb0, + 0x52, 0xd0, 0x86, 0x1c, 0x40, 0xf5, 0xeb, 0x30, 0xea, 0x9b, 0x46, 0x8f, 0xdf, 0x5e, 0xae, 0x3f, + 0xfc, 0xf7, 0x8d, 0x0c, 0x9d, 0x22, 0xf0, 0x90, 0x86, 0x2c, 0x42, 0x39, 0xbd, 0x3b, 0xcb, 0xcf, + 0xba, 0x6a, 0xb8, 0x99, 0x83, 0x86, 0x6b, 0x15, 0x3b, 0xa2, 0x81, 0xb0, 0xab, 0x1b, 0x15, 0x15, + 0x53, 0x6b, 0x62, 0x43, 0x7d, 0xfa, 0x20, 0x25, 0x5b, 0x42, 0x61, 0xe9, 0x88, 0x06, 0x01, 0x4b, + 0x0e, 0x14, 0x13, 0xf6, 0x32, 0xda, 0xe1, 0xc1, 0x6d, 0x9e, 0x73, 0x73, 0x98, 0xfd, 0x48, 0xc6, + 0x13, 0x63, 0x95, 0x3c, 0x1f, 0x79, 0x02, 0xd5, 0x03, 0x26, 0xa9, 0xb9, 0x34, 0x3f, 0xba, 0x95, + 0x57, 0x15, 0x22, 0x99, 0x87, 0x18, 0x74, 0x8f, 0x32, 0x48, 0x1d, 0x0d, 0x82, 0x6b, 0x72, 0x1f, + 0x6a, 0x5a, 0x71, 0x7d, 0x1e, 0x5b, 0x19, 0x42, 0x8c, 0xab, 0x1b, 0x2c, 0xb1, 0x2d, 0x06, 0xc8, + 0x56, 0x7a, 0x02, 0x9a, 0xf8, 0x0c, 0x33, 0x21, 0xe9, 0xb9, 0xd8, 0x82, 0xfa, 0x4b, 0x16, 0x06, + 0x03, 0x29, 0x6c, 0xc0, 0x0e, 0x24, 0x53, 0x6e, 0x32, 0x5e, 0x52, 0x42, 0x5a, 0x50, 0x3b, 0xe2, + 0xa7, 0x2c, 0xb2, 0xe7, 0x71, 0xb0, 0x7a, 0x43, 0xb6, 0x60, 0x65, 0x3f, 0xa2, 0xc7, 0x43, 0x76, + 0x44, 0x83, 0x6f, 0xce, 0x59, 0x1c, 0x87, 0x7d, 0x66, 0x2f, 0xa0, 0x43, 0x8b, 0x09, 0xb2, 0x03, + 0x35, 0xfc, 0xd6, 0xda, 0x8b, 0xd8, 0xef, 0x5e, 0xf6, 0xf1, 0x0a, 0x9f, 0x62, 0x4f, 0xd7, 0xaa, + 0xcb, 0x62, 0x5f, 0x5d, 0x97, 0xe3, 0x38, 0x14, 0x0c, 0x07, 0xbc, 0x82, 0xe8, 0x55, 0x57, 0xff, + 0x19, 0x70, 0xa7, 0xb3, 0x66, 0x22, 0x39, 0x0c, 0xd9, 0x81, 0xba, 0x69, 0x61, 0x2f, 0x21, 0xfc, + 0xfd, 0xa2, 0x3e, 0xa6, 0xc0, 0x4b, 0x2a, 0xd7, 0x7e, 0x84, 0xd6, 0x2c, 0x03, 0x90, 0x65, 0xa8, + 0x9c, 0xb2, 0x89, 0xf9, 0xa8, 0xa8, 0x25, 0xe9, 0x40, 0xed, 0x9c, 0x0e, 0xcf, 0xf4, 0x97, 0x63, + 0x26, 0xb9, 0xa1, 0xf0, 0x74, 0xdd, 0x93, 0xf2, 0x67, 0xd6, 0xda, 0x23, 0x68, 0xa6, 0x3e, 0x98, + 0xc1, 0xd9, 0xca, 0x72, 0x36, 0x33, 0x40, 0xe7, 0xf3, 0xf4, 0xa6, 0x4d, 0xec, 0x9d, 0x31, 0xbe, + 0x35, 0x6d, 0xfc, 0xc4, 0x59, 0xe5, 0x1b, 0x67, 0x39, 0x4f, 0x53, 0xe5, 0x15, 0xb0, 0x47, 0x85, + 0x08, 0xa3, 0xc0, 0xdc, 0x6a, 0xc9, 0x56, 0x65, 0x5e, 0xd2, 0x38, 0x52, 0x19, 0x8d, 0x4d, 0xb6, + 0xbb, 0x07, 0x17, 0x7f, 0xb5, 0x4b, 0x17, 0x57, 0x6d, 0xeb, 0xcd, 0x55, 0xdb, 0xfa, 0xf3, 0xaa, + 0x6d, 0xfd, 0x72, 0xdd, 0x2e, 0xfd, 0x7a, 0xdd, 0x2e, 0xbd, 0xb9, 0x6e, 0x97, 0xfe, 0xb8, 0x6e, + 0x97, 0x7e, 0xf8, 0xe4, 0xb6, 0xc3, 0x9f, 0xfb, 0xc7, 0x76, 0x3c, 0x87, 0x81, 0x9d, 0xbf, 0x03, + 0x00, 0x00, 0xff, 0xff, 0x90, 0xb6, 0xca, 0xac, 0x34, 0x0a, 0x00, 0x00, +} + +func (m *ConnectProxyConfig) 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 *ConnectProxyConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectProxyConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Expose.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size, err := m.MeshGateway.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if len(m.Upstreams) > 0 { + for iNdEx := len(m.Upstreams) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Upstreams[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.Config != nil { + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.LocalServicePort != 0 { + i = encodeVarintService(dAtA, i, uint64(m.LocalServicePort)) + i-- + dAtA[i] = 0x20 + } + if len(m.LocalServiceAddress) > 0 { + i -= len(m.LocalServiceAddress) + copy(dAtA[i:], m.LocalServiceAddress) + i = encodeVarintService(dAtA, i, uint64(len(m.LocalServiceAddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.DestinationServiceID) > 0 { + i -= len(m.DestinationServiceID) + copy(dAtA[i:], m.DestinationServiceID) + i = encodeVarintService(dAtA, i, uint64(len(m.DestinationServiceID))) + i-- + dAtA[i] = 0x12 + } + if len(m.DestinationServiceName) > 0 { + i -= len(m.DestinationServiceName) + copy(dAtA[i:], m.DestinationServiceName) + i = encodeVarintService(dAtA, i, uint64(len(m.DestinationServiceName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Upstream) 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 *Upstream) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Upstream) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.MeshGateway.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + if m.Config != nil { + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.LocalBindPort != 0 { + i = encodeVarintService(dAtA, i, uint64(m.LocalBindPort)) + i-- + dAtA[i] = 0x30 + } + if len(m.LocalBindAddress) > 0 { + i -= len(m.LocalBindAddress) + copy(dAtA[i:], m.LocalBindAddress) + i = encodeVarintService(dAtA, i, uint64(len(m.LocalBindAddress))) + i-- + dAtA[i] = 0x2a + } + if len(m.Datacenter) > 0 { + i -= len(m.Datacenter) + copy(dAtA[i:], m.Datacenter) + i = encodeVarintService(dAtA, i, uint64(len(m.Datacenter))) + i-- + dAtA[i] = 0x22 + } + if len(m.DestinationName) > 0 { + i -= len(m.DestinationName) + copy(dAtA[i:], m.DestinationName) + i = encodeVarintService(dAtA, i, uint64(len(m.DestinationName))) + i-- + dAtA[i] = 0x1a + } + if len(m.DestinationNamespace) > 0 { + i -= len(m.DestinationNamespace) + copy(dAtA[i:], m.DestinationNamespace) + i = encodeVarintService(dAtA, i, uint64(len(m.DestinationNamespace))) + i-- + dAtA[i] = 0x12 + } + if len(m.DestinationType) > 0 { + i -= len(m.DestinationType) + copy(dAtA[i:], m.DestinationType) + i = encodeVarintService(dAtA, i, uint64(len(m.DestinationType))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ServiceConnect) 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 *ServiceConnect) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceConnect) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SidecarService != nil { + { + size, err := m.SidecarService.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Native { + i-- + if m.Native { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ExposeConfig) 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 *ExposeConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExposeConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Paths) > 0 { + for iNdEx := len(m.Paths) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Paths[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Checks { + i-- + if m.Checks { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ExposePath) 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 *ExposePath) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExposePath) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ParsedFromCheck { + i-- + if m.ParsedFromCheck { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if len(m.Protocol) > 0 { + i -= len(m.Protocol) + copy(dAtA[i:], m.Protocol) + i = encodeVarintService(dAtA, i, uint64(len(m.Protocol))) + i-- + dAtA[i] = 0x22 + } + if m.LocalPathPort != 0 { + i = encodeVarintService(dAtA, i, uint64(m.LocalPathPort)) + i-- + dAtA[i] = 0x18 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintService(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x12 + } + if m.ListenerPort != 0 { + i = encodeVarintService(dAtA, i, uint64(m.ListenerPort)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MeshGatewayConfig) 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 *MeshGatewayConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MeshGatewayConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Mode) > 0 { + i -= len(m.Mode) + copy(dAtA[i:], m.Mode) + i = encodeVarintService(dAtA, i, uint64(len(m.Mode))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ServiceDefinition) 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 *ServiceDefinition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceDefinition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.EnterpriseMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + if len(m.TaggedAddresses) > 0 { + for k := range m.TaggedAddresses { + v := m.TaggedAddresses[k] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + } + if m.Connect != nil { + { + size, err := m.Connect.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if m.Proxy != nil { + { + size, err := m.Proxy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if m.EnableTagOverride { + i-- + if m.EnableTagOverride { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintService(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0x5a + } + if m.Weights != nil { + { + size, err := m.Weights.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if len(m.Checks) > 0 { + for iNdEx := len(m.Checks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Checks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + { + size, err := m.Check.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + if m.Port != 0 { + i = encodeVarintService(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x38 + } + if len(m.Meta) > 0 { + for k := range m.Meta { + v := m.Meta[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintService(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintService(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x2a + } + if len(m.Tags) > 0 { + for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Tags[iNdEx]) + copy(dAtA[i:], m.Tags[iNdEx]) + i = encodeVarintService(dAtA, i, uint64(len(m.Tags[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintService(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintService(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0x12 + } + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintService(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ServiceAddress) 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 *ServiceAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Port != 0 { + i = encodeVarintService(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x10 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintService(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Weights) 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 *Weights) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Weights) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Warning != 0 { + i = encodeVarintService(dAtA, i, uint64(m.Warning)) + i-- + dAtA[i] = 0x10 + } + if m.Passing != 0 { + i = encodeVarintService(dAtA, i, uint64(m.Passing)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintService(dAtA []byte, offset int, v uint64) int { + offset -= sovService(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ConnectProxyConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DestinationServiceName) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.DestinationServiceID) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.LocalServiceAddress) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + if m.LocalServicePort != 0 { + n += 1 + sovService(uint64(m.LocalServicePort)) + } + if m.Config != nil { + l = m.Config.Size() + n += 1 + l + sovService(uint64(l)) + } + if len(m.Upstreams) > 0 { + for _, e := range m.Upstreams { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } + } + l = m.MeshGateway.Size() + n += 1 + l + sovService(uint64(l)) + l = m.Expose.Size() + n += 1 + l + sovService(uint64(l)) + return n +} + +func (m *Upstream) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DestinationType) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.DestinationNamespace) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.DestinationName) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.Datacenter) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.LocalBindAddress) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + if m.LocalBindPort != 0 { + n += 1 + sovService(uint64(m.LocalBindPort)) + } + if m.Config != nil { + l = m.Config.Size() + n += 1 + l + sovService(uint64(l)) + } + l = m.MeshGateway.Size() + n += 1 + l + sovService(uint64(l)) + return n +} + +func (m *ServiceConnect) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Native { + n += 2 + } + if m.SidecarService != nil { + l = m.SidecarService.Size() + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func (m *ExposeConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Checks { + n += 2 + } + if len(m.Paths) > 0 { + for _, e := range m.Paths { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } + } + return n +} + +func (m *ExposePath) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ListenerPort != 0 { + n += 1 + sovService(uint64(m.ListenerPort)) + } + l = len(m.Path) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + if m.LocalPathPort != 0 { + n += 1 + sovService(uint64(m.LocalPathPort)) + } + l = len(m.Protocol) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + if m.ParsedFromCheck { + n += 2 + } + return n +} + +func (m *MeshGatewayConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Mode) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func (m *ServiceDefinition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Kind) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.ID) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + if len(m.Tags) > 0 { + for _, s := range m.Tags { + l = len(s) + n += 1 + l + sovService(uint64(l)) + } + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + if len(m.Meta) > 0 { + for k, v := range m.Meta { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovService(uint64(len(k))) + 1 + len(v) + sovService(uint64(len(v))) + n += mapEntrySize + 1 + sovService(uint64(mapEntrySize)) + } + } + if m.Port != 0 { + n += 1 + sovService(uint64(m.Port)) + } + l = m.Check.Size() + n += 1 + l + sovService(uint64(l)) + if len(m.Checks) > 0 { + for _, e := range m.Checks { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } + } + if m.Weights != nil { + l = m.Weights.Size() + n += 1 + l + sovService(uint64(l)) + } + l = len(m.Token) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + if m.EnableTagOverride { + n += 2 + } + if m.Proxy != nil { + l = m.Proxy.Size() + n += 1 + l + sovService(uint64(l)) + } + if m.Connect != nil { + l = m.Connect.Size() + n += 1 + l + sovService(uint64(l)) + } + if len(m.TaggedAddresses) > 0 { + for k, v := range m.TaggedAddresses { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovService(uint64(len(k))) + 1 + l + sovService(uint64(l)) + n += mapEntrySize + 2 + sovService(uint64(mapEntrySize)) + } + } + l = m.EnterpriseMeta.Size() + n += 2 + l + sovService(uint64(l)) + return n +} + +func (m *ServiceAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + if m.Port != 0 { + n += 1 + sovService(uint64(m.Port)) + } + return n +} + +func (m *Weights) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Passing != 0 { + n += 1 + sovService(uint64(m.Passing)) + } + if m.Warning != 0 { + n += 1 + sovService(uint64(m.Warning)) + } + return n +} + +func sovService(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozService(x uint64) (n int) { + return sovService(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ConnectProxyConfig) 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 ErrIntOverflowService + } + 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: ConnectProxyConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConnectProxyConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationServiceName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationServiceName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationServiceID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationServiceID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalServiceAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LocalServiceAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalServicePort", wireType) + } + m.LocalServicePort = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LocalServicePort |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + 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 ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Config == nil { + m.Config = &types.Struct{} + } + if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Upstreams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Upstreams = append(m.Upstreams, Upstream{}) + if err := m.Upstreams[len(m.Upstreams)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MeshGateway", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MeshGateway.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expose", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Expose.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Upstream) 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 ErrIntOverflowService + } + 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: Upstream: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Upstream: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationNamespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationNamespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Datacenter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalBindAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LocalBindAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalBindPort", wireType) + } + m.LocalBindPort = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LocalBindPort |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + 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 ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Config == nil { + m.Config = &types.Struct{} + } + if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MeshGateway", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MeshGateway.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ServiceConnect) 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 ErrIntOverflowService + } + 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: ServiceConnect: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceConnect: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Native", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Native = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SidecarService", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SidecarService == nil { + m.SidecarService = &ServiceDefinition{} + } + if err := m.SidecarService.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExposeConfig) 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 ErrIntOverflowService + } + 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: ExposeConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExposeConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Checks", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Checks = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Paths", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Paths = append(m.Paths, ExposePath{}) + if err := m.Paths[len(m.Paths)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExposePath) 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 ErrIntOverflowService + } + 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: ExposePath: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExposePath: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ListenerPort", wireType) + } + m.ListenerPort = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ListenerPort |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalPathPort", wireType) + } + m.LocalPathPort = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LocalPathPort |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Protocol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ParsedFromCheck", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ParsedFromCheck = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MeshGatewayConfig) 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 ErrIntOverflowService + } + 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: MeshGatewayConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MeshGatewayConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Mode = github_com_hashicorp_consul_agent_structs.MeshGatewayMode(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ServiceDefinition) 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 ErrIntOverflowService + } + 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: ServiceDefinition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceDefinition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = github_com_hashicorp_consul_agent_structs.ServiceKind(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tags = append(m.Tags, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Meta == nil { + m.Meta = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthService + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthService + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthService + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthService + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Meta[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + m.Port = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Port |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Check", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Check.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Checks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Checks = append(m.Checks, &CheckType{}) + if err := m.Checks[len(m.Checks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Weights", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Weights == nil { + m.Weights = &Weights{} + } + if err := m.Weights.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableTagOverride", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableTagOverride = bool(v != 0) + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proxy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proxy == nil { + m.Proxy = &ConnectProxyConfig{} + } + if err := m.Proxy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Connect", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Connect == nil { + m.Connect = &ServiceConnect{} + } + if err := m.Connect.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TaggedAddresses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TaggedAddresses == nil { + m.TaggedAddresses = make(map[string]ServiceAddress) + } + var mapkey string + mapvalue := &ServiceAddress{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthService + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthService + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthService + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthService + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &ServiceAddress{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.TaggedAddresses[mapkey] = *mapvalue + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EnterpriseMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.EnterpriseMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ServiceAddress) 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 ErrIntOverflowService + } + 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: ServiceAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + m.Port = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Port |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Weights) 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 ErrIntOverflowService + } + 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: Weights: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Weights: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Passing", wireType) + } + m.Passing = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Passing |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Warning", wireType) + } + m.Warning = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Warning |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipService(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, ErrIntOverflowService + } + 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, ErrIntOverflowService + } + 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, ErrIntOverflowService + } + 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, ErrInvalidLengthService + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthService + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowService + } + 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 := skipService(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthService + } + } + 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 ( + ErrInvalidLengthService = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowService = fmt.Errorf("proto: integer overflow") +) diff --git a/proto/pbservice/service.proto b/proto/pbservice/service.proto new file mode 100644 index 0000000000..92fb7a1ea9 --- /dev/null +++ b/proto/pbservice/service.proto @@ -0,0 +1,256 @@ +syntax = "proto3"; + +package pbservice; + +option go_package = "github.com/hashicorp/consul/proto/pbservice"; + +import "google/protobuf/struct.proto"; +import "proto/pbcommon/common_oss.proto"; +import "proto/pbservice/healthcheck.proto"; + +// This fake import path is replaced by the build script with a versioned path +import "gogoproto/gogo.proto"; + +option (gogoproto.goproto_unkeyed_all) = false; +option (gogoproto.goproto_unrecognized_all) = false; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.goproto_sizecache_all) = false; + + +// ConnectProxyConfig describes the configuration needed for any proxy managed +// or unmanaged. It describes a single logical service's listener and optionally +// upstreams and sidecar-related config for a single instance. To describe a +// centralized proxy that routed traffic for multiple services, a different one +// of these would be needed for each, sharing the same LogicalProxyID. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.ConnectProxyConfig +// output=service.gen.go +// name=Structs +message ConnectProxyConfig { + // DestinationServiceName is required and is the name of the service to accept + // traffic for. + string DestinationServiceName = 1; + + // DestinationServiceID is optional and should only be specified for + // "side-car" style proxies where the proxy is in front of just a single + // instance of the service. It should be set to the service ID of the instance + // being represented which must be registered to the same agent. It's valid to + // provide a service ID that does not yet exist to avoid timing issues when + // bootstrapping a service with a proxy. + string DestinationServiceID = 2; + + // LocalServiceAddress is the address of the local service instance. It is + // optional and should only be specified for "side-car" style proxies. It will + // default to 127.0.0.1 if the proxy is a "side-car" (DestinationServiceID is + // set) but otherwise will be ignored. + string LocalServiceAddress = 3; + + // LocalServicePort is the port of the local service instance. It is optional + // and should only be specified for "side-car" style proxies. It will default + // to the registered port for the instance if the proxy is a "side-car" + // (DestinationServiceID is set) but otherwise will be ignored. + // mog: func-to=int func-from=int32 + int32 LocalServicePort = 4; + + // Config is the arbitrary configuration data provided with the proxy + // registration. + // mog: func-to=MapStringInterfaceToStructs func-from=NewMapStringInterfaceFromStructs + google.protobuf.Struct Config = 5 [(gogoproto.nullable) = true]; + + // Upstreams describes any upstream dependencies the proxy instance should + // setup. + // mog: func-to=UpstreamsToStructs func-from=NewUpstreamsFromStructs + repeated Upstream Upstreams = 6 [(gogoproto.nullable) = false]; + + // MeshGateway defines the mesh gateway configuration for this upstream + MeshGatewayConfig MeshGateway = 7 [(gogoproto.nullable) = false]; + + // Expose defines whether checks or paths are exposed through the proxy + ExposeConfig Expose = 8 [(gogoproto.nullable) = false]; +} + +// Upstream represents a single upstream dependency for a service or proxy. It +// describes the mechanism used to discover instances to communicate with (the +// Target) as well as any potential client configuration that may be useful such +// as load balancer options, timeouts etc. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.Upstream +// output=service.gen.go +// name=Structs +// ignore-fields=IngressHosts +message Upstream { + // Destination fields are the required ones for determining what this upstream + // points to. Depending on DestinationType some other fields below might + // further restrict the set of instances allowable. + // + // DestinationType would be better as an int constant but even with custom + // JSON marshallers it causes havoc with all the mapstructure mangling we do + // on service definitions in various places. + string DestinationType = 1; + string DestinationNamespace = 2; + string DestinationName = 3; + + // Datacenter that the service discovery request should be run against. Note + // for prepared queries, the actual results might be from a different + // datacenter. + string Datacenter = 4; + + // LocalBindAddress is the ip address a side-car proxy should listen on for + // traffic destined for this upstream service. Default if empty is 127.0.0.1. + string LocalBindAddress = 5; + + // LocalBindPort is the ip address a side-car proxy should listen on for + // traffic destined for this upstream service. Required. + // mog: func-to=int func-from=int32 + int32 LocalBindPort = 6; + + // Config is an opaque config that is specific to the proxy process being run. + // It can be used to pass arbitrary configuration for this specific upstream + // to the proxy. + // mog: func-to=MapStringInterfaceToStructs func-from=NewMapStringInterfaceFromStructs + google.protobuf.Struct Config = 7 [(gogoproto.nullable) = true]; + + // MeshGateway is the configuration for mesh gateway usage of this upstream + MeshGatewayConfig MeshGateway = 8 [(gogoproto.nullable) = false]; +} + +// ServiceConnect are the shared Connect settings between all service +// definitions from the agent to the state store. +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.ServiceConnect +// output=service.gen.go +// name=Structs +message ServiceConnect { + // Native is true when this service can natively understand Connect. + bool Native = 1; + + // SidecarService is a nested Service Definition to register at the same time. + // It's purely a convenience mechanism to allow specifying a sidecar service + // along with the application service definition. It's nested nature allows + // all of the fields to be defaulted which can reduce the amount of + // boilerplate needed to register a sidecar service separately, but the end + // result is identical to just making a second service registration via any + // other means. + // mog: func-to=ServiceDefinitionPtrToStructs func-from=NewServiceDefinitionPtrFromStructs + ServiceDefinition SidecarService = 3; +} + +// ExposeConfig describes HTTP paths to expose through Envoy outside of Connect. +// Users can expose individual paths and/or all HTTP/GRPC paths for checks. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.ExposeConfig +// output=service.gen.go +// name=Structs +message ExposeConfig { + // Checks defines whether paths associated with Consul checks will be exposed. + // This flag triggers exposing all HTTP and GRPC check paths registered for the service. + bool Checks = 1; + + // Paths is the list of paths exposed through the proxy. + // mog: func-to=ExposePathSliceToStructs func-from=NewExposePathSliceFromStructs + repeated ExposePath Paths = 2 [(gogoproto.nullable) = false]; +} + +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.ExposePath +// output=service.gen.go +// name=Structs +message ExposePath { + // ListenerPort defines the port of the proxy's listener for exposed paths. + // mog: func-to=int func-from=int32 + int32 ListenerPort = 1; + + // ExposePath is the path to expose through the proxy, ie. "/metrics." + string Path = 2; + + // LocalPathPort is the port that the service is listening on for the given path. + // mog: func-to=int func-from=int32 + int32 LocalPathPort = 3; + + // Protocol describes the upstream's service protocol. + // Valid values are "http" and "http2", defaults to "http" + string Protocol = 4; + + // ParsedFromCheck is set if this path was parsed from a registered check + bool ParsedFromCheck = 5; +} + +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.MeshGatewayConfig +// output=service.gen.go +// name=Structs +message MeshGatewayConfig { + string Mode = 1 [(gogoproto.casttype) = "github.com/hashicorp/consul/agent/structs.MeshGatewayMode"]; +} + +// ServiceDefinition is used to JSON decode the Service definitions. For +// documentation on specific fields see NodeService which is better documented. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.ServiceDefinition +// output=service.gen.go +// name=Structs +message ServiceDefinition { + string Kind = 1 [(gogoproto.casttype) = "github.com/hashicorp/consul/agent/structs.ServiceKind"]; + string ID = 2; + string Name = 3; + repeated string Tags = 4; + string Address = 5; + // mog: func-to=MapStringServiceAddressToStructs func-from=NewMapStringServiceAddressFromStructs + map TaggedAddresses = 16 [(gogoproto.nullable) = false]; + map Meta = 6; + // mog: func-to=int func-from=int32 + int32 Port = 7; + CheckType Check = 8 [(gogoproto.nullable) = false]; + // mog: func-to=CheckTypesToStructs func-from=NewCheckTypesFromStructs + repeated CheckType Checks = 9; + // mog: func-to=WeightsPtrToStructs func-from=NewWeightsPtrFromStructs + Weights Weights = 10; + string Token = 11; + bool EnableTagOverride = 12; + + // Proxy is the configuration set for Kind = connect-proxy. It is mandatory in + // that case and an error to be set for any other kind. This config is part of + // a proxy service definition and is distinct from but shares some fields with + // the Connect.Proxy which configures a managed proxy as part of the actual + // service's definition. This duplication is ugly but seemed better than the + // alternative which was to re-use the same struct fields for both cases even + // though the semantics are different and the non-shared fields make no sense + // in the other case. ProxyConfig may be a more natural name here, but it's + // confusing for the UX because one of the fields in ConnectProxyConfig is + // also called just "Config" + // mog: func-to=ConnectProxyConfigPtrToStructs func-from=NewConnectProxyConfigPtrFromStructs + ConnectProxyConfig Proxy = 14; + + // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs + common.EnterpriseMeta EnterpriseMeta = 17 [(gogoproto.nullable) = false]; + + // mog: func-to=ServiceConnectPtrToStructs func-from=NewServiceConnectPtrFromStructs + ServiceConnect Connect = 15; +} + +// Type to hold an address and port of a service +message ServiceAddress { + string Address = 1; + // mog: func-to=int func-from=int32 + int32 Port = 2; +} + + +// Weights represent the weight used by DNS for a given status +message Weights { + // mog: func-to=int func-from=int32 + int32 Passing = 1; + // mog: func-to=int func-from=int32 + int32 Warning = 2; +} \ No newline at end of file diff --git a/proto/pbservice/structs.pb.go b/proto/pbservice/structs.pb.go deleted file mode 100644 index c04057cb12..0000000000 --- a/proto/pbservice/structs.pb.go +++ /dev/null @@ -1,8942 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: proto/pbservice/structs.proto - -package pbservice - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - types "github.com/gogo/protobuf/types" - proto "github.com/golang/protobuf/proto" - github_com_hashicorp_consul_agent_structs "github.com/hashicorp/consul/agent/structs" - pbcommon "github.com/hashicorp/consul/proto/pbcommon" - github_com_hashicorp_consul_types "github.com/hashicorp/consul/types" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -// Used to return information about a node -type Node struct { - ID github_com_hashicorp_consul_types.NodeID `protobuf:"bytes,1,opt,name=ID,proto3,casttype=github.com/hashicorp/consul/types.NodeID" json:"ID,omitempty"` - Node string `protobuf:"bytes,2,opt,name=Node,proto3" json:"Node,omitempty"` - Address string `protobuf:"bytes,3,opt,name=Address,proto3" json:"Address,omitempty"` - Datacenter string `protobuf:"bytes,4,opt,name=Datacenter,proto3" json:"Datacenter,omitempty"` - TaggedAddresses map[string]string `protobuf:"bytes,5,rep,name=TaggedAddresses,proto3" json:"TaggedAddresses,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Meta map[string]string `protobuf:"bytes,6,rep,name=Meta,proto3" json:"Meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - pbcommon.RaftIndex `protobuf:"bytes,7,opt,name=RaftIndex,proto3,embedded=RaftIndex" json:"RaftIndex" bexpr:"-"` -} - -func (m *Node) Reset() { *m = Node{} } -func (m *Node) String() string { return proto.CompactTextString(m) } -func (*Node) ProtoMessage() {} -func (*Node) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{0} -} -func (m *Node) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Node.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Node) XXX_Merge(src proto.Message) { - xxx_messageInfo_Node.Merge(m, src) -} -func (m *Node) XXX_Size() int { - return m.Size() -} -func (m *Node) XXX_DiscardUnknown() { - xxx_messageInfo_Node.DiscardUnknown(m) -} - -var xxx_messageInfo_Node proto.InternalMessageInfo - -// ServiceDefinition is used to JSON decode the Service definitions. For -// documentation on specific fields see NodeService which is better documented. -type ServiceDefinition struct { - Kind github_com_hashicorp_consul_agent_structs.ServiceKind `protobuf:"bytes,1,opt,name=Kind,proto3,casttype=github.com/hashicorp/consul/agent/structs.ServiceKind" json:"Kind,omitempty"` - ID string `protobuf:"bytes,2,opt,name=ID,proto3" json:"ID,omitempty"` - Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"` - Tags []string `protobuf:"bytes,4,rep,name=Tags,proto3" json:"Tags,omitempty"` - Address string `protobuf:"bytes,5,opt,name=Address,proto3" json:"Address,omitempty"` - TaggedAddresses map[string]*ServiceAddress `protobuf:"bytes,16,rep,name=TaggedAddresses,proto3" json:"TaggedAddresses,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Meta map[string]string `protobuf:"bytes,6,rep,name=Meta,proto3" json:"Meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Port int `protobuf:"varint,7,opt,name=Port,proto3,casttype=int" json:"Port,omitempty"` - Check CheckType `protobuf:"bytes,8,opt,name=Check,proto3" json:"Check"` - Checks []*CheckType `protobuf:"bytes,9,rep,name=Checks,proto3" json:"Checks,omitempty"` - Weights *Weights `protobuf:"bytes,10,opt,name=Weights,proto3" json:"Weights,omitempty"` - Token string `protobuf:"bytes,11,opt,name=Token,proto3" json:"Token,omitempty"` - EnableTagOverride bool `protobuf:"varint,12,opt,name=EnableTagOverride,proto3" json:"EnableTagOverride,omitempty"` - // Proxy is the configuration set for Kind = connect-proxy. It is mandatory in - // that case and an error to be set for any other kind. This config is part of - // a proxy service definition and is distinct from but shares some fields with - // the Connect.Proxy which configures a managed proxy as part of the actual - // service's definition. This duplication is ugly but seemed better than the - // alternative which was to re-use the same struct fields for both cases even - // though the semantics are different and the non-shared fields make no sense - // in the other case. ProxyConfig may be a more natural name here, but it's - // confusing for the UX because one of the fields in ConnectProxyConfig is - // also called just "Config" - Proxy *ConnectProxyConfig `protobuf:"bytes,14,opt,name=Proxy,proto3" json:"Proxy,omitempty"` - EnterpriseMeta *pbcommon.EnterpriseMeta `protobuf:"bytes,17,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta,omitempty"` - Connect *ServiceConnect `protobuf:"bytes,15,opt,name=Connect,proto3" json:"Connect,omitempty"` -} - -func (m *ServiceDefinition) Reset() { *m = ServiceDefinition{} } -func (m *ServiceDefinition) String() string { return proto.CompactTextString(m) } -func (*ServiceDefinition) ProtoMessage() {} -func (*ServiceDefinition) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{1} -} -func (m *ServiceDefinition) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ServiceDefinition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ServiceDefinition.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ServiceDefinition) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceDefinition.Merge(m, src) -} -func (m *ServiceDefinition) XXX_Size() int { - return m.Size() -} -func (m *ServiceDefinition) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceDefinition.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceDefinition proto.InternalMessageInfo - -// Type to hold an address and port of a service -type ServiceAddress struct { - Address string `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"` - Port int `protobuf:"varint,2,opt,name=Port,proto3,casttype=int" json:"Port,omitempty"` -} - -func (m *ServiceAddress) Reset() { *m = ServiceAddress{} } -func (m *ServiceAddress) String() string { return proto.CompactTextString(m) } -func (*ServiceAddress) ProtoMessage() {} -func (*ServiceAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{2} -} -func (m *ServiceAddress) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ServiceAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ServiceAddress.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ServiceAddress) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceAddress.Merge(m, src) -} -func (m *ServiceAddress) XXX_Size() int { - return m.Size() -} -func (m *ServiceAddress) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceAddress.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceAddress proto.InternalMessageInfo - -// HealthCheck represents a single check on a given node -type HealthCheck struct { - Node string `protobuf:"bytes,1,opt,name=Node,proto3" json:"Node,omitempty"` - CheckID github_com_hashicorp_consul_types.CheckID `protobuf:"bytes,2,opt,name=CheckID,proto3,casttype=github.com/hashicorp/consul/types.CheckID" json:"CheckID,omitempty"` - Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"` - Status string `protobuf:"bytes,4,opt,name=Status,proto3" json:"Status,omitempty"` - Notes string `protobuf:"bytes,5,opt,name=Notes,proto3" json:"Notes,omitempty"` - Output string `protobuf:"bytes,6,opt,name=Output,proto3" json:"Output,omitempty"` - ServiceID string `protobuf:"bytes,7,opt,name=ServiceID,proto3" json:"ServiceID,omitempty"` - ServiceName string `protobuf:"bytes,8,opt,name=ServiceName,proto3" json:"ServiceName,omitempty"` - ServiceTags []string `protobuf:"bytes,9,rep,name=ServiceTags,proto3" json:"ServiceTags,omitempty"` - Type string `protobuf:"bytes,12,opt,name=Type,proto3" json:"Type,omitempty"` - Definition HealthCheckDefinition `protobuf:"bytes,10,opt,name=Definition,proto3" json:"Definition" bexpr:"-"` - EnterpriseMeta *pbcommon.EnterpriseMeta `protobuf:"bytes,13,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta,omitempty"` - pbcommon.RaftIndex `protobuf:"bytes,11,opt,name=RaftIndex,proto3,embedded=RaftIndex" json:"RaftIndex" bexpr:"-"` -} - -func (m *HealthCheck) Reset() { *m = HealthCheck{} } -func (m *HealthCheck) String() string { return proto.CompactTextString(m) } -func (*HealthCheck) ProtoMessage() {} -func (*HealthCheck) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{3} -} -func (m *HealthCheck) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HealthCheck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HealthCheck.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HealthCheck) XXX_Merge(src proto.Message) { - xxx_messageInfo_HealthCheck.Merge(m, src) -} -func (m *HealthCheck) XXX_Size() int { - return m.Size() -} -func (m *HealthCheck) XXX_DiscardUnknown() { - xxx_messageInfo_HealthCheck.DiscardUnknown(m) -} - -var xxx_messageInfo_HealthCheck proto.InternalMessageInfo - -type HeaderValue struct { - Value []string `protobuf:"bytes,1,rep,name=Value,proto3" json:"Value,omitempty"` -} - -func (m *HeaderValue) Reset() { *m = HeaderValue{} } -func (m *HeaderValue) String() string { return proto.CompactTextString(m) } -func (*HeaderValue) ProtoMessage() {} -func (*HeaderValue) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{4} -} -func (m *HeaderValue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HeaderValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HeaderValue.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HeaderValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_HeaderValue.Merge(m, src) -} -func (m *HeaderValue) XXX_Size() int { - return m.Size() -} -func (m *HeaderValue) XXX_DiscardUnknown() { - xxx_messageInfo_HeaderValue.DiscardUnknown(m) -} - -var xxx_messageInfo_HeaderValue proto.InternalMessageInfo - -type HealthCheckDefinition struct { - HTTP string `protobuf:"bytes,1,opt,name=HTTP,proto3" json:",omitempty"` - TLSSkipVerify bool `protobuf:"varint,2,opt,name=TLSSkipVerify,proto3" json:",omitempty"` - Header map[string]HeaderValue `protobuf:"bytes,3,rep,name=Header,proto3" json:"Header" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Method string `protobuf:"bytes,4,opt,name=Method,proto3" json:",omitempty"` - Body string `protobuf:"bytes,18,opt,name=Body,proto3" json:",omitempty"` - TCP string `protobuf:"bytes,5,opt,name=TCP,proto3" json:",omitempty"` - Interval time.Duration `protobuf:"bytes,6,opt,name=Interval,proto3,stdduration" json:"Interval"` - OutputMaxSize uint32 `protobuf:"varint,9,opt,name=OutputMaxSize,proto3" json:"OutputMaxSize,omitempty"` - Timeout time.Duration `protobuf:"bytes,7,opt,name=Timeout,proto3,stdduration" json:"Timeout"` - DeregisterCriticalServiceAfter time.Duration `protobuf:"bytes,8,opt,name=DeregisterCriticalServiceAfter,proto3,stdduration" json:"DeregisterCriticalServiceAfter"` - ScriptArgs []string `protobuf:"bytes,10,rep,name=ScriptArgs,proto3" json:"ScriptArgs,omitempty"` - DockerContainerID string `protobuf:"bytes,11,opt,name=DockerContainerID,proto3" json:"DockerContainerID,omitempty"` - Shell string `protobuf:"bytes,12,opt,name=Shell,proto3" json:"Shell,omitempty"` - GRPC string `protobuf:"bytes,13,opt,name=GRPC,proto3" json:"GRPC,omitempty"` - GRPCUseTLS bool `protobuf:"varint,14,opt,name=GRPCUseTLS,proto3" json:"GRPCUseTLS,omitempty"` - AliasNode string `protobuf:"bytes,15,opt,name=AliasNode,proto3" json:"AliasNode,omitempty"` - AliasService string `protobuf:"bytes,16,opt,name=AliasService,proto3" json:"AliasService,omitempty"` - TTL time.Duration `protobuf:"bytes,17,opt,name=TTL,proto3,stdduration" json:"TTL"` -} - -func (m *HealthCheckDefinition) Reset() { *m = HealthCheckDefinition{} } -func (m *HealthCheckDefinition) String() string { return proto.CompactTextString(m) } -func (*HealthCheckDefinition) ProtoMessage() {} -func (*HealthCheckDefinition) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{5} -} -func (m *HealthCheckDefinition) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HealthCheckDefinition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HealthCheckDefinition.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HealthCheckDefinition) XXX_Merge(src proto.Message) { - xxx_messageInfo_HealthCheckDefinition.Merge(m, src) -} -func (m *HealthCheckDefinition) XXX_Size() int { - return m.Size() -} -func (m *HealthCheckDefinition) XXX_DiscardUnknown() { - xxx_messageInfo_HealthCheckDefinition.DiscardUnknown(m) -} - -var xxx_messageInfo_HealthCheckDefinition proto.InternalMessageInfo - -// CheckServiceNode is used to provide the node, its service -// definition, as well as a HealthCheck that is associated. -type CheckServiceNode struct { - Node *Node `protobuf:"bytes,1,opt,name=Node,proto3" json:"Node,omitempty"` - Service *NodeService `protobuf:"bytes,2,opt,name=Service,proto3" json:"Service,omitempty"` - Checks []*HealthCheck `protobuf:"bytes,3,rep,name=Checks,proto3" json:"Checks,omitempty"` -} - -func (m *CheckServiceNode) Reset() { *m = CheckServiceNode{} } -func (m *CheckServiceNode) String() string { return proto.CompactTextString(m) } -func (*CheckServiceNode) ProtoMessage() {} -func (*CheckServiceNode) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{6} -} -func (m *CheckServiceNode) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CheckServiceNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CheckServiceNode.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CheckServiceNode) XXX_Merge(src proto.Message) { - xxx_messageInfo_CheckServiceNode.Merge(m, src) -} -func (m *CheckServiceNode) XXX_Size() int { - return m.Size() -} -func (m *CheckServiceNode) XXX_DiscardUnknown() { - xxx_messageInfo_CheckServiceNode.DiscardUnknown(m) -} - -var xxx_messageInfo_CheckServiceNode proto.InternalMessageInfo - -// NodeService is a service provided by a node -type NodeService struct { - // Kind is the kind of service this is. Different kinds of services may - // have differing validation, DNS behavior, etc. An empty kind will default - // to the Default kind. See ServiceKind for the full list of kinds. - Kind github_com_hashicorp_consul_agent_structs.ServiceKind `protobuf:"bytes,1,opt,name=Kind,proto3,casttype=github.com/hashicorp/consul/agent/structs.ServiceKind" json:",omitempty"` - ID string `protobuf:"bytes,2,opt,name=ID,proto3" json:"ID,omitempty"` - Service string `protobuf:"bytes,3,opt,name=Service,proto3" json:"Service,omitempty"` - Tags []string `protobuf:"bytes,4,rep,name=Tags,proto3" json:"Tags,omitempty"` - Address string `protobuf:"bytes,5,opt,name=Address,proto3" json:"Address,omitempty"` - TaggedAddresses map[string]*ServiceAddress `protobuf:"bytes,15,rep,name=TaggedAddresses,proto3" json:"TaggedAddresses,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Meta map[string]string `protobuf:"bytes,6,rep,name=Meta,proto3" json:"Meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Port int `protobuf:"varint,7,opt,name=Port,proto3,casttype=int" json:"Port,omitempty"` - Weights *Weights `protobuf:"bytes,8,opt,name=Weights,proto3" json:"Weights,omitempty"` - EnableTagOverride bool `protobuf:"varint,9,opt,name=EnableTagOverride,proto3" json:"EnableTagOverride,omitempty"` - // Proxy is the configuration set for Kind = connect-proxy. It is mandatory in - // that case and an error to be set for any other kind. This config is part of - // a proxy service definition and is distinct from but shares some fields with - // the Connect.Proxy which configures a managed proxy as part of the actual - // service's definition. This duplication is ugly but seemed better than the - // alternative which was to re-use the same struct fields for both cases even - // though the semantics are different and the non-shred fields make no sense - // in the other case. ProxyConfig may be a more natural name here, but it's - // confusing for the UX because one of the fields in ConnectProxyConfig is - // also called just "Config" - Proxy ConnectProxyConfig `protobuf:"bytes,11,opt,name=Proxy,proto3" json:"Proxy"` - // Connect are the Connect settings for a service. This is purposely NOT - // a pointer so that we never have to nil-check this. - Connect ServiceConnect `protobuf:"bytes,12,opt,name=Connect,proto3" json:"Connect"` - // LocallyRegisteredAsSidecar is private as it is only used by a local agent - // state to track if the service was registered from a nested sidecar_service - // block. We need to track that so we can know whether we need to deregister - // it automatically too if it's removed from the service definition or if the - // parent service is deregistered. Relying only on ID would cause us to - // deregister regular services if they happen to be registered using the same - // ID scheme as our sidecars do by default. We could use meta but that gets - // unpleasant because we can't use the consul- prefix from an agent (reserved - // for use internally but in practice that means within the state store or in - // responses only), and it leaks the detail publicly which people might rely - // on which is a bit unpleasant for something that is meant to be config-file - // syntax sugar. Note this is not translated to ServiceNode and friends and - // may not be set on a NodeService that isn't the one the agent registered and - // keeps in it's local state. We never want this rendered in JSON as it's - // internal only. Right now our agent endpoints return api structs which don't - // include it but this is a safety net incase we change that or there is - // somewhere this is used in API output. - LocallyRegisteredAsSidecar bool `protobuf:"varint,13,opt,name=LocallyRegisteredAsSidecar,proto3" json:"LocallyRegisteredAsSidecar,omitempty" bexpr:"-"` - EnterpriseMeta *pbcommon.EnterpriseMeta `protobuf:"bytes,16,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta,omitempty"` - pbcommon.RaftIndex `protobuf:"bytes,14,opt,name=RaftIndex,proto3,embedded=RaftIndex" json:"RaftIndex" bexpr:"-"` -} - -func (m *NodeService) Reset() { *m = NodeService{} } -func (m *NodeService) String() string { return proto.CompactTextString(m) } -func (*NodeService) ProtoMessage() {} -func (*NodeService) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{7} -} -func (m *NodeService) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodeService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodeService.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodeService) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeService.Merge(m, src) -} -func (m *NodeService) XXX_Size() int { - return m.Size() -} -func (m *NodeService) XXX_DiscardUnknown() { - xxx_messageInfo_NodeService.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeService proto.InternalMessageInfo - -// ConnectProxyConfig describes the configuration needed for any proxy managed -// or unmanaged. It describes a single logical service's listener and optionally -// upstreams and sidecar-related config for a single instance. To describe a -// centralized proxy that routed traffic for multiple services, a different one -// of these would be needed for each, sharing the same LogicalProxyID. -type ConnectProxyConfig struct { - // DestinationServiceName is required and is the name of the service to accept - // traffic for. - DestinationServiceName string `protobuf:"bytes,1,opt,name=DestinationServiceName,proto3" json:"DestinationServiceName,omitempty"` - // DestinationServiceID is optional and should only be specified for - // "side-car" style proxies where the proxy is in front of just a single - // instance of the service. It should be set to the service ID of the instance - // being represented which must be registered to the same agent. It's valid to - // provide a service ID that does not yet exist to avoid timing issues when - // bootstrapping a service with a proxy. - DestinationServiceID string `protobuf:"bytes,2,opt,name=DestinationServiceID,proto3" json:"DestinationServiceID,omitempty"` - // LocalServiceAddress is the address of the local service instance. It is - // optional and should only be specified for "side-car" style proxies. It will - // default to 127.0.0.1 if the proxy is a "side-car" (DestinationServiceID is - // set) but otherwise will be ignored. - LocalServiceAddress string `protobuf:"bytes,3,opt,name=LocalServiceAddress,proto3" json:"LocalServiceAddress,omitempty"` - // LocalServicePort is the port of the local service instance. It is optional - // and should only be specified for "side-car" style proxies. It will default - // to the registered port for the instance if the proxy is a "side-car" - // (DestinationServiceID is set) but otherwise will be ignored. - LocalServicePort int `protobuf:"varint,4,opt,name=LocalServicePort,proto3,casttype=int" json:"LocalServicePort,omitempty"` - // Config is the arbitrary configuration data provided with the proxy - // registration. - Config *types.Struct `protobuf:"bytes,5,opt,name=Config,proto3" json:"Config,omitempty" bexpr:"-"` - // Upstreams describes any upstream dependencies the proxy instance should - // setup. - Upstreams []Upstream `protobuf:"bytes,6,rep,name=Upstreams,proto3" json:"Upstreams"` - // MeshGateway defines the mesh gateway configuration for this upstream - MeshGateway *MeshGatewayConfig `protobuf:"bytes,7,opt,name=MeshGateway,proto3" json:"MeshGateway,omitempty"` - // Expose defines whether checks or paths are exposed through the proxy - Expose *ExposeConfig `protobuf:"bytes,8,opt,name=Expose,proto3" json:"Expose,omitempty"` -} - -func (m *ConnectProxyConfig) Reset() { *m = ConnectProxyConfig{} } -func (m *ConnectProxyConfig) String() string { return proto.CompactTextString(m) } -func (*ConnectProxyConfig) ProtoMessage() {} -func (*ConnectProxyConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{8} -} -func (m *ConnectProxyConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConnectProxyConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConnectProxyConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ConnectProxyConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConnectProxyConfig.Merge(m, src) -} -func (m *ConnectProxyConfig) XXX_Size() int { - return m.Size() -} -func (m *ConnectProxyConfig) XXX_DiscardUnknown() { - xxx_messageInfo_ConnectProxyConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_ConnectProxyConfig proto.InternalMessageInfo - -// Upstream represents a single upstream dependency for a service or proxy. It -// describes the mechanism used to discover instances to communicate with (the -// Target) as well as any potential client configuration that may be useful such -// as load balancer options, timeouts etc. -type Upstream struct { - // Destination fields are the required ones for determining what this upstream - // points to. Depending on DestinationType some other fields below might - // further restrict the set of instances allowable. - // - // DestinationType would be better as an int constant but even with custom - // JSON marshallers it causes havoc with all the mapstructure mangling we do - // on service definitions in various places. - DestinationType string `protobuf:"bytes,1,opt,name=DestinationType,proto3" json:"DestinationType,omitempty"` - DestinationNamespace string `protobuf:"bytes,2,opt,name=DestinationNamespace,proto3" json:"DestinationNamespace,omitempty"` - DestinationName string `protobuf:"bytes,3,opt,name=DestinationName,proto3" json:"DestinationName,omitempty"` - // Datacenter that the service discovery request should be run against. Note - // for prepared queries, the actual results might be from a different - // datacenter. - Datacenter string `protobuf:"bytes,4,opt,name=Datacenter,proto3" json:"Datacenter,omitempty"` - // LocalBindAddress is the ip address a side-car proxy should listen on for - // traffic destined for this upstream service. Default if empty is 127.0.0.1. - LocalBindAddress string `protobuf:"bytes,5,opt,name=LocalBindAddress,proto3" json:"LocalBindAddress,omitempty"` - // LocalBindPort is the ip address a side-car proxy should listen on for - // traffic - // destined for this upstream service. Required. - LocalBindPort int `protobuf:"varint,6,opt,name=LocalBindPort,proto3,casttype=int" json:"LocalBindPort,omitempty"` - // Config is an opaque config that is specific to the proxy process being run. - // It can be used to pass arbitrary configuration for this specific upstream - // to the proxy. - Config *types.Struct `protobuf:"bytes,7,opt,name=Config,proto3" json:"Config,omitempty" bexpr:"-"` - // MeshGateway is the configuration for mesh gateway usage of this upstream - MeshGateway *MeshGatewayConfig `protobuf:"bytes,8,opt,name=MeshGateway,proto3" json:"MeshGateway,omitempty"` -} - -func (m *Upstream) Reset() { *m = Upstream{} } -func (m *Upstream) String() string { return proto.CompactTextString(m) } -func (*Upstream) ProtoMessage() {} -func (*Upstream) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{9} -} -func (m *Upstream) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Upstream) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Upstream.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Upstream) XXX_Merge(src proto.Message) { - xxx_messageInfo_Upstream.Merge(m, src) -} -func (m *Upstream) XXX_Size() int { - return m.Size() -} -func (m *Upstream) XXX_DiscardUnknown() { - xxx_messageInfo_Upstream.DiscardUnknown(m) -} - -var xxx_messageInfo_Upstream proto.InternalMessageInfo - -// ServiceConnect are the shared Connect settings between all service -// definitions from the agent to the state store. -type ServiceConnect struct { - // Native is true when this service can natively understand Connect. - Native bool `protobuf:"varint,1,opt,name=Native,proto3" json:"Native,omitempty"` - // SidecarService is a nested Service Definition to register at the same time. - // It's purely a convenience mechanism to allow specifying a sidecar service - // along with the application service definition. It's nested nature allows - // all of the fields to be defaulted which can reduce the amount of - // boilerplate needed to register a sidecar service separately, but the end - // result is identical to just making a second service registration via any - // other means. - SidecarService *ServiceDefinition `protobuf:"bytes,3,opt,name=SidecarService,proto3" json:"SidecarService,omitempty" bexpr:"-"` -} - -func (m *ServiceConnect) Reset() { *m = ServiceConnect{} } -func (m *ServiceConnect) String() string { return proto.CompactTextString(m) } -func (*ServiceConnect) ProtoMessage() {} -func (*ServiceConnect) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{10} -} -func (m *ServiceConnect) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ServiceConnect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ServiceConnect.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ServiceConnect) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceConnect.Merge(m, src) -} -func (m *ServiceConnect) XXX_Size() int { - return m.Size() -} -func (m *ServiceConnect) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceConnect.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceConnect proto.InternalMessageInfo - -// Weights represent the weight used by DNS for a given status -type Weights struct { - Passing int `protobuf:"varint,1,opt,name=Passing,proto3,casttype=int" json:"Passing,omitempty"` - Warning int `protobuf:"varint,2,opt,name=Warning,proto3,casttype=int" json:"Warning,omitempty"` -} - -func (m *Weights) Reset() { *m = Weights{} } -func (m *Weights) String() string { return proto.CompactTextString(m) } -func (*Weights) ProtoMessage() {} -func (*Weights) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{11} -} -func (m *Weights) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Weights) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Weights.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Weights) XXX_Merge(src proto.Message) { - xxx_messageInfo_Weights.Merge(m, src) -} -func (m *Weights) XXX_Size() int { - return m.Size() -} -func (m *Weights) XXX_DiscardUnknown() { - xxx_messageInfo_Weights.DiscardUnknown(m) -} - -var xxx_messageInfo_Weights proto.InternalMessageInfo - -// ExposeConfig describes HTTP paths to expose through Envoy outside of Connect. -// Users can expose individual paths and/or all HTTP/GRPC paths for checks. -type ExposeConfig struct { - // Checks defines whether paths associated with Consul checks will be exposed. - // This flag triggers exposing all HTTP and GRPC check paths registered for the service. - Checks bool `protobuf:"varint,1,opt,name=Checks,proto3" json:"Checks,omitempty"` - // Paths is the list of paths exposed through the proxy. - Paths []*ExposePath `protobuf:"bytes,2,rep,name=Paths,proto3" json:"Paths,omitempty"` -} - -func (m *ExposeConfig) Reset() { *m = ExposeConfig{} } -func (m *ExposeConfig) String() string { return proto.CompactTextString(m) } -func (*ExposeConfig) ProtoMessage() {} -func (*ExposeConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{12} -} -func (m *ExposeConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ExposeConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ExposeConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ExposeConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExposeConfig.Merge(m, src) -} -func (m *ExposeConfig) XXX_Size() int { - return m.Size() -} -func (m *ExposeConfig) XXX_DiscardUnknown() { - xxx_messageInfo_ExposeConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_ExposeConfig proto.InternalMessageInfo - -type ExposePath struct { - // ListenerPort defines the port of the proxy's listener for exposed paths. - ListenerPort int32 `protobuf:"varint,1,opt,name=ListenerPort,proto3" json:"ListenerPort,omitempty"` - // ExposePath is the path to expose through the proxy, ie. "/metrics." - Path string `protobuf:"bytes,2,opt,name=Path,proto3" json:"Path,omitempty"` - // LocalPathPort is the port that the service is listening on for the given path. - LocalPathPort int32 `protobuf:"varint,3,opt,name=LocalPathPort,proto3" json:"LocalPathPort,omitempty"` - // Protocol describes the upstream's service protocol. - // Valid values are "http" and "http2", defaults to "http" - Protocol string `protobuf:"bytes,4,opt,name=Protocol,proto3" json:"Protocol,omitempty"` - // ParsedFromCheck is set if this path was parsed from a registered check - ParsedFromCheck bool `protobuf:"varint,5,opt,name=ParsedFromCheck,proto3" json:"ParsedFromCheck,omitempty"` -} - -func (m *ExposePath) Reset() { *m = ExposePath{} } -func (m *ExposePath) String() string { return proto.CompactTextString(m) } -func (*ExposePath) ProtoMessage() {} -func (*ExposePath) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{13} -} -func (m *ExposePath) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ExposePath) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ExposePath.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ExposePath) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExposePath.Merge(m, src) -} -func (m *ExposePath) XXX_Size() int { - return m.Size() -} -func (m *ExposePath) XXX_DiscardUnknown() { - xxx_messageInfo_ExposePath.DiscardUnknown(m) -} - -var xxx_messageInfo_ExposePath proto.InternalMessageInfo - -// CheckType is used to create either the CheckMonitor or the CheckTTL. -// The following types are supported: Script, HTTP, TCP, Docker, TTL, GRPC, -// Alias. Script, -// HTTP, Docker, TCP and GRPC all require Interval. Only one of the types may -// to be provided: TTL or Script/Interval or HTTP/Interval or TCP/Interval or -// Docker/Interval or GRPC/Interval or AliasService. -type CheckType struct { - CheckID github_com_hashicorp_consul_types.CheckID `protobuf:"bytes,1,opt,name=CheckID,proto3,casttype=github.com/hashicorp/consul/types.CheckID" json:""` - Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` - Status string `protobuf:"bytes,3,opt,name=Status,proto3" json:"Status,omitempty"` - Notes string `protobuf:"bytes,4,opt,name=Notes,proto3" json:"Notes,omitempty"` - ScriptArgs []string `protobuf:"bytes,5,rep,name=ScriptArgs,proto3" json:"ScriptArgs,omitempty"` - HTTP string `protobuf:"bytes,6,opt,name=HTTP,proto3" json:"HTTP,omitempty"` - Header map[string]HeaderValue `protobuf:"bytes,20,rep,name=Header,proto3" json:"Header" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Method string `protobuf:"bytes,7,opt,name=Method,proto3" json:"Method,omitempty"` - Body string `protobuf:"bytes,26,opt,name=Body,proto3" json:"Body,omitempty"` - TCP string `protobuf:"bytes,8,opt,name=TCP,proto3" json:"TCP,omitempty"` - Interval time.Duration `protobuf:"bytes,9,opt,name=Interval,proto3,stdduration" json:"Interval"` - AliasNode string `protobuf:"bytes,10,opt,name=AliasNode,proto3" json:"AliasNode,omitempty"` - AliasService string `protobuf:"bytes,11,opt,name=AliasService,proto3" json:"AliasService,omitempty"` - DockerContainerID string `protobuf:"bytes,12,opt,name=DockerContainerID,proto3" json:"DockerContainerID,omitempty"` - Shell string `protobuf:"bytes,13,opt,name=Shell,proto3" json:"Shell,omitempty"` - GRPC string `protobuf:"bytes,14,opt,name=GRPC,proto3" json:"GRPC,omitempty"` - GRPCUseTLS bool `protobuf:"varint,15,opt,name=GRPCUseTLS,proto3" json:"GRPCUseTLS,omitempty"` - TLSSkipVerify bool `protobuf:"varint,16,opt,name=TLSSkipVerify,proto3" json:"TLSSkipVerify,omitempty"` - Timeout time.Duration `protobuf:"bytes,17,opt,name=Timeout,proto3,stdduration" json:"Timeout"` - TTL time.Duration `protobuf:"bytes,18,opt,name=TTL,proto3,stdduration" json:"TTL"` - SuccessBeforePassing int32 `protobuf:"varint,21,opt,name=SuccessBeforePassing,proto3" json:"SuccessBeforePassing,omitempty"` - FailuresBeforeCritical int32 `protobuf:"varint,22,opt,name=FailuresBeforeCritical,proto3" json:"FailuresBeforeCritical,omitempty"` - // Definition fields used when exposing checks through a proxy - ProxyHTTP string `protobuf:"bytes,23,opt,name=ProxyHTTP,proto3" json:"ProxyHTTP,omitempty"` - ProxyGRPC string `protobuf:"bytes,24,opt,name=ProxyGRPC,proto3" json:"ProxyGRPC,omitempty"` - // DeregisterCriticalServiceAfter, if >0, will cause the associated - // service, if any, to be deregistered if this check is critical for - // longer than this duration. - DeregisterCriticalServiceAfter time.Duration `protobuf:"bytes,19,opt,name=DeregisterCriticalServiceAfter,proto3,stdduration" json:"DeregisterCriticalServiceAfter"` - OutputMaxSize int32 `protobuf:"varint,25,opt,name=OutputMaxSize,proto3" json:"OutputMaxSize,omitempty"` -} - -func (m *CheckType) Reset() { *m = CheckType{} } -func (m *CheckType) String() string { return proto.CompactTextString(m) } -func (*CheckType) ProtoMessage() {} -func (*CheckType) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{14} -} -func (m *CheckType) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CheckType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CheckType.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CheckType) XXX_Merge(src proto.Message) { - xxx_messageInfo_CheckType.Merge(m, src) -} -func (m *CheckType) XXX_Size() int { - return m.Size() -} -func (m *CheckType) XXX_DiscardUnknown() { - xxx_messageInfo_CheckType.DiscardUnknown(m) -} - -var xxx_messageInfo_CheckType proto.InternalMessageInfo - -type MeshGatewayConfig struct { - Mode github_com_hashicorp_consul_agent_structs.MeshGatewayMode `protobuf:"bytes,1,opt,name=Mode,proto3,casttype=github.com/hashicorp/consul/agent/structs.MeshGatewayMode" json:"Mode,omitempty"` -} - -func (m *MeshGatewayConfig) Reset() { *m = MeshGatewayConfig{} } -func (m *MeshGatewayConfig) String() string { return proto.CompactTextString(m) } -func (*MeshGatewayConfig) ProtoMessage() {} -func (*MeshGatewayConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_40af50a85866e40b, []int{15} -} -func (m *MeshGatewayConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MeshGatewayConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MeshGatewayConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MeshGatewayConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_MeshGatewayConfig.Merge(m, src) -} -func (m *MeshGatewayConfig) XXX_Size() int { - return m.Size() -} -func (m *MeshGatewayConfig) XXX_DiscardUnknown() { - xxx_messageInfo_MeshGatewayConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_MeshGatewayConfig proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Node)(nil), "pbservice.Node") - proto.RegisterMapType((map[string]string)(nil), "pbservice.Node.MetaEntry") - proto.RegisterMapType((map[string]string)(nil), "pbservice.Node.TaggedAddressesEntry") - proto.RegisterType((*ServiceDefinition)(nil), "pbservice.ServiceDefinition") - proto.RegisterMapType((map[string]string)(nil), "pbservice.ServiceDefinition.MetaEntry") - proto.RegisterMapType((map[string]*ServiceAddress)(nil), "pbservice.ServiceDefinition.TaggedAddressesEntry") - proto.RegisterType((*ServiceAddress)(nil), "pbservice.ServiceAddress") - proto.RegisterType((*HealthCheck)(nil), "pbservice.HealthCheck") - proto.RegisterType((*HeaderValue)(nil), "pbservice.HeaderValue") - proto.RegisterType((*HealthCheckDefinition)(nil), "pbservice.HealthCheckDefinition") - proto.RegisterMapType((map[string]HeaderValue)(nil), "pbservice.HealthCheckDefinition.HeaderEntry") - proto.RegisterType((*CheckServiceNode)(nil), "pbservice.CheckServiceNode") - proto.RegisterType((*NodeService)(nil), "pbservice.NodeService") - proto.RegisterMapType((map[string]string)(nil), "pbservice.NodeService.MetaEntry") - proto.RegisterMapType((map[string]*ServiceAddress)(nil), "pbservice.NodeService.TaggedAddressesEntry") - proto.RegisterType((*ConnectProxyConfig)(nil), "pbservice.ConnectProxyConfig") - proto.RegisterType((*Upstream)(nil), "pbservice.Upstream") - proto.RegisterType((*ServiceConnect)(nil), "pbservice.ServiceConnect") - proto.RegisterType((*Weights)(nil), "pbservice.Weights") - proto.RegisterType((*ExposeConfig)(nil), "pbservice.ExposeConfig") - proto.RegisterType((*ExposePath)(nil), "pbservice.ExposePath") - proto.RegisterType((*CheckType)(nil), "pbservice.CheckType") - proto.RegisterMapType((map[string]HeaderValue)(nil), "pbservice.CheckType.HeaderEntry") - proto.RegisterType((*MeshGatewayConfig)(nil), "pbservice.MeshGatewayConfig") -} - -func init() { proto.RegisterFile("proto/pbservice/structs.proto", fileDescriptor_40af50a85866e40b) } - -var fileDescriptor_40af50a85866e40b = []byte{ - // 2083 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0xcb, 0x6f, 0x1b, 0xc7, - 0x19, 0x17, 0x45, 0x8a, 0x8f, 0x8f, 0xd6, 0x6b, 0x2c, 0xcb, 0x6b, 0xc6, 0x21, 0x59, 0xc6, 0x08, - 0xd4, 0x5a, 0x26, 0x1d, 0x39, 0x69, 0x6a, 0xa3, 0x71, 0x61, 0x8a, 0xb6, 0xa2, 0x46, 0xb2, 0x99, - 0x25, 0x9d, 0x00, 0x0d, 0x8a, 0x62, 0xb5, 0x1c, 0x91, 0x0b, 0x91, 0xbb, 0xc4, 0xee, 0x52, 0x15, - 0x0b, 0xf4, 0x7f, 0x68, 0x4f, 0x4d, 0xaf, 0xbd, 0x17, 0xe8, 0x9f, 0xe1, 0xa3, 0x2f, 0x2d, 0x7a, - 0x62, 0x5b, 0xfb, 0x96, 0x5b, 0x7b, 0xd4, 0xa1, 0x28, 0xe6, 0x9b, 0xd9, 0xe5, 0xec, 0x43, 0xa2, - 0xa4, 0xba, 0x40, 0x2f, 0xe2, 0xce, 0xf7, 0x9a, 0x9d, 0xf9, 0x9e, 0xbf, 0x15, 0xbc, 0x3f, 0xb4, - 0x2d, 0xd7, 0xaa, 0x0d, 0x0f, 0x1c, 0x6a, 0x1f, 0x1b, 0x3a, 0xad, 0x39, 0xae, 0x3d, 0xd2, 0x5d, - 0xa7, 0x8a, 0x74, 0x92, 0xf3, 0x19, 0x85, 0x62, 0xd7, 0xb2, 0xba, 0x7d, 0x5a, 0x43, 0xc6, 0xc1, - 0xe8, 0xb0, 0xd6, 0x19, 0xd9, 0x9a, 0x6b, 0x58, 0x26, 0x17, 0x2d, 0xdc, 0x0e, 0xf3, 0xb9, 0x25, - 0xc1, 0x7d, 0xcf, 0xdb, 0x47, 0xb7, 0x06, 0x03, 0xcb, 0xac, 0xf1, 0x1f, 0xc1, 0x2c, 0xc5, 0x32, - 0x7f, 0x61, 0x39, 0xe2, 0x35, 0x0a, 0x6b, 0x5d, 0xab, 0x6b, 0x71, 0x21, 0xf6, 0xc4, 0xa9, 0x95, - 0xbf, 0x24, 0x21, 0xf5, 0xdc, 0xea, 0x50, 0xf2, 0x63, 0x98, 0xdf, 0x6d, 0x28, 0x89, 0x72, 0x62, - 0x23, 0x57, 0xdf, 0x3c, 0x9d, 0x94, 0x36, 0xba, 0x86, 0xdb, 0x1b, 0x1d, 0x54, 0x75, 0x6b, 0x50, - 0xeb, 0x69, 0x4e, 0xcf, 0xd0, 0x2d, 0x7b, 0x58, 0xd3, 0x2d, 0xd3, 0x19, 0xf5, 0x6b, 0xee, 0x78, - 0x48, 0x9d, 0x2a, 0xd3, 0xdb, 0x6d, 0xa8, 0xf3, 0xbb, 0x0d, 0x42, 0xb8, 0x15, 0x65, 0x9e, 0xe9, - 0xab, 0xdc, 0xa2, 0x02, 0x99, 0x27, 0x9d, 0x8e, 0x4d, 0x1d, 0x47, 0x49, 0x22, 0xd9, 0x5b, 0x92, - 0x22, 0x40, 0x43, 0x73, 0x35, 0x9d, 0x9a, 0x2e, 0xb5, 0x95, 0x14, 0x32, 0x25, 0x0a, 0x79, 0x0e, - 0xcb, 0x6d, 0xad, 0xdb, 0xa5, 0x1d, 0xa1, 0x40, 0x1d, 0x65, 0xa1, 0x9c, 0xdc, 0xc8, 0x6f, 0xdd, - 0xa9, 0xfa, 0x77, 0x89, 0xbb, 0x57, 0x43, 0x62, 0x4f, 0x4d, 0xd7, 0x1e, 0xab, 0x61, 0x65, 0x72, - 0x0f, 0x52, 0xfb, 0xd4, 0xd5, 0x94, 0x34, 0x1a, 0xb9, 0x15, 0x36, 0xc2, 0x78, 0x5c, 0x13, 0xc5, - 0xc8, 0x33, 0xc8, 0xa9, 0xda, 0xa1, 0xbb, 0x6b, 0x76, 0xe8, 0x89, 0x92, 0x29, 0x27, 0x36, 0xf2, - 0x5b, 0xab, 0x55, 0x71, 0xd9, 0x3e, 0xa3, 0x7e, 0xe3, 0xd5, 0xa4, 0x34, 0xf7, 0x7a, 0x52, 0x4a, - 0xfc, 0x6b, 0x52, 0xca, 0x1d, 0xd0, 0x93, 0xa1, 0xfd, 0xa8, 0x72, 0xaf, 0xa2, 0x4e, 0x55, 0x0b, - 0x75, 0x58, 0x8b, 0x7b, 0x3f, 0xb2, 0x02, 0xc9, 0x23, 0x3a, 0xe6, 0x77, 0xad, 0xb2, 0x47, 0xb2, - 0x06, 0x0b, 0xc7, 0x5a, 0x7f, 0xe4, 0xdd, 0x1f, 0x5f, 0x3c, 0x9a, 0xff, 0x51, 0xa2, 0xf0, 0x29, - 0xe4, 0xfc, 0xd7, 0xbb, 0x8c, 0x62, 0xe5, 0xdf, 0x69, 0x58, 0x6d, 0xf1, 0x53, 0x36, 0xe8, 0xa1, - 0x61, 0x1a, 0x2c, 0xcc, 0xc8, 0x3e, 0xa4, 0xbe, 0x30, 0xcc, 0x8e, 0xf0, 0xf3, 0xc3, 0xd3, 0x49, - 0xe9, 0x93, 0xf3, 0xfc, 0xac, 0x75, 0xa9, 0xe9, 0xfa, 0xe1, 0x2c, 0xcc, 0x31, 0x03, 0x2a, 0x9a, - 0x21, 0x4b, 0x18, 0x34, 0x7c, 0x6f, 0x2f, 0x0c, 0xb4, 0x01, 0x15, 0xfe, 0xc6, 0x67, 0x46, 0x6b, - 0x6b, 0x5d, 0x47, 0x49, 0x95, 0x93, 0x8c, 0xc6, 0x9e, 0xe5, 0xd0, 0x58, 0x08, 0x86, 0xc6, 0x37, - 0x51, 0xd7, 0xaf, 0xa0, 0xd7, 0x3e, 0x92, 0xbc, 0x16, 0x39, 0xd7, 0x05, 0xe3, 0xe0, 0x51, 0x20, - 0x0e, 0x3e, 0x3c, 0xd7, 0x62, 0x38, 0x28, 0xde, 0x83, 0x54, 0xd3, 0xb2, 0x5d, 0x8c, 0x87, 0x85, - 0x7a, 0xe6, 0x74, 0x52, 0x4a, 0x1a, 0xa6, 0xab, 0x22, 0x91, 0xdc, 0x87, 0x85, 0xed, 0x1e, 0xd5, - 0x8f, 0x94, 0x2c, 0x46, 0xcb, 0x9a, 0x64, 0x19, 0xe9, 0xed, 0xf1, 0x90, 0xd6, 0x53, 0x2c, 0x60, - 0x54, 0x2e, 0x48, 0x36, 0x21, 0x8d, 0x0f, 0x8e, 0x92, 0xc3, 0x97, 0x89, 0x55, 0x51, 0x85, 0x0c, - 0xd9, 0x84, 0xcc, 0xd7, 0xd4, 0xe8, 0xf6, 0x5c, 0x47, 0x01, 0xdc, 0x81, 0x48, 0xe2, 0x82, 0xa3, - 0x7a, 0x22, 0x2c, 0x28, 0xda, 0xd6, 0x11, 0x35, 0x95, 0x3c, 0x0f, 0x0a, 0x5c, 0x90, 0x4d, 0x58, - 0x7d, 0x6a, 0x6a, 0x07, 0x7d, 0xda, 0xd6, 0xba, 0x2f, 0x8e, 0xa9, 0x6d, 0x1b, 0x1d, 0xaa, 0x5c, - 0x2b, 0x27, 0x36, 0xb2, 0x6a, 0x94, 0x41, 0x1e, 0xc0, 0x42, 0xd3, 0xb6, 0x4e, 0xc6, 0xca, 0x12, - 0xee, 0xf7, 0xbe, 0xfc, 0x7a, 0x96, 0x69, 0x52, 0xdd, 0x45, 0xf6, 0xb6, 0x65, 0x1e, 0x1a, 0x5d, - 0x95, 0xcb, 0x92, 0xc7, 0xb0, 0xf4, 0x94, 0x25, 0xf0, 0xd0, 0x36, 0x1c, 0x8a, 0x37, 0xbd, 0x8a, - 0xda, 0xeb, 0x5e, 0xf6, 0x04, 0xb9, 0x6a, 0x48, 0x9a, 0x3c, 0x80, 0x8c, 0x30, 0xae, 0x2c, 0xa3, - 0xe2, 0xad, 0xa8, 0x8b, 0x84, 0x80, 0xea, 0x49, 0x16, 0x7e, 0x7e, 0xe1, 0x2c, 0xab, 0xc9, 0xc9, - 0x12, 0x6b, 0x5c, 0x98, 0x78, 0x27, 0x09, 0xb8, 0x03, 0x4b, 0x41, 0xab, 0x72, 0xd4, 0x27, 0x82, - 0x51, 0xef, 0x05, 0xd7, 0x7c, 0x4c, 0x70, 0x55, 0x7e, 0x97, 0x82, 0xfc, 0xe7, 0x54, 0xeb, 0xbb, - 0x3d, 0x1e, 0x3a, 0x5e, 0xad, 0x4d, 0x48, 0xb5, 0x76, 0x07, 0x32, 0xc8, 0xf4, 0xb2, 0xb1, 0x7e, - 0xef, 0x74, 0x52, 0xfa, 0xfe, 0xec, 0x12, 0x2e, 0x94, 0x54, 0x4f, 0x3b, 0x36, 0x83, 0xd7, 0x21, - 0xdd, 0x72, 0x35, 0x77, 0xe4, 0x88, 0x52, 0x2d, 0x56, 0xec, 0xec, 0xcf, 0x2d, 0x97, 0x7a, 0x39, - 0xcc, 0x17, 0x4c, 0xfa, 0xc5, 0xc8, 0x1d, 0x8e, 0x5c, 0x25, 0xcd, 0xa5, 0xf9, 0x8a, 0xdc, 0x86, - 0x9c, 0xb8, 0x8f, 0xdd, 0x06, 0x66, 0x51, 0x4e, 0x9d, 0x12, 0x48, 0x19, 0xf2, 0x62, 0x81, 0xdb, - 0x67, 0x91, 0x2f, 0x93, 0x24, 0x09, 0x2c, 0x27, 0x39, 0x2c, 0x27, 0x32, 0x09, 0x2b, 0xcd, 0x78, - 0xc8, 0x83, 0x9a, 0x55, 0x9a, 0xf1, 0x90, 0x92, 0x16, 0xc0, 0x34, 0xa9, 0x45, 0xf2, 0x94, 0x25, - 0xc7, 0x4b, 0x17, 0x3b, 0x95, 0xab, 0xaf, 0xb2, 0x54, 0x0d, 0xd6, 0x75, 0xc9, 0x4c, 0x4c, 0x9c, - 0x2f, 0x5e, 0x2a, 0xce, 0x03, 0x0d, 0x26, 0x7f, 0xe5, 0x06, 0x53, 0xf9, 0x00, 0x03, 0xa3, 0x43, - 0xed, 0xaf, 0x58, 0xd4, 0x31, 0x7f, 0xe0, 0x83, 0x92, 0xc0, 0xbb, 0xe1, 0x8b, 0xca, 0x1f, 0x32, - 0x70, 0x23, 0xf6, 0x94, 0xa4, 0x02, 0xa9, 0xcf, 0xdb, 0xed, 0xa6, 0x68, 0x06, 0x4b, 0xdf, 0x4d, - 0x4a, 0xb0, 0x69, 0x0d, 0x0c, 0x97, 0x0e, 0x86, 0xee, 0x58, 0x45, 0x1e, 0xf9, 0x18, 0x16, 0xdb, - 0x7b, 0xad, 0xd6, 0x91, 0x31, 0xfc, 0x8a, 0xda, 0xc6, 0xe1, 0x18, 0xc3, 0x2b, 0x1b, 0x11, 0x0e, - 0x0a, 0x91, 0x9f, 0x42, 0x9a, 0xbf, 0x98, 0x92, 0xc4, 0xea, 0xb6, 0x39, 0xeb, 0xc6, 0xab, 0x5c, - 0x1c, 0xb3, 0x4c, 0x14, 0x4a, 0x61, 0x81, 0x7c, 0x08, 0xe9, 0x7d, 0xea, 0xf6, 0xac, 0x0e, 0x8f, - 0xbe, 0xc8, 0xd6, 0x82, 0xcb, 0x4e, 0x53, 0xb7, 0x3a, 0x63, 0x85, 0xc4, 0x9f, 0x86, 0xf1, 0x48, - 0x19, 0x92, 0xed, 0xed, 0x26, 0x8f, 0xd7, 0x88, 0x08, 0x63, 0x91, 0x9f, 0x40, 0x76, 0x97, 0x39, - 0xeb, 0x58, 0xeb, 0x63, 0xfc, 0xb2, 0x32, 0xc1, 0x87, 0xb2, 0xaa, 0x37, 0x94, 0x55, 0x1b, 0x62, - 0x68, 0xab, 0x67, 0xd9, 0x8b, 0x7e, 0xfb, 0xb7, 0x52, 0x42, 0xf5, 0x95, 0xc8, 0x1d, 0x58, 0xe4, - 0x01, 0xbf, 0xaf, 0x9d, 0xb4, 0x8c, 0x5f, 0x51, 0x25, 0x57, 0x4e, 0x6c, 0x2c, 0xaa, 0x41, 0x22, - 0xf9, 0x0c, 0x32, 0x6d, 0x63, 0x40, 0xad, 0x91, 0x2b, 0x06, 0x8c, 0x0b, 0xed, 0xe2, 0xe9, 0x90, - 0x23, 0x28, 0x36, 0xa8, 0x4d, 0xbb, 0x86, 0xe3, 0x52, 0x7b, 0xdb, 0x36, 0x5c, 0x43, 0xd7, 0xfa, - 0x5e, 0xb5, 0x39, 0x64, 0x43, 0x55, 0xf6, 0xe2, 0x56, 0x67, 0x98, 0x62, 0xd3, 0x5a, 0x4b, 0xb7, - 0x8d, 0xa1, 0xfb, 0xc4, 0xee, 0xb2, 0xfe, 0xc3, 0x62, 0x4b, 0xa2, 0xb0, 0xc6, 0xd2, 0xb0, 0xf4, - 0x23, 0x6a, 0x6f, 0x5b, 0xa6, 0xab, 0x19, 0x26, 0xb5, 0x77, 0x1b, 0xa2, 0xf5, 0x44, 0x19, 0x2c, - 0x48, 0x5b, 0x3d, 0xda, 0xef, 0x8b, 0x2c, 0xe5, 0x0b, 0x96, 0xba, 0x3b, 0x6a, 0x73, 0x1b, 0xf3, - 0x28, 0xa7, 0xe2, 0x33, 0xdb, 0x97, 0xfd, 0xbe, 0x74, 0x68, 0x7b, 0xaf, 0x85, 0x7d, 0x28, 0xab, - 0x4a, 0x14, 0x56, 0x50, 0x9e, 0xf4, 0x0d, 0xcd, 0xc1, 0x62, 0xb8, 0xcc, 0x0b, 0x8a, 0x4f, 0x20, - 0x15, 0xb8, 0x86, 0x0b, 0x71, 0x14, 0x65, 0x05, 0x05, 0x02, 0x34, 0xf2, 0x09, 0x24, 0xdb, 0xed, - 0x3d, 0xd1, 0xa4, 0x2e, 0x74, 0x57, 0x4c, 0xbe, 0xf0, 0xa5, 0x97, 0x76, 0x67, 0x35, 0x85, 0xcd, - 0x60, 0xa3, 0x59, 0x0f, 0x46, 0xbf, 0x97, 0xaf, 0x72, 0xb3, 0xf8, 0x7d, 0x02, 0x56, 0x30, 0x25, - 0xbc, 0x8a, 0xc7, 0x8e, 0xf0, 0x81, 0x54, 0xe8, 0xf3, 0x5b, 0xcb, 0xa1, 0xb1, 0x55, 0x54, 0xfe, - 0xfb, 0x90, 0xf1, 0x8e, 0x18, 0xdd, 0x8d, 0x49, 0x08, 0xae, 0xea, 0x89, 0x91, 0xaa, 0x3f, 0x7a, - 0xf0, 0xe4, 0x5c, 0x8f, 0x4f, 0x4e, 0x6f, 0xf8, 0xa8, 0xfc, 0x31, 0x03, 0x79, 0xc9, 0x10, 0xf9, - 0x26, 0x30, 0x43, 0xee, 0x04, 0xb3, 0xe8, 0x5d, 0x4f, 0x94, 0xca, 0xf4, 0x78, 0x02, 0x44, 0x78, - 0xaf, 0x71, 0xb9, 0xb9, 0xf2, 0x65, 0x74, 0xae, 0x5c, 0xc6, 0xd3, 0xdf, 0x8d, 0xbf, 0xae, 0x0b, - 0x4e, 0x94, 0x1f, 0x07, 0x26, 0xca, 0xf2, 0x19, 0xb6, 0x2e, 0x35, 0x4b, 0x4a, 0xb3, 0x5e, 0x76, - 0xf6, 0xac, 0x17, 0x3b, 0xd5, 0xe5, 0xce, 0x9a, 0xea, 0x1e, 0x7a, 0x53, 0x5d, 0xfe, 0x02, 0x53, - 0x9d, 0x37, 0xb0, 0xf2, 0xd9, 0xee, 0xe1, 0x74, 0x36, 0xbb, 0x36, 0x63, 0x36, 0x13, 0x8a, 0x9e, - 0x3c, 0xd9, 0x87, 0xc2, 0x9e, 0xa5, 0x6b, 0xfd, 0xfe, 0x58, 0x15, 0x75, 0x86, 0x76, 0x9e, 0x38, - 0x2d, 0xa3, 0x43, 0x75, 0xcd, 0xc6, 0x94, 0xcf, 0xd6, 0x17, 0x83, 0x4d, 0xee, 0x1c, 0x85, 0x98, - 0xee, 0xbb, 0x72, 0xf5, 0xee, 0xbb, 0x74, 0x75, 0x78, 0xf7, 0xff, 0x3a, 0x78, 0xfe, 0x39, 0x09, - 0x24, 0xea, 0x4d, 0xf2, 0x43, 0x58, 0x6f, 0x50, 0xc7, 0x35, 0x4c, 0xac, 0x69, 0xf2, 0xb0, 0xc5, - 0xad, 0x9e, 0xc1, 0x25, 0x5b, 0xb0, 0x16, 0xe5, 0xf8, 0x39, 0x1a, 0xcb, 0x23, 0xf7, 0xe1, 0x3a, - 0x3a, 0x30, 0x78, 0x3a, 0x91, 0xc1, 0x71, 0x2c, 0xf2, 0x00, 0x56, 0x64, 0x32, 0xa6, 0x47, 0x2a, - 0x98, 0x1e, 0x11, 0x01, 0x52, 0x87, 0x34, 0x3f, 0x1c, 0x66, 0x7b, 0x7e, 0xeb, 0x66, 0xa4, 0x84, - 0xb7, 0xb0, 0xd0, 0xe0, 0x3c, 0x17, 0x72, 0xa4, 0xd0, 0x24, 0x9f, 0x42, 0xee, 0xe5, 0xd0, 0x71, - 0x6d, 0xaa, 0x0d, 0x1c, 0x91, 0xc6, 0xd7, 0x25, 0xff, 0x78, 0x3c, 0x11, 0xd3, 0x53, 0x59, 0xf2, - 0x18, 0xf2, 0xfb, 0xd4, 0xe9, 0xed, 0x68, 0x2e, 0xfd, 0xa5, 0x36, 0x16, 0x6d, 0xfc, 0xb6, 0xa4, - 0x2a, 0x71, 0x05, 0x4c, 0x92, 0x15, 0x48, 0x0d, 0xd2, 0x4f, 0x4f, 0x86, 0x96, 0x43, 0x45, 0x9a, - 0xdf, 0x94, 0x54, 0x39, 0x43, 0x68, 0x09, 0xb1, 0xca, 0x6f, 0x93, 0x90, 0xf5, 0xb6, 0x27, 0x1b, - 0xb0, 0x2c, 0xdd, 0x3c, 0x8e, 0xbd, 0xdc, 0x8d, 0x61, 0x72, 0xc8, 0x7f, 0xcc, 0xa5, 0xce, 0x50, - 0xd3, 0x69, 0x8c, 0xff, 0x7c, 0x5e, 0xc8, 0xba, 0x04, 0x08, 0xc2, 0xe4, 0x99, 0x9f, 0x72, 0x7e, - 0x20, 0xfc, 0x5a, 0x37, 0xcc, 0x4e, 0xb0, 0x34, 0x47, 0xe8, 0xe4, 0x1e, 0x2c, 0xfa, 0x34, 0x0c, - 0x80, 0x74, 0x30, 0x00, 0x82, 0x5c, 0xc9, 0xfb, 0x99, 0x2b, 0x7b, 0x3f, 0xe4, 0xc4, 0xec, 0x25, - 0x9d, 0x58, 0xf9, 0xb5, 0x0f, 0xf2, 0xbc, 0x62, 0xb7, 0x0e, 0xe9, 0xe7, 0x9a, 0x6b, 0x1c, 0x73, - 0x7f, 0x64, 0x55, 0xb1, 0x22, 0x2d, 0x58, 0x12, 0x05, 0x4c, 0xee, 0x67, 0xc1, 0xcd, 0x22, 0x5f, - 0x21, 0xc2, 0x65, 0x31, 0x64, 0xa2, 0xf2, 0xc2, 0xef, 0x15, 0xe4, 0x7b, 0x90, 0x69, 0x6a, 0x8e, - 0x63, 0x98, 0x5d, 0xdc, 0x58, 0xba, 0x36, 0x8f, 0xce, 0x44, 0xbe, 0xd6, 0x6c, 0x93, 0x89, 0x84, - 0x80, 0xa6, 0x47, 0xaf, 0xb4, 0xe0, 0x9a, 0x1c, 0x7b, 0xec, 0x34, 0x62, 0x56, 0x10, 0xa7, 0x11, - 0x1f, 0x24, 0xee, 0xc2, 0x42, 0x53, 0x73, 0x7b, 0x8e, 0x32, 0x8f, 0x19, 0x73, 0x23, 0x12, 0xbb, - 0x8c, 0xab, 0x72, 0x99, 0xca, 0x9f, 0x12, 0x00, 0x53, 0x2a, 0x9b, 0xcc, 0xf6, 0x58, 0x51, 0x37, - 0xa9, 0x8d, 0x5e, 0xc6, 0xd7, 0x55, 0x03, 0x34, 0xd6, 0xdc, 0x99, 0xac, 0xf7, 0x3d, 0x11, 0xf5, - 0xee, 0x88, 0xf0, 0x60, 0x0b, 0x54, 0x4c, 0xa2, 0x62, 0x90, 0x48, 0x0a, 0x90, 0x6d, 0x32, 0xff, - 0xeb, 0x56, 0x5f, 0x84, 0xa3, 0xbf, 0x66, 0x61, 0xdd, 0xd4, 0x6c, 0x87, 0x76, 0x9e, 0xd9, 0xd6, - 0x80, 0x7f, 0xb0, 0x59, 0xc0, 0x63, 0x85, 0xc9, 0x95, 0x7f, 0x66, 0x21, 0xe7, 0x7f, 0x86, 0x21, - 0x5f, 0x4c, 0xd1, 0x35, 0x1f, 0x7a, 0x3e, 0xfa, 0x6e, 0x52, 0x9a, 0xfb, 0x2f, 0x11, 0xf6, 0x7c, - 0x2c, 0xc2, 0x4e, 0xc6, 0x23, 0xec, 0x94, 0x8c, 0xb0, 0x83, 0x03, 0xf9, 0x42, 0x64, 0x20, 0x27, - 0x02, 0xd7, 0x71, 0xfc, 0xcd, 0x71, 0xdc, 0x63, 0x1f, 0x91, 0xad, 0x45, 0x46, 0x15, 0xff, 0xa0, - 0xe7, 0xa0, 0xb0, 0x75, 0x1f, 0x85, 0x71, 0xe8, 0xee, 0xa1, 0x2e, 0x22, 0x50, 0x57, 0x81, 0xef, - 0x85, 0x28, 0x6b, 0x85, 0xa3, 0x2c, 0x8e, 0xe1, 0x23, 0xa8, 0x2a, 0x77, 0x15, 0x54, 0x15, 0x98, - 0xf5, 0x61, 0xd6, 0xac, 0x9f, 0x8f, 0x99, 0xf5, 0x63, 0x51, 0xca, 0xb5, 0x99, 0x28, 0x65, 0x31, - 0x0e, 0xa5, 0x2c, 0x9d, 0x89, 0x52, 0x96, 0x23, 0x28, 0xe5, 0x4e, 0x18, 0x40, 0xaf, 0xa0, 0x48, - 0x08, 0x30, 0x4b, 0x78, 0x70, 0xf5, 0x0a, 0x78, 0x50, 0x00, 0x19, 0x72, 0x39, 0x20, 0xc3, 0x5a, - 0x43, 0x6b, 0xa4, 0xeb, 0xd4, 0x71, 0xea, 0xf4, 0xd0, 0xb2, 0xa9, 0x57, 0x40, 0x6e, 0x60, 0x62, - 0xc5, 0xf2, 0xd8, 0x18, 0xf1, 0x4c, 0x33, 0xfa, 0x23, 0x9b, 0x0a, 0x86, 0x87, 0x19, 0x95, 0x75, - 0xd4, 0x3a, 0x83, 0xcb, 0x3c, 0x88, 0xd3, 0x08, 0x46, 0xe6, 0x4d, 0xee, 0x41, 0x9f, 0xe0, 0x73, - 0xf1, 0x7a, 0x15, 0x89, 0x8b, 0x77, 0x3c, 0x1b, 0xee, 0x5e, 0x7f, 0x77, 0x70, 0x37, 0x02, 0xe0, - 0x6f, 0xf1, 0x32, 0x13, 0x20, 0xfe, 0x2f, 0x30, 0xe0, 0x21, 0xac, 0x46, 0xba, 0x0d, 0xf9, 0x12, - 0x52, 0xfb, 0xfe, 0xc7, 0xbe, 0xfa, 0x67, 0xa7, 0x93, 0xd2, 0xc3, 0x8b, 0xc3, 0x2b, 0xc9, 0xdc, - 0x3e, 0x22, 0x46, 0xf6, 0xb7, 0xbe, 0xff, 0xea, 0x1f, 0xc5, 0xb9, 0x57, 0x6f, 0x8a, 0x89, 0xd7, - 0x6f, 0x8a, 0x89, 0xbf, 0xbf, 0x29, 0x26, 0x7e, 0xf3, 0xb6, 0x38, 0xf7, 0xed, 0xdb, 0xe2, 0xdc, - 0xeb, 0xb7, 0xc5, 0xb9, 0xbf, 0xbe, 0x2d, 0xce, 0xfd, 0xec, 0xee, 0x79, 0x5b, 0x84, 0xfe, 0xd9, - 0x75, 0x90, 0x46, 0xc2, 0x83, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x2d, 0x05, 0xd6, 0xed, 0x06, - 0x1b, 0x00, 0x00, -} - -func (m *Node) 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 *Node) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.RaftIndex.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - if len(m.Meta) > 0 { - for k := range m.Meta { - v := m.Meta[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintStructs(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintStructs(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintStructs(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x32 - } - } - if len(m.TaggedAddresses) > 0 { - for k := range m.TaggedAddresses { - v := m.TaggedAddresses[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintStructs(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintStructs(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintStructs(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x2a - } - } - if len(m.Datacenter) > 0 { - i -= len(m.Datacenter) - copy(dAtA[i:], m.Datacenter) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Datacenter))) - i-- - dAtA[i] = 0x22 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0x1a - } - if len(m.Node) > 0 { - i -= len(m.Node) - copy(dAtA[i:], m.Node) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Node))) - i-- - dAtA[i] = 0x12 - } - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintStructs(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ServiceDefinition) 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 *ServiceDefinition) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceDefinition) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.EnterpriseMeta != nil { - { - size, err := m.EnterpriseMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } - if len(m.TaggedAddresses) > 0 { - for k := range m.TaggedAddresses { - v := m.TaggedAddresses[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintStructs(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintStructs(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - } - if m.Connect != nil { - { - size, err := m.Connect.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x7a - } - if m.Proxy != nil { - { - size, err := m.Proxy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 - } - if m.EnableTagOverride { - i-- - if m.EnableTagOverride { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x60 - } - if len(m.Token) > 0 { - i -= len(m.Token) - copy(dAtA[i:], m.Token) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Token))) - i-- - dAtA[i] = 0x5a - } - if m.Weights != nil { - { - size, err := m.Weights.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - if len(m.Checks) > 0 { - for iNdEx := len(m.Checks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Checks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - { - size, err := m.Check.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - if m.Port != 0 { - i = encodeVarintStructs(dAtA, i, uint64(m.Port)) - i-- - dAtA[i] = 0x38 - } - if len(m.Meta) > 0 { - for k := range m.Meta { - v := m.Meta[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintStructs(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintStructs(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintStructs(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x32 - } - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0x2a - } - if len(m.Tags) > 0 { - for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Tags[iNdEx]) - copy(dAtA[i:], m.Tags[iNdEx]) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Tags[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a - } - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintStructs(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0x12 - } - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ServiceAddress) 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 *ServiceAddress) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Port != 0 { - i = encodeVarintStructs(dAtA, i, uint64(m.Port)) - i-- - dAtA[i] = 0x10 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HealthCheck) 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 *HealthCheck) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HealthCheck) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.EnterpriseMeta != nil { - { - size, err := m.EnterpriseMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x62 - } - { - size, err := m.RaftIndex.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - { - size, err := m.Definition.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - if len(m.ServiceTags) > 0 { - for iNdEx := len(m.ServiceTags) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ServiceTags[iNdEx]) - copy(dAtA[i:], m.ServiceTags[iNdEx]) - i = encodeVarintStructs(dAtA, i, uint64(len(m.ServiceTags[iNdEx]))) - i-- - dAtA[i] = 0x4a - } - } - if len(m.ServiceName) > 0 { - i -= len(m.ServiceName) - copy(dAtA[i:], m.ServiceName) - i = encodeVarintStructs(dAtA, i, uint64(len(m.ServiceName))) - i-- - dAtA[i] = 0x42 - } - if len(m.ServiceID) > 0 { - i -= len(m.ServiceID) - copy(dAtA[i:], m.ServiceID) - i = encodeVarintStructs(dAtA, i, uint64(len(m.ServiceID))) - i-- - dAtA[i] = 0x3a - } - if len(m.Output) > 0 { - i -= len(m.Output) - copy(dAtA[i:], m.Output) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Output))) - i-- - dAtA[i] = 0x32 - } - if len(m.Notes) > 0 { - i -= len(m.Notes) - copy(dAtA[i:], m.Notes) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Notes))) - i-- - dAtA[i] = 0x2a - } - if len(m.Status) > 0 { - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Status))) - i-- - dAtA[i] = 0x22 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a - } - if len(m.CheckID) > 0 { - i -= len(m.CheckID) - copy(dAtA[i:], m.CheckID) - i = encodeVarintStructs(dAtA, i, uint64(len(m.CheckID))) - i-- - dAtA[i] = 0x12 - } - if len(m.Node) > 0 { - i -= len(m.Node) - copy(dAtA[i:], m.Node) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Node))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HeaderValue) 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 *HeaderValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HeaderValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - for iNdEx := len(m.Value) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Value[iNdEx]) - copy(dAtA[i:], m.Value[iNdEx]) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Value[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *HealthCheckDefinition) 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 *HealthCheckDefinition) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HealthCheckDefinition) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Body) > 0 { - i -= len(m.Body) - copy(dAtA[i:], m.Body) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Body))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 - } - n11, err11 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.TTL, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.TTL):]) - if err11 != nil { - return 0, err11 - } - i -= n11 - i = encodeVarintStructs(dAtA, i, uint64(n11)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - if len(m.AliasService) > 0 { - i -= len(m.AliasService) - copy(dAtA[i:], m.AliasService) - i = encodeVarintStructs(dAtA, i, uint64(len(m.AliasService))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - if len(m.AliasNode) > 0 { - i -= len(m.AliasNode) - copy(dAtA[i:], m.AliasNode) - i = encodeVarintStructs(dAtA, i, uint64(len(m.AliasNode))) - i-- - dAtA[i] = 0x7a - } - if m.GRPCUseTLS { - i-- - if m.GRPCUseTLS { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x70 - } - if len(m.GRPC) > 0 { - i -= len(m.GRPC) - copy(dAtA[i:], m.GRPC) - i = encodeVarintStructs(dAtA, i, uint64(len(m.GRPC))) - i-- - dAtA[i] = 0x6a - } - if len(m.Shell) > 0 { - i -= len(m.Shell) - copy(dAtA[i:], m.Shell) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Shell))) - i-- - dAtA[i] = 0x62 - } - if len(m.DockerContainerID) > 0 { - i -= len(m.DockerContainerID) - copy(dAtA[i:], m.DockerContainerID) - i = encodeVarintStructs(dAtA, i, uint64(len(m.DockerContainerID))) - i-- - dAtA[i] = 0x5a - } - if len(m.ScriptArgs) > 0 { - for iNdEx := len(m.ScriptArgs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ScriptArgs[iNdEx]) - copy(dAtA[i:], m.ScriptArgs[iNdEx]) - i = encodeVarintStructs(dAtA, i, uint64(len(m.ScriptArgs[iNdEx]))) - i-- - dAtA[i] = 0x52 - } - } - if m.OutputMaxSize != 0 { - i = encodeVarintStructs(dAtA, i, uint64(m.OutputMaxSize)) - i-- - dAtA[i] = 0x48 - } - n12, err12 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DeregisterCriticalServiceAfter, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.DeregisterCriticalServiceAfter):]) - if err12 != nil { - return 0, err12 - } - i -= n12 - i = encodeVarintStructs(dAtA, i, uint64(n12)) - i-- - dAtA[i] = 0x42 - n13, err13 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Timeout, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout):]) - if err13 != nil { - return 0, err13 - } - i -= n13 - i = encodeVarintStructs(dAtA, i, uint64(n13)) - i-- - dAtA[i] = 0x3a - n14, err14 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Interval, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Interval):]) - if err14 != nil { - return 0, err14 - } - i -= n14 - i = encodeVarintStructs(dAtA, i, uint64(n14)) - i-- - dAtA[i] = 0x32 - if len(m.TCP) > 0 { - i -= len(m.TCP) - copy(dAtA[i:], m.TCP) - i = encodeVarintStructs(dAtA, i, uint64(len(m.TCP))) - i-- - dAtA[i] = 0x2a - } - if len(m.Method) > 0 { - i -= len(m.Method) - copy(dAtA[i:], m.Method) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Method))) - i-- - dAtA[i] = 0x22 - } - if len(m.Header) > 0 { - for k := range m.Header { - v := m.Header[k] - baseI := i - { - size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintStructs(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintStructs(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if m.TLSSkipVerify { - i-- - if m.TLSSkipVerify { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.HTTP) > 0 { - i -= len(m.HTTP) - copy(dAtA[i:], m.HTTP) - i = encodeVarintStructs(dAtA, i, uint64(len(m.HTTP))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CheckServiceNode) 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 *CheckServiceNode) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CheckServiceNode) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Checks) > 0 { - for iNdEx := len(m.Checks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Checks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.Service != nil { - { - size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Node != nil { - { - size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *NodeService) 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 *NodeService) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodeService) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.EnterpriseMeta != nil { - { - size, err := m.EnterpriseMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - if len(m.TaggedAddresses) > 0 { - for k := range m.TaggedAddresses { - v := m.TaggedAddresses[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintStructs(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintStructs(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x7a - } - } - { - size, err := m.RaftIndex.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 - if m.LocallyRegisteredAsSidecar { - i-- - if m.LocallyRegisteredAsSidecar { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x68 - } - { - size, err := m.Connect.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - { - size, err := m.Proxy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - if m.EnableTagOverride { - i-- - if m.EnableTagOverride { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x48 - } - if m.Weights != nil { - { - size, err := m.Weights.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.Port != 0 { - i = encodeVarintStructs(dAtA, i, uint64(m.Port)) - i-- - dAtA[i] = 0x38 - } - if len(m.Meta) > 0 { - for k := range m.Meta { - v := m.Meta[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintStructs(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintStructs(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintStructs(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x32 - } - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0x2a - } - if len(m.Tags) > 0 { - for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Tags[iNdEx]) - copy(dAtA[i:], m.Tags[iNdEx]) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Tags[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Service) > 0 { - i -= len(m.Service) - copy(dAtA[i:], m.Service) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Service))) - i-- - dAtA[i] = 0x1a - } - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintStructs(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0x12 - } - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ConnectProxyConfig) 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 *ConnectProxyConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConnectProxyConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Expose != nil { - { - size, err := m.Expose.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.MeshGateway != nil { - { - size, err := m.MeshGateway.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if len(m.Upstreams) > 0 { - for iNdEx := len(m.Upstreams) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Upstreams[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if m.Config != nil { - { - size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.LocalServicePort != 0 { - i = encodeVarintStructs(dAtA, i, uint64(m.LocalServicePort)) - i-- - dAtA[i] = 0x20 - } - if len(m.LocalServiceAddress) > 0 { - i -= len(m.LocalServiceAddress) - copy(dAtA[i:], m.LocalServiceAddress) - i = encodeVarintStructs(dAtA, i, uint64(len(m.LocalServiceAddress))) - i-- - dAtA[i] = 0x1a - } - if len(m.DestinationServiceID) > 0 { - i -= len(m.DestinationServiceID) - copy(dAtA[i:], m.DestinationServiceID) - i = encodeVarintStructs(dAtA, i, uint64(len(m.DestinationServiceID))) - i-- - dAtA[i] = 0x12 - } - if len(m.DestinationServiceName) > 0 { - i -= len(m.DestinationServiceName) - copy(dAtA[i:], m.DestinationServiceName) - i = encodeVarintStructs(dAtA, i, uint64(len(m.DestinationServiceName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Upstream) 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 *Upstream) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Upstream) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MeshGateway != nil { - { - size, err := m.MeshGateway.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.Config != nil { - { - size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.LocalBindPort != 0 { - i = encodeVarintStructs(dAtA, i, uint64(m.LocalBindPort)) - i-- - dAtA[i] = 0x30 - } - if len(m.LocalBindAddress) > 0 { - i -= len(m.LocalBindAddress) - copy(dAtA[i:], m.LocalBindAddress) - i = encodeVarintStructs(dAtA, i, uint64(len(m.LocalBindAddress))) - i-- - dAtA[i] = 0x2a - } - if len(m.Datacenter) > 0 { - i -= len(m.Datacenter) - copy(dAtA[i:], m.Datacenter) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Datacenter))) - i-- - dAtA[i] = 0x22 - } - if len(m.DestinationName) > 0 { - i -= len(m.DestinationName) - copy(dAtA[i:], m.DestinationName) - i = encodeVarintStructs(dAtA, i, uint64(len(m.DestinationName))) - i-- - dAtA[i] = 0x1a - } - if len(m.DestinationNamespace) > 0 { - i -= len(m.DestinationNamespace) - copy(dAtA[i:], m.DestinationNamespace) - i = encodeVarintStructs(dAtA, i, uint64(len(m.DestinationNamespace))) - i-- - dAtA[i] = 0x12 - } - if len(m.DestinationType) > 0 { - i -= len(m.DestinationType) - copy(dAtA[i:], m.DestinationType) - i = encodeVarintStructs(dAtA, i, uint64(len(m.DestinationType))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ServiceConnect) 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 *ServiceConnect) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceConnect) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.SidecarService != nil { - { - size, err := m.SidecarService.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Native { - i-- - if m.Native { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Weights) 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 *Weights) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Weights) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Warning != 0 { - i = encodeVarintStructs(dAtA, i, uint64(m.Warning)) - i-- - dAtA[i] = 0x10 - } - if m.Passing != 0 { - i = encodeVarintStructs(dAtA, i, uint64(m.Passing)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ExposeConfig) 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 *ExposeConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ExposeConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Paths) > 0 { - for iNdEx := len(m.Paths) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Paths[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Checks { - i-- - if m.Checks { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ExposePath) 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 *ExposePath) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ExposePath) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ParsedFromCheck { - i-- - if m.ParsedFromCheck { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if len(m.Protocol) > 0 { - i -= len(m.Protocol) - copy(dAtA[i:], m.Protocol) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Protocol))) - i-- - dAtA[i] = 0x22 - } - if m.LocalPathPort != 0 { - i = encodeVarintStructs(dAtA, i, uint64(m.LocalPathPort)) - i-- - dAtA[i] = 0x18 - } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0x12 - } - if m.ListenerPort != 0 { - i = encodeVarintStructs(dAtA, i, uint64(m.ListenerPort)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *CheckType) 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 *CheckType) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CheckType) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Body) > 0 { - i -= len(m.Body) - copy(dAtA[i:], m.Body) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Body))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xd2 - } - if m.OutputMaxSize != 0 { - i = encodeVarintStructs(dAtA, i, uint64(m.OutputMaxSize)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xc8 - } - if len(m.ProxyGRPC) > 0 { - i -= len(m.ProxyGRPC) - copy(dAtA[i:], m.ProxyGRPC) - i = encodeVarintStructs(dAtA, i, uint64(len(m.ProxyGRPC))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xc2 - } - if len(m.ProxyHTTP) > 0 { - i -= len(m.ProxyHTTP) - copy(dAtA[i:], m.ProxyHTTP) - i = encodeVarintStructs(dAtA, i, uint64(len(m.ProxyHTTP))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xba - } - if m.FailuresBeforeCritical != 0 { - i = encodeVarintStructs(dAtA, i, uint64(m.FailuresBeforeCritical)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xb0 - } - if m.SuccessBeforePassing != 0 { - i = encodeVarintStructs(dAtA, i, uint64(m.SuccessBeforePassing)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa8 - } - if len(m.Header) > 0 { - for k := range m.Header { - v := m.Header[k] - baseI := i - { - size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStructs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintStructs(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintStructs(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa2 - } - } - n31, err31 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DeregisterCriticalServiceAfter, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.DeregisterCriticalServiceAfter):]) - if err31 != nil { - return 0, err31 - } - i -= n31 - i = encodeVarintStructs(dAtA, i, uint64(n31)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x9a - n32, err32 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.TTL, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.TTL):]) - if err32 != nil { - return 0, err32 - } - i -= n32 - i = encodeVarintStructs(dAtA, i, uint64(n32)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 - n33, err33 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Timeout, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout):]) - if err33 != nil { - return 0, err33 - } - i -= n33 - i = encodeVarintStructs(dAtA, i, uint64(n33)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - if m.TLSSkipVerify { - i-- - if m.TLSSkipVerify { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x80 - } - if m.GRPCUseTLS { - i-- - if m.GRPCUseTLS { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x78 - } - if len(m.GRPC) > 0 { - i -= len(m.GRPC) - copy(dAtA[i:], m.GRPC) - i = encodeVarintStructs(dAtA, i, uint64(len(m.GRPC))) - i-- - dAtA[i] = 0x72 - } - if len(m.Shell) > 0 { - i -= len(m.Shell) - copy(dAtA[i:], m.Shell) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Shell))) - i-- - dAtA[i] = 0x6a - } - if len(m.DockerContainerID) > 0 { - i -= len(m.DockerContainerID) - copy(dAtA[i:], m.DockerContainerID) - i = encodeVarintStructs(dAtA, i, uint64(len(m.DockerContainerID))) - i-- - dAtA[i] = 0x62 - } - if len(m.AliasService) > 0 { - i -= len(m.AliasService) - copy(dAtA[i:], m.AliasService) - i = encodeVarintStructs(dAtA, i, uint64(len(m.AliasService))) - i-- - dAtA[i] = 0x5a - } - if len(m.AliasNode) > 0 { - i -= len(m.AliasNode) - copy(dAtA[i:], m.AliasNode) - i = encodeVarintStructs(dAtA, i, uint64(len(m.AliasNode))) - i-- - dAtA[i] = 0x52 - } - n34, err34 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Interval, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Interval):]) - if err34 != nil { - return 0, err34 - } - i -= n34 - i = encodeVarintStructs(dAtA, i, uint64(n34)) - i-- - dAtA[i] = 0x4a - if len(m.TCP) > 0 { - i -= len(m.TCP) - copy(dAtA[i:], m.TCP) - i = encodeVarintStructs(dAtA, i, uint64(len(m.TCP))) - i-- - dAtA[i] = 0x42 - } - if len(m.Method) > 0 { - i -= len(m.Method) - copy(dAtA[i:], m.Method) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Method))) - i-- - dAtA[i] = 0x3a - } - if len(m.HTTP) > 0 { - i -= len(m.HTTP) - copy(dAtA[i:], m.HTTP) - i = encodeVarintStructs(dAtA, i, uint64(len(m.HTTP))) - i-- - dAtA[i] = 0x32 - } - if len(m.ScriptArgs) > 0 { - for iNdEx := len(m.ScriptArgs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ScriptArgs[iNdEx]) - copy(dAtA[i:], m.ScriptArgs[iNdEx]) - i = encodeVarintStructs(dAtA, i, uint64(len(m.ScriptArgs[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.Notes) > 0 { - i -= len(m.Notes) - copy(dAtA[i:], m.Notes) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Notes))) - i-- - dAtA[i] = 0x22 - } - if len(m.Status) > 0 { - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Status))) - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.CheckID) > 0 { - i -= len(m.CheckID) - copy(dAtA[i:], m.CheckID) - i = encodeVarintStructs(dAtA, i, uint64(len(m.CheckID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MeshGatewayConfig) 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 *MeshGatewayConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MeshGatewayConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Mode) > 0 { - i -= len(m.Mode) - copy(dAtA[i:], m.Mode) - i = encodeVarintStructs(dAtA, i, uint64(len(m.Mode))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintStructs(dAtA []byte, offset int, v uint64) int { - offset -= sovStructs(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Node) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Node) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Address) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Datacenter) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if len(m.TaggedAddresses) > 0 { - for k, v := range m.TaggedAddresses { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovStructs(uint64(len(k))) + 1 + len(v) + sovStructs(uint64(len(v))) - n += mapEntrySize + 1 + sovStructs(uint64(mapEntrySize)) - } - } - if len(m.Meta) > 0 { - for k, v := range m.Meta { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovStructs(uint64(len(k))) + 1 + len(v) + sovStructs(uint64(len(v))) - n += mapEntrySize + 1 + sovStructs(uint64(mapEntrySize)) - } - } - l = m.RaftIndex.Size() - n += 1 + l + sovStructs(uint64(l)) - return n -} - -func (m *ServiceDefinition) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Kind) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.ID) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if len(m.Tags) > 0 { - for _, s := range m.Tags { - l = len(s) - n += 1 + l + sovStructs(uint64(l)) - } - } - l = len(m.Address) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if len(m.Meta) > 0 { - for k, v := range m.Meta { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovStructs(uint64(len(k))) + 1 + len(v) + sovStructs(uint64(len(v))) - n += mapEntrySize + 1 + sovStructs(uint64(mapEntrySize)) - } - } - if m.Port != 0 { - n += 1 + sovStructs(uint64(m.Port)) - } - l = m.Check.Size() - n += 1 + l + sovStructs(uint64(l)) - if len(m.Checks) > 0 { - for _, e := range m.Checks { - l = e.Size() - n += 1 + l + sovStructs(uint64(l)) - } - } - if m.Weights != nil { - l = m.Weights.Size() - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Token) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if m.EnableTagOverride { - n += 2 - } - if m.Proxy != nil { - l = m.Proxy.Size() - n += 1 + l + sovStructs(uint64(l)) - } - if m.Connect != nil { - l = m.Connect.Size() - n += 1 + l + sovStructs(uint64(l)) - } - if len(m.TaggedAddresses) > 0 { - for k, v := range m.TaggedAddresses { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovStructs(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovStructs(uint64(len(k))) + l - n += mapEntrySize + 2 + sovStructs(uint64(mapEntrySize)) - } - } - if m.EnterpriseMeta != nil { - l = m.EnterpriseMeta.Size() - n += 2 + l + sovStructs(uint64(l)) - } - return n -} - -func (m *ServiceAddress) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if m.Port != 0 { - n += 1 + sovStructs(uint64(m.Port)) - } - return n -} - -func (m *HealthCheck) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Node) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.CheckID) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Status) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Notes) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Output) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.ServiceID) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.ServiceName) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if len(m.ServiceTags) > 0 { - for _, s := range m.ServiceTags { - l = len(s) - n += 1 + l + sovStructs(uint64(l)) - } - } - l = m.Definition.Size() - n += 1 + l + sovStructs(uint64(l)) - l = m.RaftIndex.Size() - n += 1 + l + sovStructs(uint64(l)) - l = len(m.Type) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if m.EnterpriseMeta != nil { - l = m.EnterpriseMeta.Size() - n += 1 + l + sovStructs(uint64(l)) - } - return n -} - -func (m *HeaderValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Value) > 0 { - for _, s := range m.Value { - l = len(s) - n += 1 + l + sovStructs(uint64(l)) - } - } - return n -} - -func (m *HealthCheckDefinition) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.HTTP) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if m.TLSSkipVerify { - n += 2 - } - if len(m.Header) > 0 { - for k, v := range m.Header { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovStructs(uint64(len(k))) + 1 + l + sovStructs(uint64(l)) - n += mapEntrySize + 1 + sovStructs(uint64(mapEntrySize)) - } - } - l = len(m.Method) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.TCP) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Interval) - n += 1 + l + sovStructs(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout) - n += 1 + l + sovStructs(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.DeregisterCriticalServiceAfter) - n += 1 + l + sovStructs(uint64(l)) - if m.OutputMaxSize != 0 { - n += 1 + sovStructs(uint64(m.OutputMaxSize)) - } - if len(m.ScriptArgs) > 0 { - for _, s := range m.ScriptArgs { - l = len(s) - n += 1 + l + sovStructs(uint64(l)) - } - } - l = len(m.DockerContainerID) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Shell) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.GRPC) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if m.GRPCUseTLS { - n += 2 - } - l = len(m.AliasNode) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.AliasService) - if l > 0 { - n += 2 + l + sovStructs(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.TTL) - n += 2 + l + sovStructs(uint64(l)) - l = len(m.Body) - if l > 0 { - n += 2 + l + sovStructs(uint64(l)) - } - return n -} - -func (m *CheckServiceNode) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Node != nil { - l = m.Node.Size() - n += 1 + l + sovStructs(uint64(l)) - } - if m.Service != nil { - l = m.Service.Size() - n += 1 + l + sovStructs(uint64(l)) - } - if len(m.Checks) > 0 { - for _, e := range m.Checks { - l = e.Size() - n += 1 + l + sovStructs(uint64(l)) - } - } - return n -} - -func (m *NodeService) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Kind) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.ID) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Service) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if len(m.Tags) > 0 { - for _, s := range m.Tags { - l = len(s) - n += 1 + l + sovStructs(uint64(l)) - } - } - l = len(m.Address) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if len(m.Meta) > 0 { - for k, v := range m.Meta { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovStructs(uint64(len(k))) + 1 + len(v) + sovStructs(uint64(len(v))) - n += mapEntrySize + 1 + sovStructs(uint64(mapEntrySize)) - } - } - if m.Port != 0 { - n += 1 + sovStructs(uint64(m.Port)) - } - if m.Weights != nil { - l = m.Weights.Size() - n += 1 + l + sovStructs(uint64(l)) - } - if m.EnableTagOverride { - n += 2 - } - l = m.Proxy.Size() - n += 1 + l + sovStructs(uint64(l)) - l = m.Connect.Size() - n += 1 + l + sovStructs(uint64(l)) - if m.LocallyRegisteredAsSidecar { - n += 2 - } - l = m.RaftIndex.Size() - n += 1 + l + sovStructs(uint64(l)) - if len(m.TaggedAddresses) > 0 { - for k, v := range m.TaggedAddresses { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovStructs(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovStructs(uint64(len(k))) + l - n += mapEntrySize + 1 + sovStructs(uint64(mapEntrySize)) - } - } - if m.EnterpriseMeta != nil { - l = m.EnterpriseMeta.Size() - n += 2 + l + sovStructs(uint64(l)) - } - return n -} - -func (m *ConnectProxyConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DestinationServiceName) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.DestinationServiceID) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.LocalServiceAddress) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if m.LocalServicePort != 0 { - n += 1 + sovStructs(uint64(m.LocalServicePort)) - } - if m.Config != nil { - l = m.Config.Size() - n += 1 + l + sovStructs(uint64(l)) - } - if len(m.Upstreams) > 0 { - for _, e := range m.Upstreams { - l = e.Size() - n += 1 + l + sovStructs(uint64(l)) - } - } - if m.MeshGateway != nil { - l = m.MeshGateway.Size() - n += 1 + l + sovStructs(uint64(l)) - } - if m.Expose != nil { - l = m.Expose.Size() - n += 1 + l + sovStructs(uint64(l)) - } - return n -} - -func (m *Upstream) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DestinationType) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.DestinationNamespace) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.DestinationName) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Datacenter) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.LocalBindAddress) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if m.LocalBindPort != 0 { - n += 1 + sovStructs(uint64(m.LocalBindPort)) - } - if m.Config != nil { - l = m.Config.Size() - n += 1 + l + sovStructs(uint64(l)) - } - if m.MeshGateway != nil { - l = m.MeshGateway.Size() - n += 1 + l + sovStructs(uint64(l)) - } - return n -} - -func (m *ServiceConnect) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Native { - n += 2 - } - if m.SidecarService != nil { - l = m.SidecarService.Size() - n += 1 + l + sovStructs(uint64(l)) - } - return n -} - -func (m *Weights) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Passing != 0 { - n += 1 + sovStructs(uint64(m.Passing)) - } - if m.Warning != 0 { - n += 1 + sovStructs(uint64(m.Warning)) - } - return n -} - -func (m *ExposeConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Checks { - n += 2 - } - if len(m.Paths) > 0 { - for _, e := range m.Paths { - l = e.Size() - n += 1 + l + sovStructs(uint64(l)) - } - } - return n -} - -func (m *ExposePath) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ListenerPort != 0 { - n += 1 + sovStructs(uint64(m.ListenerPort)) - } - l = len(m.Path) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if m.LocalPathPort != 0 { - n += 1 + sovStructs(uint64(m.LocalPathPort)) - } - l = len(m.Protocol) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if m.ParsedFromCheck { - n += 2 - } - return n -} - -func (m *CheckType) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.CheckID) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Status) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Notes) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if len(m.ScriptArgs) > 0 { - for _, s := range m.ScriptArgs { - l = len(s) - n += 1 + l + sovStructs(uint64(l)) - } - } - l = len(m.HTTP) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Method) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.TCP) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Interval) - n += 1 + l + sovStructs(uint64(l)) - l = len(m.AliasNode) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.AliasService) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.DockerContainerID) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.Shell) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - l = len(m.GRPC) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - if m.GRPCUseTLS { - n += 2 - } - if m.TLSSkipVerify { - n += 3 - } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout) - n += 2 + l + sovStructs(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.TTL) - n += 2 + l + sovStructs(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.DeregisterCriticalServiceAfter) - n += 2 + l + sovStructs(uint64(l)) - if len(m.Header) > 0 { - for k, v := range m.Header { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovStructs(uint64(len(k))) + 1 + l + sovStructs(uint64(l)) - n += mapEntrySize + 2 + sovStructs(uint64(mapEntrySize)) - } - } - if m.SuccessBeforePassing != 0 { - n += 2 + sovStructs(uint64(m.SuccessBeforePassing)) - } - if m.FailuresBeforeCritical != 0 { - n += 2 + sovStructs(uint64(m.FailuresBeforeCritical)) - } - l = len(m.ProxyHTTP) - if l > 0 { - n += 2 + l + sovStructs(uint64(l)) - } - l = len(m.ProxyGRPC) - if l > 0 { - n += 2 + l + sovStructs(uint64(l)) - } - if m.OutputMaxSize != 0 { - n += 2 + sovStructs(uint64(m.OutputMaxSize)) - } - l = len(m.Body) - if l > 0 { - n += 2 + l + sovStructs(uint64(l)) - } - return n -} - -func (m *MeshGatewayConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Mode) - if l > 0 { - n += 1 + l + sovStructs(uint64(l)) - } - return n -} - -func sovStructs(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozStructs(x uint64) (n int) { - return sovStructs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Node) 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 ErrIntOverflowStructs - } - 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: Node: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Node: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = github_com_hashicorp_consul_types.NodeID(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 ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Node = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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 ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Datacenter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaggedAddresses", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaggedAddresses == nil { - m.TaggedAddresses = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthStructs - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthStructs - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthStructs - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthStructs - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.TaggedAddresses[mapkey] = mapvalue - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Meta == nil { - m.Meta = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthStructs - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthStructs - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthStructs - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthStructs - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Meta[mapkey] = mapvalue - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftIndex", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.RaftIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ServiceDefinition) 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 ErrIntOverflowStructs - } - 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: ServiceDefinition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceDefinition: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = github_com_hashicorp_consul_agent_structs.ServiceKind(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tags = append(m.Tags, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Meta == nil { - m.Meta = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthStructs - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthStructs - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthStructs - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthStructs - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Meta[mapkey] = mapvalue - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - m.Port = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Port |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Check", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Check.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Checks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Checks = append(m.Checks, &CheckType{}) - if err := m.Checks[len(m.Checks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Weights", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Weights == nil { - m.Weights = &Weights{} - } - if err := m.Weights.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Token = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EnableTagOverride", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EnableTagOverride = bool(v != 0) - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proxy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Proxy == nil { - m.Proxy = &ConnectProxyConfig{} - } - if err := m.Proxy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Connect", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Connect == nil { - m.Connect = &ServiceConnect{} - } - if err := m.Connect.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaggedAddresses", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaggedAddresses == nil { - m.TaggedAddresses = make(map[string]*ServiceAddress) - } - var mapkey string - var mapvalue *ServiceAddress - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthStructs - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthStructs - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthStructs - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthStructs - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &ServiceAddress{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.TaggedAddresses[mapkey] = mapvalue - iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EnterpriseMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.EnterpriseMeta == nil { - m.EnterpriseMeta = &pbcommon.EnterpriseMeta{} - } - if err := m.EnterpriseMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ServiceAddress) 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 ErrIntOverflowStructs - } - 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: ServiceAddress: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceAddress: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - m.Port = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Port |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HealthCheck) 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 ErrIntOverflowStructs - } - 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: HealthCheck: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HealthCheck: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Node = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CheckID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CheckID = github_com_hashicorp_consul_types.CheckID(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Status = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Notes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Notes = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Output", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Output = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceTags", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceTags = append(m.ServiceTags, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Definition", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Definition.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftIndex", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.RaftIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EnterpriseMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.EnterpriseMeta == nil { - m.EnterpriseMeta = &pbcommon.EnterpriseMeta{} - } - if err := m.EnterpriseMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HeaderValue) 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 ErrIntOverflowStructs - } - 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: HeaderValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HeaderValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HealthCheckDefinition) 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 ErrIntOverflowStructs - } - 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: HealthCheckDefinition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HealthCheckDefinition: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HTTP", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HTTP = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TLSSkipVerify", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.TLSSkipVerify = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = make(map[string]HeaderValue) - } - var mapkey string - mapvalue := &HeaderValue{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthStructs - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthStructs - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthStructs - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthStructs - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &HeaderValue{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Header[mapkey] = *mapvalue - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Method = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TCP", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TCP = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Interval, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Timeout, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeregisterCriticalServiceAfter", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.DeregisterCriticalServiceAfter, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OutputMaxSize", wireType) - } - m.OutputMaxSize = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.OutputMaxSize |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ScriptArgs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ScriptArgs = append(m.ScriptArgs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DockerContainerID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DockerContainerID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shell", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Shell = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GRPC", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GRPC = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GRPCUseTLS", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.GRPCUseTLS = bool(v != 0) - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AliasNode", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AliasNode = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AliasService", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AliasService = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.TTL, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 18: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Body = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CheckServiceNode) 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 ErrIntOverflowStructs - } - 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: CheckServiceNode: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CheckServiceNode: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Node == nil { - m.Node = &Node{} - } - if err := m.Node.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Service == nil { - m.Service = &NodeService{} - } - if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Checks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Checks = append(m.Checks, &HealthCheck{}) - if err := m.Checks[len(m.Checks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NodeService) 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 ErrIntOverflowStructs - } - 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: NodeService: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodeService: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = github_com_hashicorp_consul_agent_structs.ServiceKind(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Service = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tags = append(m.Tags, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Meta == nil { - m.Meta = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthStructs - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthStructs - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthStructs - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthStructs - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Meta[mapkey] = mapvalue - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - m.Port = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Port |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Weights", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Weights == nil { - m.Weights = &Weights{} - } - if err := m.Weights.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EnableTagOverride", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EnableTagOverride = bool(v != 0) - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proxy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Proxy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Connect", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Connect.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LocallyRegisteredAsSidecar", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.LocallyRegisteredAsSidecar = bool(v != 0) - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftIndex", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.RaftIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaggedAddresses", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaggedAddresses == nil { - m.TaggedAddresses = make(map[string]*ServiceAddress) - } - var mapkey string - var mapvalue *ServiceAddress - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthStructs - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthStructs - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthStructs - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthStructs - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &ServiceAddress{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.TaggedAddresses[mapkey] = mapvalue - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EnterpriseMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.EnterpriseMeta == nil { - m.EnterpriseMeta = &pbcommon.EnterpriseMeta{} - } - if err := m.EnterpriseMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConnectProxyConfig) 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 ErrIntOverflowStructs - } - 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: ConnectProxyConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConnectProxyConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationServiceName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DestinationServiceName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationServiceID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DestinationServiceID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LocalServiceAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LocalServiceAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LocalServicePort", wireType) - } - m.LocalServicePort = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LocalServicePort |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - 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 ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Config == nil { - m.Config = &types.Struct{} - } - if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Upstreams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Upstreams = append(m.Upstreams, Upstream{}) - if err := m.Upstreams[len(m.Upstreams)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MeshGateway", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MeshGateway == nil { - m.MeshGateway = &MeshGatewayConfig{} - } - if err := m.MeshGateway.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Expose", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Expose == nil { - m.Expose = &ExposeConfig{} - } - if err := m.Expose.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Upstream) 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 ErrIntOverflowStructs - } - 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: Upstream: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Upstream: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DestinationType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationNamespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DestinationNamespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DestinationName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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 ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Datacenter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LocalBindAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LocalBindAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LocalBindPort", wireType) - } - m.LocalBindPort = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LocalBindPort |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - 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 ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Config == nil { - m.Config = &types.Struct{} - } - if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MeshGateway", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MeshGateway == nil { - m.MeshGateway = &MeshGatewayConfig{} - } - if err := m.MeshGateway.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ServiceConnect) 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 ErrIntOverflowStructs - } - 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: ServiceConnect: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceConnect: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Native", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Native = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SidecarService", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SidecarService == nil { - m.SidecarService = &ServiceDefinition{} - } - if err := m.SidecarService.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Weights) 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 ErrIntOverflowStructs - } - 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: Weights: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Weights: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Passing", wireType) - } - m.Passing = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Passing |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Warning", wireType) - } - m.Warning = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Warning |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ExposeConfig) 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 ErrIntOverflowStructs - } - 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: ExposeConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ExposeConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Checks", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Checks = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Paths", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Paths = append(m.Paths, &ExposePath{}) - if err := m.Paths[len(m.Paths)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ExposePath) 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 ErrIntOverflowStructs - } - 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: ExposePath: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ExposePath: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ListenerPort", wireType) - } - m.ListenerPort = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ListenerPort |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Path = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LocalPathPort", wireType) - } - m.LocalPathPort = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LocalPathPort |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Protocol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ParsedFromCheck", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ParsedFromCheck = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CheckType) 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 ErrIntOverflowStructs - } - 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: CheckType: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CheckType: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CheckID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CheckID = github_com_hashicorp_consul_types.CheckID(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Status = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Notes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Notes = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ScriptArgs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ScriptArgs = append(m.ScriptArgs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HTTP", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HTTP = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Method = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TCP", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TCP = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Interval, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AliasNode", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AliasNode = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AliasService", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AliasService = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DockerContainerID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DockerContainerID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shell", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Shell = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GRPC", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GRPC = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GRPCUseTLS", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.GRPCUseTLS = bool(v != 0) - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TLSSkipVerify", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.TLSSkipVerify = bool(v != 0) - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Timeout, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 18: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.TTL, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 19: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeregisterCriticalServiceAfter", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.DeregisterCriticalServiceAfter, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 20: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStructs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = make(map[string]HeaderValue) - } - var mapkey string - mapvalue := &HeaderValue{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthStructs - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthStructs - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthStructs - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthStructs - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &HeaderValue{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Header[mapkey] = *mapvalue - iNdEx = postIndex - case 21: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SuccessBeforePassing", wireType) - } - m.SuccessBeforePassing = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SuccessBeforePassing |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 22: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FailuresBeforeCritical", wireType) - } - m.FailuresBeforeCritical = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FailuresBeforeCritical |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 23: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProxyHTTP", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProxyHTTP = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 24: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProxyGRPC", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProxyGRPC = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 25: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OutputMaxSize", wireType) - } - m.OutputMaxSize = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.OutputMaxSize |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 26: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Body = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MeshGatewayConfig) 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 ErrIntOverflowStructs - } - 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: MeshGatewayConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MeshGatewayConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStructs - } - 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 ErrInvalidLengthStructs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStructs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Mode = github_com_hashicorp_consul_agent_structs.MeshGatewayMode(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStructs(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStructs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipStructs(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, ErrIntOverflowStructs - } - 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, ErrIntOverflowStructs - } - 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, ErrIntOverflowStructs - } - 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, ErrInvalidLengthStructs - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthStructs - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStructs - } - 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 := skipStructs(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthStructs - } - } - 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 ( - ErrInvalidLengthStructs = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStructs = fmt.Errorf("proto: integer overflow") -) diff --git a/proto/pbservice/structs.proto b/proto/pbservice/structs.proto deleted file mode 100644 index 22b8ae5e98..0000000000 --- a/proto/pbservice/structs.proto +++ /dev/null @@ -1,403 +0,0 @@ -syntax = "proto3"; - -package pbservice; - -option go_package = "github.com/hashicorp/consul/proto/pbservice"; - -import "google/protobuf/duration.proto"; -import "google/protobuf/struct.proto"; -import "proto/pbcommon/common.proto"; -import "proto/pbcommon/common_oss.proto"; - -// Go Modules now includes the version in the filepath for packages within GOPATH/pkg/mode -// Therefore unless we want to hardcode a version here like -// github.com/gogo/protobuf@v1.3.0/gogoproto/gogo.proto then the only other choice is to -// have a more relative import and pass the right import path to protoc. I don't like it -// but its necessary. -import "gogoproto/gogo.proto"; - -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.goproto_sizecache_all) = false; - -// Used to return information about a node -message Node { - string ID = 1 - [(gogoproto.casttype) = "github.com/hashicorp/consul/types.NodeID"]; - - string Node = 2; - string Address = 3; - string Datacenter = 4; - map TaggedAddresses = 5; - map Meta = 6; - - common.RaftIndex RaftIndex = 7 - [(gogoproto.embed) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "bexpr:\"-\""]; -} - -// ServiceDefinition is used to JSON decode the Service definitions. For -// documentation on specific fields see NodeService which is better documented. -message ServiceDefinition { - string Kind = 1 [(gogoproto.casttype) = - "github.com/hashicorp/consul/agent/structs.ServiceKind"]; - string ID = 2; - string Name = 3; - repeated string Tags = 4; - string Address = 5; - map TaggedAddresses = 16; - map Meta = 6; - int32 Port = 7 [(gogoproto.casttype) = "int"]; - CheckType Check = 8 [(gogoproto.nullable) = false]; - repeated CheckType Checks = 9; - Weights Weights = 10; - string Token = 11; - bool EnableTagOverride = 12; - - // Proxy is the configuration set for Kind = connect-proxy. It is mandatory in - // that case and an error to be set for any other kind. This config is part of - // a proxy service definition and is distinct from but shares some fields with - // the Connect.Proxy which configures a managed proxy as part of the actual - // service's definition. This duplication is ugly but seemed better than the - // alternative which was to re-use the same struct fields for both cases even - // though the semantics are different and the non-shared fields make no sense - // in the other case. ProxyConfig may be a more natural name here, but it's - // confusing for the UX because one of the fields in ConnectProxyConfig is - // also called just "Config" - ConnectProxyConfig Proxy = 14; - - common.EnterpriseMeta EnterpriseMeta = 17; - - ServiceConnect Connect = 15; -} - -// Type to hold an address and port of a service -message ServiceAddress { - string Address = 1; - int32 Port = 2 [(gogoproto.casttype) = "int"]; -} - -// HealthCheck represents a single check on a given node -message HealthCheck { - string Node = 1; - string CheckID = 2 - [(gogoproto.casttype) = - "github.com/hashicorp/consul/types.CheckID"]; // Unique per-node ID - string Name = 3; // Check name - string Status = 4; // The current check status - string Notes = 5; // Additional notes with the status - string Output = 6; // Holds output of script runs - string ServiceID = 7; // optional associated service - string ServiceName = 8; // optional service name - repeated string ServiceTags = 9; // optional service tags - string Type = 12; // Check type: http/ttl/tcp/etc - - HealthCheckDefinition Definition = 10 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "bexpr:\"-\""]; - - common.EnterpriseMeta EnterpriseMeta = 13; - - common.RaftIndex RaftIndex = 11 - [(gogoproto.embed) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "bexpr:\"-\""]; -} - -message HeaderValue { - repeated string Value = 1; -} - -message HealthCheckDefinition { - string HTTP = 1 [(gogoproto.jsontag) = ",omitempty"]; - bool TLSSkipVerify = 2 [(gogoproto.jsontag) = ",omitempty"]; - map Header = 3 [(gogoproto.nullable) = false]; - string Method = 4 [(gogoproto.jsontag) = ",omitempty"]; - string Body = 18 [(gogoproto.jsontag) = ",omitempty"]; - string TCP = 5 [(gogoproto.jsontag) = ",omitempty"]; - google.protobuf.Duration Interval = 6 - [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; - uint32 OutputMaxSize = 9; - google.protobuf.Duration Timeout = 7 - [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; - google.protobuf.Duration DeregisterCriticalServiceAfter = 8 - [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; - repeated string ScriptArgs = 10; - string DockerContainerID = 11; - string Shell = 12; - string GRPC = 13; - bool GRPCUseTLS = 14; - string AliasNode = 15; - string AliasService = 16; - google.protobuf.Duration TTL = 17 - [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; -} - -// CheckServiceNode is used to provide the node, its service -// definition, as well as a HealthCheck that is associated. -message CheckServiceNode { - Node Node = 1; - NodeService Service = 2; - repeated HealthCheck Checks = 3; -} - -// NodeService is a service provided by a node -message NodeService { - // Kind is the kind of service this is. Different kinds of services may - // have differing validation, DNS behavior, etc. An empty kind will default - // to the Default kind. See ServiceKind for the full list of kinds. - string Kind = 1 [ - (gogoproto.casttype) = - "github.com/hashicorp/consul/agent/structs.ServiceKind", - (gogoproto.jsontag) = ",omitempty" - ]; - - string ID = 2; - string Service = 3; - repeated string Tags = 4; - string Address = 5; - map TaggedAddresses = 15; - map Meta = 6; - int32 Port = 7 [(gogoproto.casttype) = "int"]; - Weights Weights = 8; - bool EnableTagOverride = 9; - - // Proxy is the configuration set for Kind = connect-proxy. It is mandatory in - // that case and an error to be set for any other kind. This config is part of - // a proxy service definition and is distinct from but shares some fields with - // the Connect.Proxy which configures a managed proxy as part of the actual - // service's definition. This duplication is ugly but seemed better than the - // alternative which was to re-use the same struct fields for both cases even - // though the semantics are different and the non-shred fields make no sense - // in the other case. ProxyConfig may be a more natural name here, but it's - // confusing for the UX because one of the fields in ConnectProxyConfig is - // also called just "Config" - ConnectProxyConfig Proxy = 11 [(gogoproto.nullable) = false]; - - // Connect are the Connect settings for a service. This is purposely NOT - // a pointer so that we never have to nil-check this. - ServiceConnect Connect = 12 [(gogoproto.nullable) = false]; - - // LocallyRegisteredAsSidecar is private as it is only used by a local agent - // state to track if the service was registered from a nested sidecar_service - // block. We need to track that so we can know whether we need to deregister - // it automatically too if it's removed from the service definition or if the - // parent service is deregistered. Relying only on ID would cause us to - // deregister regular services if they happen to be registered using the same - // ID scheme as our sidecars do by default. We could use meta but that gets - // unpleasant because we can't use the consul- prefix from an agent (reserved - // for use internally but in practice that means within the state store or in - // responses only), and it leaks the detail publicly which people might rely - // on which is a bit unpleasant for something that is meant to be config-file - // syntax sugar. Note this is not translated to ServiceNode and friends and - // may not be set on a NodeService that isn't the one the agent registered and - // keeps in it's local state. We never want this rendered in JSON as it's - // internal only. Right now our agent endpoints return api structs which don't - // include it but this is a safety net incase we change that or there is - // somewhere this is used in API output. - bool LocallyRegisteredAsSidecar = 13 [(gogoproto.moretags) = "bexpr:\"-\""]; - - common.EnterpriseMeta EnterpriseMeta = 16; - - common.RaftIndex RaftIndex = 14 - [(gogoproto.embed) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "bexpr:\"-\""]; -} - -// ConnectProxyConfig describes the configuration needed for any proxy managed -// or unmanaged. It describes a single logical service's listener and optionally -// upstreams and sidecar-related config for a single instance. To describe a -// centralized proxy that routed traffic for multiple services, a different one -// of these would be needed for each, sharing the same LogicalProxyID. -message ConnectProxyConfig { - // DestinationServiceName is required and is the name of the service to accept - // traffic for. - string DestinationServiceName = 1; - - // DestinationServiceID is optional and should only be specified for - // "side-car" style proxies where the proxy is in front of just a single - // instance of the service. It should be set to the service ID of the instance - // being represented which must be registered to the same agent. It's valid to - // provide a service ID that does not yet exist to avoid timing issues when - // bootstrapping a service with a proxy. - string DestinationServiceID = 2; - - // LocalServiceAddress is the address of the local service instance. It is - // optional and should only be specified for "side-car" style proxies. It will - // default to 127.0.0.1 if the proxy is a "side-car" (DestinationServiceID is - // set) but otherwise will be ignored. - string LocalServiceAddress = 3; - - // LocalServicePort is the port of the local service instance. It is optional - // and should only be specified for "side-car" style proxies. It will default - // to the registered port for the instance if the proxy is a "side-car" - // (DestinationServiceID is set) but otherwise will be ignored. - int32 LocalServicePort = 4 [(gogoproto.casttype) = "int"]; - - // Config is the arbitrary configuration data provided with the proxy - // registration. - google.protobuf.Struct Config = 5 - [(gogoproto.nullable) = true, (gogoproto.moretags) = "bexpr:\"-\""]; - - // Upstreams describes any upstream dependencies the proxy instance should - // setup. - repeated Upstream Upstreams = 6 [(gogoproto.nullable) = false]; - - // MeshGateway defines the mesh gateway configuration for this upstream - MeshGatewayConfig MeshGateway = 7; - - // Expose defines whether checks or paths are exposed through the proxy - ExposeConfig Expose = 8; -} - -// Upstream represents a single upstream dependency for a service or proxy. It -// describes the mechanism used to discover instances to communicate with (the -// Target) as well as any potential client configuration that may be useful such -// as load balancer options, timeouts etc. -message Upstream { - // Destination fields are the required ones for determining what this upstream - // points to. Depending on DestinationType some other fields below might - // further restrict the set of instances allowable. - // - // DestinationType would be better as an int constant but even with custom - // JSON marshallers it causes havoc with all the mapstructure mangling we do - // on service definitions in various places. - string DestinationType = 1; - string DestinationNamespace = 2; - string DestinationName = 3; - - // Datacenter that the service discovery request should be run against. Note - // for prepared queries, the actual results might be from a different - // datacenter. - string Datacenter = 4; - - // LocalBindAddress is the ip address a side-car proxy should listen on for - // traffic destined for this upstream service. Default if empty is 127.0.0.1. - string LocalBindAddress = 5; - - // LocalBindPort is the ip address a side-car proxy should listen on for - // traffic - // destined for this upstream service. Required. - int32 LocalBindPort = 6 [(gogoproto.casttype) = "int"]; - - // Config is an opaque config that is specific to the proxy process being run. - // It can be used to pass arbitrary configuration for this specific upstream - // to the proxy. - google.protobuf.Struct Config = 7 - [(gogoproto.nullable) = true, (gogoproto.moretags) = "bexpr:\"-\""]; - - // MeshGateway is the configuration for mesh gateway usage of this upstream - MeshGatewayConfig MeshGateway = 8; -} - -// ServiceConnect are the shared Connect settings between all service -// definitions from the agent to the state store. -message ServiceConnect { - // Native is true when this service can natively understand Connect. - bool Native = 1; - - // SidecarService is a nested Service Definition to register at the same time. - // It's purely a convenience mechanism to allow specifying a sidecar service - // along with the application service definition. It's nested nature allows - // all of the fields to be defaulted which can reduce the amount of - // boilerplate needed to register a sidecar service separately, but the end - // result is identical to just making a second service registration via any - // other means. - ServiceDefinition SidecarService = 3 [(gogoproto.moretags) = "bexpr:\"-\""]; -} - -// Weights represent the weight used by DNS for a given status -message Weights { - int32 Passing = 1 [(gogoproto.casttype) = "int"]; - int32 Warning = 2 [(gogoproto.casttype) = "int"]; -} - -// ExposeConfig describes HTTP paths to expose through Envoy outside of Connect. -// Users can expose individual paths and/or all HTTP/GRPC paths for checks. -message ExposeConfig { - // Checks defines whether paths associated with Consul checks will be exposed. - // This flag triggers exposing all HTTP and GRPC check paths registered for the service. - bool Checks = 1; - - // Paths is the list of paths exposed through the proxy. - repeated ExposePath Paths = 2; -} - -message ExposePath { - // ListenerPort defines the port of the proxy's listener for exposed paths. - int32 ListenerPort = 1; - - // ExposePath is the path to expose through the proxy, ie. "/metrics." - string Path = 2; - - // LocalPathPort is the port that the service is listening on for the given path. - int32 LocalPathPort = 3; - - // Protocol describes the upstream's service protocol. - // Valid values are "http" and "http2", defaults to "http" - string Protocol = 4; - - // ParsedFromCheck is set if this path was parsed from a registered check - bool ParsedFromCheck = 5; -} - -// CheckType is used to create either the CheckMonitor or the CheckTTL. -// The following types are supported: Script, HTTP, TCP, Docker, TTL, GRPC, -// Alias. Script, -// HTTP, Docker, TCP and GRPC all require Interval. Only one of the types may -// to be provided: TTL or Script/Interval or HTTP/Interval or TCP/Interval or -// Docker/Interval or GRPC/Interval or AliasService. -message CheckType { - // fields already embedded in CheckDefinition - // Note: CheckType.CheckID == CheckDefinition.ID - - string CheckID = 1 [ - (gogoproto.casttype) = "github.com/hashicorp/consul/types.CheckID", - (gogoproto.jsontag) = "" - ]; - string Name = 2; - string Status = 3; - string Notes = 4; - - // fields copied to CheckDefinition - // Update CheckDefinition when adding fields here - - repeated string ScriptArgs = 5; - string HTTP = 6; - map Header = 20 - [(gogoproto.nullable) = false]; - string Method = 7; - string Body = 26; - string TCP = 8; - google.protobuf.Duration Interval = 9 - [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; - - string AliasNode = 10; - string AliasService = 11; - string DockerContainerID = 12; - string Shell = 13; - string GRPC = 14; - bool GRPCUseTLS = 15; - bool TLSSkipVerify = 16; - google.protobuf.Duration Timeout = 17 - [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; - google.protobuf.Duration TTL = 18 - [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; - - int32 SuccessBeforePassing = 21; - int32 FailuresBeforeCritical = 22; - - // Definition fields used when exposing checks through a proxy - string ProxyHTTP = 23; - string ProxyGRPC = 24; - - // DeregisterCriticalServiceAfter, if >0, will cause the associated - // service, if any, to be deregistered if this check is critical for - // longer than this duration. - google.protobuf.Duration DeregisterCriticalServiceAfter = 19 - [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; - - int32 OutputMaxSize = 25; -} - -message MeshGatewayConfig { - string Mode = 1 [ - (gogoproto.casttype) = - "github.com/hashicorp/consul/agent/structs.MeshGatewayMode" ]; -} \ No newline at end of file diff --git a/proto/pbsubscribe/subscribe.pb.go b/proto/pbsubscribe/subscribe.pb.go index ad2dc0b2cb..435307f987 100644 --- a/proto/pbsubscribe/subscribe.pb.go +++ b/proto/pbsubscribe/subscribe.pb.go @@ -546,40 +546,40 @@ func init() { func init() { proto.RegisterFile("proto/pbsubscribe/subscribe.proto", fileDescriptor_ab3eb8c810e315fb) } var fileDescriptor_ab3eb8c810e315fb = []byte{ - // 525 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xf6, 0x26, 0x4d, 0xd2, 0x4c, 0x68, 0x65, 0x96, 0x20, 0xac, 0x56, 0x58, 0x21, 0x42, 0x95, - 0xa9, 0x44, 0x5c, 0x05, 0x09, 0x6e, 0x20, 0x92, 0x06, 0x82, 0x90, 0x08, 0x72, 0xe8, 0x01, 0x6e, - 0x1b, 0x67, 0x88, 0xad, 0xa4, 0xbb, 0x8b, 0xbd, 0x29, 0xe4, 0xce, 0x43, 0xf4, 0x65, 0xb8, 0x73, - 0xe4, 0x11, 0x50, 0x78, 0x11, 0x94, 0xb5, 0xeb, 0x3a, 0x49, 0x6f, 0xbd, 0x79, 0xbe, 0x9f, 0x9d, - 0x4f, 0x33, 0x1e, 0x78, 0x24, 0x23, 0xa1, 0x84, 0x2b, 0x47, 0xf1, 0x7c, 0x14, 0xfb, 0x51, 0x38, - 0x42, 0x37, 0xfb, 0x6a, 0x69, 0x8e, 0x56, 0x33, 0xe0, 0xe0, 0x61, 0xa6, 0xc6, 0xe8, 0x22, 0xf4, - 0xd1, 0x8d, 0x55, 0x34, 0xf7, 0x55, 0x9c, 0x28, 0x9b, 0x97, 0x04, 0xcc, 0xe1, 0x95, 0xd8, 0xc3, - 0x6f, 0x73, 0x8c, 0x15, 0x3d, 0x82, 0xd2, 0x27, 0x21, 0x43, 0xdf, 0x22, 0x0d, 0xe2, 0xec, 0xb7, - 0xcd, 0xd6, 0xf5, 0xfb, 0x1a, 0xf7, 0x12, 0x9a, 0x9a, 0x50, 0x7c, 0x8f, 0x0b, 0xab, 0xd0, 0x20, - 0x4e, 0xd5, 0x5b, 0x7d, 0xd2, 0xfa, 0xca, 0x39, 0x45, 0x6e, 0x15, 0x35, 0x96, 0x14, 0x2b, 0xf4, - 0x1d, 0x1f, 0xe3, 0x0f, 0x6b, 0xa7, 0x41, 0x9c, 0x1d, 0x2f, 0x29, 0xa8, 0x0d, 0x70, 0xca, 0x14, - 0xf3, 0x91, 0x2b, 0x8c, 0xac, 0x92, 0x36, 0xe4, 0x90, 0xe6, 0xaf, 0x02, 0x94, 0x7a, 0x17, 0xc8, - 0x6f, 0x99, 0x27, 0xe9, 0x5c, 0xcc, 0x77, 0x3e, 0x82, 0xbd, 0x1e, 0x1f, 0x0f, 0xbe, 0x0e, 0x39, - 0x93, 0x71, 0x20, 0x94, 0x6e, 0xbe, 0xdb, 0x37, 0xbc, 0x75, 0x98, 0x9e, 0x00, 0xd5, 0x40, 0xef, - 0x5c, 0xaa, 0x45, 0x26, 0x2e, 0xa7, 0xe2, 0x1b, 0x38, 0xfa, 0x02, 0x40, 0x47, 0xee, 0x30, 0xe5, - 0x07, 0x56, 0xa5, 0x41, 0x9c, 0x5a, 0xfb, 0x7e, 0x2e, 0xee, 0x35, 0xd9, 0x37, 0xbc, 0x9c, 0x94, - 0xbe, 0x81, 0xbd, 0x61, 0xb2, 0xa0, 0x3e, 0xb2, 0x99, 0x0a, 0x2c, 0xd0, 0x5e, 0x3b, 0xe7, 0x5d, - 0xe3, 0xcf, 0xe4, 0x98, 0x29, 0x5c, 0x45, 0x5e, 0x83, 0x3b, 0x55, 0xa8, 0x7c, 0x64, 0x8b, 0x99, - 0x60, 0xe3, 0xe6, 0xf3, 0x7c, 0x16, 0xea, 0x40, 0x59, 0x57, 0xb1, 0x45, 0x1a, 0x45, 0xa7, 0xb6, - 0x36, 0x44, 0x4d, 0x78, 0x29, 0xdf, 0xfc, 0x49, 0xe0, 0xde, 0x0d, 0xbd, 0xe8, 0x63, 0x28, 0x0c, - 0x64, 0xba, 0x82, 0x7a, 0xce, 0xdd, 0x65, 0x8a, 0xcd, 0xc4, 0x64, 0x20, 0xbd, 0xc2, 0x40, 0xd2, - 0xb7, 0x60, 0x76, 0x03, 0xf4, 0xa7, 0xe9, 0x0b, 0x1f, 0xc4, 0x18, 0xf5, 0x42, 0x6a, 0xed, 0xc3, - 0x56, 0xf6, 0x13, 0xb6, 0x36, 0x25, 0xde, 0x96, 0xe9, 0xf8, 0x75, 0xba, 0x74, 0x5a, 0x83, 0xca, - 0x19, 0x9f, 0x72, 0xf1, 0x9d, 0x9b, 0x06, 0xbd, 0xbb, 0x31, 0x27, 0x93, 0x50, 0x0b, 0xea, 0x6b, - 0x50, 0x57, 0x70, 0x8e, 0xbe, 0x32, 0x0b, 0xc7, 0x4f, 0xa0, 0x9a, 0x85, 0xa3, 0x77, 0x60, 0xd7, - 0xc3, 0x49, 0x18, 0x2b, 0x8c, 0x4c, 0x83, 0xee, 0x03, 0x9c, 0x62, 0x74, 0x55, 0x93, 0xf6, 0x67, - 0x78, 0x30, 0x54, 0x4c, 0x61, 0x37, 0x60, 0x7c, 0x82, 0xe9, 0x45, 0x48, 0x15, 0x0a, 0x4e, 0x5f, - 0x42, 0x35, 0xbb, 0x10, 0x7a, 0x98, 0x5f, 0xc8, 0xc6, 0xdd, 0x1c, 0x6c, 0xcd, 0xb4, 0x69, 0x9c, - 0x90, 0xce, 0xab, 0xdf, 0x4b, 0x9b, 0xfc, 0x59, 0xda, 0xe4, 0xef, 0xd2, 0x26, 0x97, 0xff, 0x6c, - 0xe3, 0xcb, 0xd3, 0x49, 0xa8, 0x82, 0xf9, 0xa8, 0xe5, 0x8b, 0x73, 0x37, 0x60, 0x71, 0x10, 0xfa, - 0x22, 0x92, 0xae, 0x2f, 0x78, 0x3c, 0x9f, 0xb9, 0x5b, 0xd7, 0x3d, 0x2a, 0x6b, 0xe8, 0xd9, 0xff, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0x75, 0x46, 0x39, 0xf9, 0x03, 0x00, 0x00, + // 521 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0x4f, 0x8f, 0xd2, 0x40, + 0x14, 0xef, 0xc0, 0x02, 0xcb, 0xc3, 0xdd, 0xd4, 0x11, 0x63, 0xc3, 0x26, 0x0d, 0x12, 0xb3, 0xa9, + 0x9b, 0x48, 0x37, 0x98, 0xe8, 0x4d, 0x23, 0x2c, 0x8a, 0x31, 0x11, 0x53, 0xdc, 0x83, 0xde, 0x86, + 0xf6, 0x49, 0x1b, 0xd8, 0x99, 0xb1, 0x1d, 0x56, 0xb9, 0xfb, 0x21, 0xf6, 0xcb, 0x78, 0xf7, 0xe8, + 0x47, 0x30, 0xf8, 0x45, 0x0c, 0x43, 0xb7, 0x5b, 0x60, 0x6f, 0xde, 0xfa, 0x7e, 0x7f, 0xe6, 0xfd, + 0xf2, 0x5e, 0x1f, 0x3c, 0x94, 0xb1, 0x50, 0xc2, 0x95, 0xe3, 0x64, 0x3e, 0x4e, 0xfc, 0x38, 0x1a, + 0xa3, 0x9b, 0x7d, 0xb5, 0x35, 0x47, 0xab, 0x19, 0xd0, 0x68, 0x64, 0x6a, 0x8c, 0x2f, 0x23, 0x1f, + 0x5d, 0x2e, 0x82, 0x54, 0xd6, 0xba, 0x22, 0x60, 0x8e, 0xae, 0x95, 0x1e, 0x7e, 0x9d, 0x63, 0xa2, + 0xe8, 0x31, 0x94, 0x3e, 0x0a, 0x19, 0xf9, 0x16, 0x69, 0x12, 0xe7, 0xb0, 0x63, 0xb6, 0x6f, 0x1e, + 0xd7, 0xb8, 0xb7, 0xa6, 0xa9, 0x09, 0xc5, 0x77, 0xb8, 0xb0, 0x0a, 0x4d, 0xe2, 0x54, 0xbd, 0xd5, + 0x27, 0xad, 0xaf, 0x9c, 0x53, 0xe4, 0x56, 0x51, 0x63, 0xeb, 0x62, 0x85, 0xbe, 0xe5, 0x01, 0x7e, + 0xb7, 0xf6, 0x9a, 0xc4, 0xd9, 0xf3, 0xd6, 0x05, 0xb5, 0x01, 0xce, 0x98, 0x62, 0x3e, 0x72, 0x85, + 0xb1, 0x55, 0xd2, 0x86, 0x1c, 0xd2, 0xfa, 0x59, 0x80, 0x52, 0xff, 0x12, 0xf9, 0x7f, 0xe6, 0x59, + 0x77, 0x2e, 0xe6, 0x3b, 0x1f, 0xc3, 0x41, 0x9f, 0x07, 0xc3, 0x2f, 0x23, 0xce, 0x64, 0x12, 0x0a, + 0xa5, 0x9b, 0xef, 0x0f, 0x0c, 0x6f, 0x13, 0xa6, 0xa7, 0x40, 0x35, 0xd0, 0xbf, 0x90, 0x6a, 0x91, + 0x89, 0xcb, 0xa9, 0xf8, 0x16, 0x8e, 0x3e, 0x07, 0xd0, 0x91, 0xbb, 0x4c, 0xf9, 0xa1, 0x55, 0x69, + 0x12, 0xa7, 0xd6, 0xb9, 0x9f, 0x8b, 0x7b, 0x43, 0x0e, 0x0c, 0x2f, 0x27, 0xa5, 0xaf, 0xe1, 0x60, + 0xb4, 0xde, 0xce, 0x00, 0xd9, 0x4c, 0x85, 0x16, 0x68, 0xaf, 0x9d, 0xf3, 0x6e, 0xf0, 0xe7, 0x32, + 0x60, 0x0a, 0x57, 0x91, 0x37, 0xe0, 0x6e, 0x15, 0x2a, 0x1f, 0xd8, 0x62, 0x26, 0x58, 0xd0, 0x7a, + 0x96, 0xcf, 0x42, 0x1d, 0x28, 0xeb, 0x2a, 0xb1, 0x48, 0xb3, 0xe8, 0xd4, 0x36, 0x86, 0xa8, 0x09, + 0x2f, 0xe5, 0x5b, 0x3f, 0x08, 0xdc, 0xbb, 0xa5, 0x17, 0x7d, 0x04, 0x85, 0xa1, 0x4c, 0x57, 0x50, + 0xcf, 0xb9, 0x7b, 0x4c, 0xb1, 0x99, 0x98, 0x0c, 0xa5, 0x57, 0x18, 0x4a, 0xfa, 0x06, 0xcc, 0x5e, + 0x88, 0xfe, 0x34, 0x7d, 0xe1, 0xbd, 0x08, 0x50, 0x2f, 0xa4, 0xd6, 0x39, 0x6a, 0x67, 0x7f, 0x60, + 0x7b, 0x5b, 0xe2, 0xed, 0x98, 0x4e, 0x5e, 0xa5, 0x4b, 0xa7, 0x35, 0xa8, 0x9c, 0xf3, 0x29, 0x17, + 0xdf, 0xb8, 0x69, 0xd0, 0xbb, 0x5b, 0x73, 0x32, 0x09, 0xb5, 0xa0, 0xbe, 0x01, 0xf5, 0x04, 0xe7, + 0xe8, 0x2b, 0xb3, 0x70, 0xf2, 0x18, 0xaa, 0x59, 0x38, 0x7a, 0x07, 0xf6, 0x3d, 0x9c, 0x44, 0x89, + 0xc2, 0xd8, 0x34, 0xe8, 0x21, 0xc0, 0x19, 0xc6, 0xd7, 0x35, 0xe9, 0x7c, 0x82, 0x07, 0x23, 0xc5, + 0x14, 0xf6, 0x42, 0xc6, 0x27, 0x98, 0x5e, 0x84, 0x54, 0x91, 0xe0, 0xf4, 0x05, 0x54, 0xb3, 0x0b, + 0xa1, 0x47, 0xf9, 0x85, 0x6c, 0xdd, 0x4d, 0x63, 0x67, 0xa6, 0x2d, 0xe3, 0x94, 0x74, 0x5f, 0xfe, + 0x5a, 0xda, 0xe4, 0xf7, 0xd2, 0x26, 0x7f, 0x96, 0x36, 0xb9, 0xfa, 0x6b, 0x1b, 0x9f, 0x9f, 0x4c, + 0x22, 0x15, 0xce, 0xc7, 0x6d, 0x5f, 0x5c, 0xb8, 0x21, 0x4b, 0xc2, 0xc8, 0x17, 0xb1, 0x74, 0x7d, + 0xc1, 0x93, 0xf9, 0xcc, 0xdd, 0x39, 0xed, 0x71, 0x59, 0x43, 0x4f, 0xff, 0x05, 0x00, 0x00, 0xff, + 0xff, 0x7d, 0xf7, 0xca, 0x01, 0xf6, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/proto/pbsubscribe/subscribe.proto b/proto/pbsubscribe/subscribe.proto index 4b213587ec..82e3a1d30f 100644 --- a/proto/pbsubscribe/subscribe.proto +++ b/proto/pbsubscribe/subscribe.proto @@ -7,7 +7,7 @@ package subscribe; option go_package = "github.com/hashicorp/consul/proto/pbsubscribe"; -import "proto/pbservice/structs.proto"; +import "proto/pbservice/node.proto"; // StateChangeSubscription service allows consumers to subscribe to topics of // state change events. Events are streamed as they happen.