diff --git a/agent/grpc/private/resolver/registry.go b/agent/grpc/private/resolver/registry.go index d305b607d..14c93af2d 100644 --- a/agent/grpc/private/resolver/registry.go +++ b/agent/grpc/private/resolver/registry.go @@ -16,7 +16,7 @@ type registry struct { byAuthority map[string]*ServerResolverBuilder } -func (r *registry) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOption) (resolver.Resolver, error) { +func (r *registry) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { r.lock.RLock() defer r.lock.RUnlock() res, ok := r.byAuthority[target.Authority] diff --git a/agent/grpc/private/resolver/resolver.go b/agent/grpc/private/resolver/resolver.go index e77ee568d..c0c3b8938 100644 --- a/agent/grpc/private/resolver/resolver.go +++ b/agent/grpc/private/resolver/resolver.go @@ -85,7 +85,7 @@ func (s *ServerResolverBuilder) ServerForGlobalAddr(globalAddr string) (*metadat // Build returns a new serverResolver for the given ClientConn. The resolver // will keep the ClientConn's state updated based on updates from Serf. -func (s *ServerResolverBuilder) Build(target resolver.Target, cc resolver.ClientConn, _ resolver.BuildOption) (resolver.Resolver, error) { +func (s *ServerResolverBuilder) Build(target resolver.Target, cc resolver.ClientConn, _ resolver.BuildOptions) (resolver.Resolver, error) { s.lock.Lock() defer s.lock.Unlock() @@ -221,7 +221,6 @@ func (s *ServerResolverBuilder) getDCAddrs(dc string) []resolver.Address { addrs = append(addrs, resolver.Address{ // NOTE: the address persisted here is only dialable using our custom dialer Addr: DCPrefix(server.Datacenter, server.Addr.String()), - Type: resolver.Backend, ServerName: server.Name, }) } @@ -294,14 +293,14 @@ func (r *serverResolver) Close() { } // ResolveNow is not used -func (*serverResolver) ResolveNow(resolver.ResolveNowOption) {} +func (*serverResolver) ResolveNow(options resolver.ResolveNowOptions) {} type leaderResolver struct { globalAddr string clientConn resolver.ClientConn } -func (l leaderResolver) ResolveNow(resolver.ResolveNowOption) {} +func (l leaderResolver) ResolveNow(resolver.ResolveNowOptions) {} func (l leaderResolver) Close() {} @@ -313,7 +312,6 @@ func (l leaderResolver) updateClientConn() { { // NOTE: the address persisted here is only dialable using our custom dialer Addr: l.globalAddr, - Type: resolver.Backend, ServerName: "leader", }, } diff --git a/agent/grpc/private/services/subscribe/subscribe_test.go b/agent/grpc/private/services/subscribe/subscribe_test.go index a084b6f55..0a52c0f49 100644 --- a/agent/grpc/private/services/subscribe/subscribe_test.go +++ b/agent/grpc/private/services/subscribe/subscribe_test.go @@ -3,6 +3,8 @@ package subscribe import ( "context" "errors" + "github.com/golang/protobuf/ptypes/duration" + "github.com/hashicorp/consul/proto/pbcommon" "io" "net" "testing" @@ -154,12 +156,14 @@ func TestServer_Subscribe_IntegrationWithBackend(t *testing.T) { Port: 8080, Weights: &pbservice.Weights{Passing: 1, Warning: 1}, // Sad empty state - Proxy: pbservice.ConnectProxyConfig{ - MeshGateway: pbservice.MeshGatewayConfig{}, - Expose: pbservice.ExposeConfig{}, + Proxy: &pbservice.ConnectProxyConfig{ + MeshGateway: &pbservice.MeshGatewayConfig{}, + Expose: &pbservice.ExposeConfig{}, + TransparentProxy: &pbservice.TransparentProxyConfig{}, }, + Connect: &pbservice.ServiceConnect{}, RaftIndex: raftIndex(ids, "reg2", "reg2"), - EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, + EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, }, }, }, @@ -185,12 +189,14 @@ func TestServer_Subscribe_IntegrationWithBackend(t *testing.T) { Port: 8080, Weights: &pbservice.Weights{Passing: 1, Warning: 1}, // Sad empty state - Proxy: pbservice.ConnectProxyConfig{ - MeshGateway: pbservice.MeshGatewayConfig{}, - Expose: pbservice.ExposeConfig{}, + Proxy: &pbservice.ConnectProxyConfig{ + MeshGateway: &pbservice.MeshGatewayConfig{}, + Expose: &pbservice.ExposeConfig{}, + TransparentProxy: &pbservice.TransparentProxyConfig{}, }, + Connect: &pbservice.ServiceConnect{}, RaftIndex: raftIndex(ids, "reg3", "reg3"), - EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, + EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, }, }, }, @@ -235,12 +241,14 @@ func TestServer_Subscribe_IntegrationWithBackend(t *testing.T) { Port: 8080, Weights: &pbservice.Weights{Passing: 1, Warning: 1}, // Sad empty state - Proxy: pbservice.ConnectProxyConfig{ - MeshGateway: pbservice.MeshGatewayConfig{}, - Expose: pbservice.ExposeConfig{}, + Proxy: &pbservice.ConnectProxyConfig{ + MeshGateway: &pbservice.MeshGatewayConfig{}, + Expose: &pbservice.ExposeConfig{}, + TransparentProxy: &pbservice.TransparentProxyConfig{}, }, + Connect: &pbservice.ServiceConnect{}, RaftIndex: raftIndex(ids, "reg3", "reg3"), - EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, + EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, }, Checks: []*pbservice.HealthCheck{ { @@ -251,7 +259,13 @@ func TestServer_Subscribe_IntegrationWithBackend(t *testing.T) { ServiceID: "redis1", ServiceName: "redis", RaftIndex: raftIndex(ids, "update", "update"), - EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, + EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, + Definition: &pbservice.HealthCheckDefinition{ + Interval: &duration.Duration{}, + Timeout: &duration.Duration{}, + DeregisterCriticalServiceAfter: &duration.Duration{}, + TTL: &duration.Duration{}, + }, }, }, }, @@ -395,8 +409,8 @@ func newCounter() *counter { return &counter{labels: make(map[string]uint64)} } -func raftIndex(ids *counter, created, modified string) pbcommongogo.RaftIndex { - return pbcommongogo.RaftIndex{ +func raftIndex(ids *counter, created, modified string) *pbcommon.RaftIndex { + return &pbcommon.RaftIndex{ CreateIndex: ids.For(created), ModifyIndex: ids.For(modified), } @@ -507,11 +521,13 @@ func TestServer_Subscribe_IntegrationWithBackend_ForwardToDC(t *testing.T) { Port: 8080, Weights: &pbservice.Weights{Passing: 1, Warning: 1}, // Sad empty state - Proxy: pbservice.ConnectProxyConfig{ - MeshGateway: pbservice.MeshGatewayConfig{}, - Expose: pbservice.ExposeConfig{}, + Proxy: &pbservice.ConnectProxyConfig{ + MeshGateway: &pbservice.MeshGatewayConfig{}, + Expose: &pbservice.ExposeConfig{}, + TransparentProxy: &pbservice.TransparentProxyConfig{}, }, - EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, + Connect: &pbservice.ServiceConnect{}, + EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, RaftIndex: raftIndex(ids, "reg2", "reg2"), }, }, @@ -538,11 +554,13 @@ func TestServer_Subscribe_IntegrationWithBackend_ForwardToDC(t *testing.T) { Port: 8080, Weights: &pbservice.Weights{Passing: 1, Warning: 1}, // Sad empty state - Proxy: pbservice.ConnectProxyConfig{ - MeshGateway: pbservice.MeshGatewayConfig{}, - Expose: pbservice.ExposeConfig{}, + Proxy: &pbservice.ConnectProxyConfig{ + MeshGateway: &pbservice.MeshGatewayConfig{}, + Expose: &pbservice.ExposeConfig{}, + TransparentProxy: &pbservice.TransparentProxyConfig{}, }, - EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, + Connect: &pbservice.ServiceConnect{}, + EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, RaftIndex: raftIndex(ids, "reg3", "reg3"), }, }, @@ -589,11 +607,13 @@ func TestServer_Subscribe_IntegrationWithBackend_ForwardToDC(t *testing.T) { RaftIndex: raftIndex(ids, "reg3", "reg3"), Weights: &pbservice.Weights{Passing: 1, Warning: 1}, // Sad empty state - Proxy: pbservice.ConnectProxyConfig{ - MeshGateway: pbservice.MeshGatewayConfig{}, - Expose: pbservice.ExposeConfig{}, + Proxy: &pbservice.ConnectProxyConfig{ + MeshGateway: &pbservice.MeshGatewayConfig{}, + Expose: &pbservice.ExposeConfig{}, + TransparentProxy: &pbservice.TransparentProxyConfig{}, }, - EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, + Connect: &pbservice.ServiceConnect{}, + EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, }, Checks: []*pbservice.HealthCheck{ { @@ -604,7 +624,13 @@ func TestServer_Subscribe_IntegrationWithBackend_ForwardToDC(t *testing.T) { ServiceID: "redis1", ServiceName: "redis", RaftIndex: raftIndex(ids, "update", "update"), - EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, + EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, + Definition: &pbservice.HealthCheckDefinition{ + Interval: &duration.Duration{}, + Timeout: &duration.Duration{}, + DeregisterCriticalServiceAfter: &duration.Duration{}, + TTL: &duration.Duration{}, + }, }, }, }, @@ -986,8 +1012,18 @@ func TestNewEventFromSteamEvent(t *testing.T) { ServiceHealth: &pbsubscribe.ServiceHealthUpdate{ Op: pbsubscribe.CatalogOp_Register, CheckServiceNode: &pbservice.CheckServiceNode{ - Node: &pbservice.Node{Node: "node1"}, - Service: &pbservice.NodeService{Service: "web1"}, + Node: &pbservice.Node{Node: "node1", RaftIndex: &pbcommon.RaftIndex{}}, + Service: &pbservice.NodeService{ + Service: "web1", + Proxy: &pbservice.ConnectProxyConfig{ + MeshGateway: &pbservice.MeshGatewayConfig{}, + Expose: &pbservice.ExposeConfig{}, + TransparentProxy: &pbservice.TransparentProxyConfig{}, + }, + Connect: &pbservice.ServiceConnect{}, + EnterpriseMeta: &pbcommon.EnterpriseMeta{}, + RaftIndex: &pbcommon.RaftIndex{}, + }, }, }, }, @@ -998,8 +1034,18 @@ func TestNewEventFromSteamEvent(t *testing.T) { ServiceHealth: &pbsubscribe.ServiceHealthUpdate{ Op: pbsubscribe.CatalogOp_Deregister, CheckServiceNode: &pbservice.CheckServiceNode{ - Node: &pbservice.Node{Node: "node2"}, - Service: &pbservice.NodeService{Service: "web1"}, + Node: &pbservice.Node{Node: "node2", RaftIndex: &pbcommon.RaftIndex{}}, + Service: &pbservice.NodeService{ + Service: "web1", + Proxy: &pbservice.ConnectProxyConfig{ + MeshGateway: &pbservice.MeshGatewayConfig{}, + Expose: &pbservice.ExposeConfig{}, + TransparentProxy: &pbservice.TransparentProxyConfig{}, + }, + Connect: &pbservice.ServiceConnect{}, + EnterpriseMeta: &pbcommon.EnterpriseMeta{}, + RaftIndex: &pbcommon.RaftIndex{}, + }, }, }, }, @@ -1027,8 +1073,18 @@ func TestNewEventFromSteamEvent(t *testing.T) { ServiceHealth: &pbsubscribe.ServiceHealthUpdate{ Op: pbsubscribe.CatalogOp_Register, CheckServiceNode: &pbservice.CheckServiceNode{ - Node: &pbservice.Node{Node: "node1"}, - Service: &pbservice.NodeService{Service: "web1"}, + Node: &pbservice.Node{Node: "node1", RaftIndex: &pbcommon.RaftIndex{}}, + Service: &pbservice.NodeService{ + Service: "web1", + Proxy: &pbservice.ConnectProxyConfig{ + MeshGateway: &pbservice.MeshGatewayConfig{}, + Expose: &pbservice.ExposeConfig{}, + TransparentProxy: &pbservice.TransparentProxyConfig{}, + }, + Connect: &pbservice.ServiceConnect{}, + EnterpriseMeta: &pbcommon.EnterpriseMeta{}, + RaftIndex: &pbcommon.RaftIndex{}, + }, }, }, }, diff --git a/agent/rpcclient/health/view_test.go b/agent/rpcclient/health/view_test.go index bc5795c05..9dc00150f 100644 --- a/agent/rpcclient/health/view_test.go +++ b/agent/rpcclient/health/view_test.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "github.com/hashicorp/consul/proto/pbcommon" "strings" "testing" "time" @@ -568,11 +569,11 @@ func newEventServiceHealthRegister(index uint64, nodeNum int, svc string) *pbsub Op: pbsubscribe.CatalogOp_Register, CheckServiceNode: &pbservice.CheckServiceNode{ Node: &pbservice.Node{ - ID: nodeID, + ID: string(nodeID), Node: node, Address: addr, Datacenter: "dc1", - RaftIndex: pbcommongogo.RaftIndex{ + RaftIndex: &pbcommon.RaftIndex{ CreateIndex: index, ModifyIndex: index, }, @@ -581,7 +582,7 @@ func newEventServiceHealthRegister(index uint64, nodeNum int, svc string) *pbsub ID: svc, Service: svc, Port: 8080, - RaftIndex: pbcommongogo.RaftIndex{ + RaftIndex: &pbcommon.RaftIndex{ CreateIndex: index, ModifyIndex: index, }, @@ -612,7 +613,7 @@ func newEventServiceHealthDeregister(index uint64, nodeNum int, svc string) *pbs Passing: 1, Warning: 1, }, - RaftIndex: pbcommongogo.RaftIndex{ + RaftIndex: &pbcommon.RaftIndex{ // The original insertion index since a delete doesn't update // this. This magic value came from state store tests where we // setup at index 10 and then mutate at index 100. It can be diff --git a/agent/submatview/streaming_test.go b/agent/submatview/streaming_test.go index be484cac6..764cd47dc 100644 --- a/agent/submatview/streaming_test.go +++ b/agent/submatview/streaming_test.go @@ -3,11 +3,11 @@ package submatview import ( "context" "fmt" + "github.com/hashicorp/consul/proto/pbcommon" "sync" "google.golang.org/grpc" - "github.com/hashicorp/consul/proto/pbcommongogo" "github.com/hashicorp/consul/proto/pbservice" "github.com/hashicorp/consul/proto/pbsubscribe" "github.com/hashicorp/consul/types" @@ -116,11 +116,11 @@ func newEventServiceHealthRegister(index uint64, nodeNum int, svc string) *pbsub Op: pbsubscribe.CatalogOp_Register, CheckServiceNode: &pbservice.CheckServiceNode{ Node: &pbservice.Node{ - ID: nodeID, + ID: string(nodeID), Node: node, Address: addr, Datacenter: "dc1", - RaftIndex: pbcommongogo.RaftIndex{ + RaftIndex: &pbcommon.RaftIndex{ CreateIndex: index, ModifyIndex: index, }, @@ -129,7 +129,7 @@ func newEventServiceHealthRegister(index uint64, nodeNum int, svc string) *pbsub ID: svc, Service: svc, Port: 8080, - RaftIndex: pbcommongogo.RaftIndex{ + RaftIndex: &pbcommon.RaftIndex{ CreateIndex: index, ModifyIndex: index, }, @@ -160,7 +160,7 @@ func newEventServiceHealthDeregister(index uint64, nodeNum int, svc string) *pbs Passing: 1, Warning: 1, }, - RaftIndex: pbcommongogo.RaftIndex{ + RaftIndex: &pbcommon.RaftIndex{ // The original insertion index since a delete doesn't update // this. This magic value came from state store tests where we // setup at index 10 and then mutate at index 100. It can be diff --git a/build-support/scripts/proto-gen-entry.sh b/build-support/scripts/proto-gen-entry.sh index 4deb2bf29..639f725cc 100644 --- a/build-support/scripts/proto-gen-entry.sh +++ b/build-support/scripts/proto-gen-entry.sh @@ -14,6 +14,12 @@ elif [[ "$FILENAME" =~ .*pbconfig/.* ]]; then elif [[ "$FILENAME" =~ .*pbautoconf/.* ]]; then echo "$FILENAME no gogo" ./build-support/scripts/proto-gen-no-gogo.sh $1 $2 $3 +elif [[ "$FILENAME" =~ .*pbservice/.* ]]; then + echo "$FILENAME no gogo" + ./build-support/scripts/proto-gen-no-gogo.sh $1 $2 $3 +elif [[ "$FILENAME" =~ .*pbsubscribe/.* ]]; then + echo "$FILENAME no gogo" + ./build-support/scripts/proto-gen-no-gogo.sh $1 $2 $3 else echo "$FILENAME gogo" ./build-support/scripts/proto-gen.sh $1 $2 $3 diff --git a/go.mod b/go.mod index 17fe9d28d..628a30202 100644 --- a/go.mod +++ b/go.mod @@ -94,7 +94,7 @@ require ( google.golang.org/api v0.9.0 // indirect google.golang.org/appengine v1.6.0 // indirect google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 - google.golang.org/grpc v1.25.1 + google.golang.org/grpc v1.27.1 gopkg.in/square/go-jose.v2 v2.5.1 gotest.tools/v3 v3.0.3 k8s.io/api v0.18.2 diff --git a/go.sum b/go.sum index 085684975..688dd2b8f 100644 --- a/go.sum +++ b/go.sum @@ -130,6 +130,7 @@ github.com/elazarl/go-bindata-assetfs v0.0.0-20160803192304-e1a2a7ec64b0/go.mod github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.5 h1:lRJIqDD8yjV1YyPRqecMdytjDLs2fTXq363aCib5xPU= github.com/envoyproxy/go-control-plane v0.9.5/go.mod h1:OXl5to++W0ctG+EHWTFUjiypVxC/Y4VLc/KFU+al13s= github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= @@ -714,8 +715,9 @@ google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiq google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/proto/pbcommon/common_oss.go b/proto/pbcommon/common_oss.go index e96c1a4b3..2dc2026e8 100644 --- a/proto/pbcommon/common_oss.go +++ b/proto/pbcommon/common_oss.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/consul/agent/structs" ) -var DefaultEnterpriseMeta = EnterpriseMeta{} +var DefaultEnterpriseMeta = &EnterpriseMeta{} func NewEnterpriseMetaFromStructs(_ structs.EnterpriseMeta) *EnterpriseMeta { return &EnterpriseMeta{} diff --git a/proto/pbservice/convert.go b/proto/pbservice/convert.go index a68c22b8f..c981d1cb3 100644 --- a/proto/pbservice/convert.go +++ b/proto/pbservice/convert.go @@ -2,24 +2,28 @@ package pbservice import ( "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/proto/pbcommongogo" + "github.com/hashicorp/consul/proto/pbcommon" + "github.com/hashicorp/consul/types" ) -func RaftIndexToStructs(s pbcommongogo.RaftIndex) structs.RaftIndex { +type CheckIDType = types.CheckID +type NodeIDType = types.NodeID + +func RaftIndexToStructs(s *pbcommon.RaftIndex) structs.RaftIndex { return structs.RaftIndex{ CreateIndex: s.CreateIndex, ModifyIndex: s.ModifyIndex, } } -func NewRaftIndexFromStructs(s structs.RaftIndex) pbcommongogo.RaftIndex { - return pbcommongogo.RaftIndex{ +func NewRaftIndexFromStructs(s structs.RaftIndex) *pbcommon.RaftIndex { + return &pbcommon.RaftIndex{ CreateIndex: s.CreateIndex, ModifyIndex: s.ModifyIndex, } } -func MapHeadersToStructs(s map[string]HeaderValue) map[string][]string { +func MapHeadersToStructs(s map[string]*HeaderValue) map[string][]string { t := make(map[string][]string, len(s)) for k, v := range s { t[k] = v.Value @@ -27,10 +31,10 @@ func MapHeadersToStructs(s map[string]HeaderValue) map[string][]string { return t } -func NewMapHeadersFromStructs(t map[string][]string) map[string]HeaderValue { - s := make(map[string]HeaderValue, len(t)) +func NewMapHeadersFromStructs(t map[string][]string) map[string]*HeaderValue { + s := make(map[string]*HeaderValue, len(t)) for k, v := range t { - s[k] = HeaderValue{Value: v} + s[k] = &HeaderValue{Value: v} } return s } @@ -42,23 +46,23 @@ func CheckServiceNodeToStructs(s *CheckServiceNode) (*structs.CheckServiceNode, } var t structs.CheckServiceNode if s.Node != nil { - n := NodeToStructs(*s.Node) - t.Node = &n + n := new(structs.Node) + NodeToStructs(s.Node, n) + t.Node = n } if s.Service != nil { - r := NodeServiceToStructs(*s.Service) - t.Service = &r + r := new(structs.NodeService) + NodeServiceToStructs(s.Service, r) + t.Service = r } t.Checks = make(structs.HealthChecks, len(s.Checks)) for i, c := range s.Checks { if c == nil { continue } - h, err := HealthCheckToStructs(*c) - if err != nil { - return &t, err - } - t.Checks[i] = &h + h := new(structs.HealthCheck) + HealthCheckToStructs(c, h) + t.Checks[i] = h } return &t, nil } @@ -70,20 +74,23 @@ func NewCheckServiceNodeFromStructs(t *structs.CheckServiceNode) *CheckServiceNo } var s CheckServiceNode if t.Node != nil { - n := NewNodeFromStructs(*t.Node) - s.Node = &n + n := new(Node) + NodeFromStructs(t.Node, n) + s.Node = n } if t.Service != nil { - r := NewNodeServiceFromStructs(*t.Service) - s.Service = &r + r := new(NodeService) + NodeServiceFromStructs(t.Service, r) + s.Service = r } s.Checks = make([]*HealthCheck, len(t.Checks)) for i, c := range t.Checks { if c == nil { continue } - h := NewHealthCheckFromStructs(*c) - s.Checks[i] = &h + h := new(HealthCheck) + HealthCheckFromStructs(c, h) + s.Checks[i] = h } return &s } @@ -111,7 +118,7 @@ func NewWeightsPtrFromStructs(t *structs.Weights) *Weights { } // TODO: handle this with mog -func MapStringServiceAddressToStructs(s map[string]ServiceAddress) map[string]structs.ServiceAddress { +func MapStringServiceAddressToStructs(s map[string]*ServiceAddress) map[string]structs.ServiceAddress { t := make(map[string]structs.ServiceAddress, len(s)) for k, v := range s { t[k] = structs.ServiceAddress{Address: v.Address, Port: int(v.Port)} @@ -120,64 +127,70 @@ func MapStringServiceAddressToStructs(s map[string]ServiceAddress) map[string]st } // TODO: handle this with mog -func NewMapStringServiceAddressFromStructs(t map[string]structs.ServiceAddress) map[string]ServiceAddress { - s := make(map[string]ServiceAddress, len(t)) +func NewMapStringServiceAddressFromStructs(t map[string]structs.ServiceAddress) map[string]*ServiceAddress { + s := make(map[string]*ServiceAddress, len(t)) for k, v := range t { - s[k] = ServiceAddress{Address: v.Address, Port: int32(v.Port)} + s[k] = &ServiceAddress{Address: v.Address, Port: int32(v.Port)} } return s } // TODO: handle this with mog -func ExposePathSliceToStructs(s []ExposePath) []structs.ExposePath { +func ExposePathSliceToStructs(s []*ExposePath) []structs.ExposePath { t := make([]structs.ExposePath, len(s)) for i, v := range s { - t[i] = ExposePathToStructs(v) + e := new(structs.ExposePath) + ExposePathToStructs(v, e) + t[i] = *e } return t } // TODO: handle this with mog -func NewExposePathSliceFromStructs(t []structs.ExposePath) []ExposePath { - s := make([]ExposePath, len(t)) +func NewExposePathSliceFromStructs(t []structs.ExposePath) []*ExposePath { + s := make([]*ExposePath, len(t)) for i, v := range t { - s[i] = NewExposePathFromStructs(v) + ep := new(ExposePath) + ExposePathFromStructs(&v, ep) + s[i] = ep } return s } // TODO: handle this with mog -func UpstreamsToStructs(s []Upstream) structs.Upstreams { +func UpstreamsToStructs(s []*Upstream) structs.Upstreams { t := make(structs.Upstreams, len(s)) for i, v := range s { - t[i] = UpstreamToStructs(v) + u := new(structs.Upstream) + UpstreamToStructs(v, u) + t[i] = *u } return t } // TODO: handle this with mog -func NewUpstreamsFromStructs(t structs.Upstreams) []Upstream { - s := make([]Upstream, len(t)) +func NewUpstreamsFromStructs(t structs.Upstreams) []*Upstream { + s := make([]*Upstream, len(t)) for i, v := range t { - s[i] = NewUpstreamFromStructs(v) + u := new(Upstream) + UpstreamFromStructs(&v, u) + s[i] = u } return s } // TODO: handle this with mog -func CheckTypesToStructs(s []*CheckType) (structs.CheckTypes, error) { +func CheckTypesToStructs(s []*CheckType) structs.CheckTypes { t := make(structs.CheckTypes, len(s)) for i, v := range s { if v == nil { continue } - newV, err := CheckTypeToStructs(*v) - if err != nil { - return t, err - } - t[i] = &newV + c := new(structs.CheckType) + CheckTypeToStructs(v, c) + t[i] = c } - return t, nil + return t } // TODO: handle this with mog @@ -187,8 +200,9 @@ func NewCheckTypesFromStructs(t structs.CheckTypes) []*CheckType { if v == nil { continue } - newV := NewCheckTypeFromStructs(*v) - s[i] = &newV + newV := new(CheckType) + CheckTypeFromStructs(v, newV) + s[i] = newV } return s } @@ -198,8 +212,9 @@ func ConnectProxyConfigPtrToStructs(s *ConnectProxyConfig) *structs.ConnectProxy if s == nil { return nil } - t := ConnectProxyConfigToStructs(*s) - return &t + c := new(structs.ConnectProxyConfig) + ConnectProxyConfigToStructs(s, c) + return c } // TODO: handle this with mog @@ -207,8 +222,9 @@ func NewConnectProxyConfigPtrFromStructs(t *structs.ConnectProxyConfig) *Connect if t == nil { return nil } - s := NewConnectProxyConfigFromStructs(*t) - return &s + cp := new(ConnectProxyConfig) + ConnectProxyConfigFromStructs(t, cp) + return cp } // TODO: handle this with mog @@ -216,8 +232,9 @@ func ServiceConnectPtrToStructs(s *ServiceConnect) *structs.ServiceConnect { if s == nil { return nil } - t := ServiceConnectToStructs(*s) - return &t + sc := new(structs.ServiceConnect) + ServiceConnectToStructs(s, sc) + return sc } // TODO: handle this with mog @@ -225,8 +242,9 @@ func NewServiceConnectPtrFromStructs(t *structs.ServiceConnect) *ServiceConnect if t == nil { return nil } - s := NewServiceConnectFromStructs(*t) - return &s + sc := new(ServiceConnect) + ServiceConnectFromStructs(t, sc) + return sc } // TODO: handle this with mog @@ -234,11 +252,9 @@ func ServiceDefinitionPtrToStructs(s *ServiceDefinition) *structs.ServiceDefinit if s == nil { return nil } - t, err := ServiceDefinitionToStructs(*s) - if err != nil { - return nil - } - return &t + sd := new(structs.ServiceDefinition) + ServiceDefinitionToStructs(s, sd) + return sd } // TODO: handle this with mog @@ -246,6 +262,7 @@ func NewServiceDefinitionPtrFromStructs(t *structs.ServiceDefinition) *ServiceDe if t == nil { return nil } - s := NewServiceDefinitionFromStructs(*t) - return &s + sd := new(ServiceDefinition) + ServiceDefinitionFromStructs(t, sd) + return sd } diff --git a/proto/pbservice/convert_oss.go b/proto/pbservice/convert_oss.go index 214cf69ad..4efb78bef 100644 --- a/proto/pbservice/convert_oss.go +++ b/proto/pbservice/convert_oss.go @@ -5,13 +5,13 @@ package pbservice import ( "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/proto/pbcommongogo" + "github.com/hashicorp/consul/proto/pbcommon" ) -func EnterpriseMetaToStructs(_ pbcommongogo.EnterpriseMeta) structs.EnterpriseMeta { +func EnterpriseMetaToStructs(_ *pbcommon.EnterpriseMeta) structs.EnterpriseMeta { return structs.EnterpriseMeta{} } -func NewEnterpriseMetaFromStructs(_ structs.EnterpriseMeta) pbcommongogo.EnterpriseMeta { - return pbcommongogo.EnterpriseMeta{} +func NewEnterpriseMetaFromStructs(_ structs.EnterpriseMeta) *pbcommon.EnterpriseMeta { + return &pbcommon.EnterpriseMeta{} } diff --git a/proto/pbservice/convert_pbstruct.go b/proto/pbservice/convert_pbstruct.go index dbb0ea5a1..1a09d81ef 100644 --- a/proto/pbservice/convert_pbstruct.go +++ b/proto/pbservice/convert_pbstruct.go @@ -4,7 +4,8 @@ import ( fmt "fmt" "reflect" - types "github.com/gogo/protobuf/types" + //TODO(gogo-remove): remove the types alias + types "github.com/golang/protobuf/ptypes/struct" ) // ProtobufTypesStructToMapStringInterface converts a protobuf/types.Struct into a diff --git a/proto/pbservice/healthcheck.gen.go b/proto/pbservice/healthcheck.gen.go index 345b13719..6bdb63b4b 100644 --- a/proto/pbservice/healthcheck.gen.go +++ b/proto/pbservice/healthcheck.gen.go @@ -2,14 +2,13 @@ package pbservice -import ( - "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/proto/pbutil" -) +import "github.com/hashicorp/consul/agent/structs" -func CheckTypeToStructs(s CheckType) (structs.CheckType, error) { - var t structs.CheckType - t.CheckID = s.CheckID +func CheckTypeToStructs(s *CheckType, t *structs.CheckType) { + if s == nil { + return + } + t.CheckID = CheckIDType(s.CheckID) t.Name = s.Name t.Status = s.Status t.Notes = s.Notes @@ -21,12 +20,7 @@ func CheckTypeToStructs(s CheckType) (structs.CheckType, error) { t.Method = s.Method t.Body = s.Body t.TCP = s.TCP - interval, err := pbutil.DurationFromProto(&s.Interval) - if err != nil { - return t, err - } - t.Interval = interval - + t.Interval = structs.DurationFromProto(s.Interval) t.AliasNode = s.AliasNode t.AliasService = s.AliasService t.DockerContainerID = s.DockerContainerID @@ -35,32 +29,21 @@ func CheckTypeToStructs(s CheckType) (structs.CheckType, error) { t.GRPCUseTLS = s.GRPCUseTLS t.TLSServerName = s.TLSServerName t.TLSSkipVerify = s.TLSSkipVerify - timeout, err := pbutil.DurationFromProto(&s.Timeout) - if err != nil { - return t, err - } - t.Timeout = timeout - ttl, err := pbutil.DurationFromProto(&s.TTL) - if err != nil { - return t, err - } - t.TTL = ttl + t.Timeout = structs.DurationFromProto(s.Timeout) + t.TTL = structs.DurationFromProto(s.TTL) t.SuccessBeforePassing = int(s.SuccessBeforePassing) - t.FailuresBeforeCritical = int(s.FailuresBeforeCritical) t.FailuresBeforeWarning = int(s.FailuresBeforeWarning) + t.FailuresBeforeCritical = int(s.FailuresBeforeCritical) t.ProxyHTTP = s.ProxyHTTP t.ProxyGRPC = s.ProxyGRPC - deregisterCriticalServiceAfter, err := pbutil.DurationFromProto(&s.DeregisterCriticalServiceAfter) - if err != nil { - return t, err - } - t.DeregisterCriticalServiceAfter = deregisterCriticalServiceAfter + t.DeregisterCriticalServiceAfter = structs.DurationFromProto(s.DeregisterCriticalServiceAfter) t.OutputMaxSize = int(s.OutputMaxSize) - return t, nil } -func NewCheckTypeFromStructs(t structs.CheckType) CheckType { - var s CheckType - s.CheckID = t.CheckID +func CheckTypeFromStructs(t *structs.CheckType, s *CheckType) { + if s == nil { + return + } + s.CheckID = string(t.CheckID) s.Name = t.Name s.Status = t.Status s.Notes = t.Notes @@ -72,7 +55,7 @@ func NewCheckTypeFromStructs(t structs.CheckType) CheckType { s.Method = t.Method s.Body = t.Body s.TCP = t.TCP - s.Interval = *pbutil.DurationToProto(t.Interval) + s.Interval = structs.DurationToProto(t.Interval) s.AliasNode = t.AliasNode s.AliasService = t.AliasService s.DockerContainerID = t.DockerContainerID @@ -81,21 +64,22 @@ func NewCheckTypeFromStructs(t structs.CheckType) CheckType { s.GRPCUseTLS = t.GRPCUseTLS s.TLSServerName = t.TLSServerName s.TLSSkipVerify = t.TLSSkipVerify - s.Timeout = *pbutil.DurationToProto(t.Timeout) - s.TTL = *pbutil.DurationToProto(t.TTL) + s.Timeout = structs.DurationToProto(t.Timeout) + s.TTL = structs.DurationToProto(t.TTL) s.SuccessBeforePassing = int32(t.SuccessBeforePassing) - s.FailuresBeforeCritical = int32(t.FailuresBeforeCritical) s.FailuresBeforeWarning = int32(t.FailuresBeforeWarning) + s.FailuresBeforeCritical = int32(t.FailuresBeforeCritical) s.ProxyHTTP = t.ProxyHTTP s.ProxyGRPC = t.ProxyGRPC - s.DeregisterCriticalServiceAfter = *pbutil.DurationToProto(t.DeregisterCriticalServiceAfter) + s.DeregisterCriticalServiceAfter = structs.DurationToProto(t.DeregisterCriticalServiceAfter) s.OutputMaxSize = int32(t.OutputMaxSize) - return s } -func HealthCheckToStructs(s HealthCheck) (structs.HealthCheck, error) { - var t structs.HealthCheck +func HealthCheckToStructs(s *HealthCheck, t *structs.HealthCheck) { + if s == nil { + return + } t.Node = s.Node - t.CheckID = s.CheckID + t.CheckID = CheckIDType(s.CheckID) t.Name = s.Name t.Status = s.Status t.Notes = s.Notes @@ -104,22 +88,21 @@ func HealthCheckToStructs(s HealthCheck) (structs.HealthCheck, error) { t.ServiceName = s.ServiceName t.ServiceTags = s.ServiceTags t.Type = s.Type - t.ExposedPort = int(s.ExposedPort) - definition, err := HealthCheckDefinitionToStructs(s.Definition) - if err != nil { - return t, err - } - t.Definition = definition - t.EnterpriseMeta = EnterpriseMetaToStructs(s.EnterpriseMeta) - t.RaftIndex = RaftIndexToStructs(s.RaftIndex) t.Interval = s.Interval t.Timeout = s.Timeout - return t, nil + t.ExposedPort = int(s.ExposedPort) + if s.Definition != nil { + HealthCheckDefinitionToStructs(s.Definition, &t.Definition) + } + t.EnterpriseMeta = EnterpriseMetaToStructs(s.EnterpriseMeta) + t.RaftIndex = RaftIndexToStructs(s.RaftIndex) } -func NewHealthCheckFromStructs(t structs.HealthCheck) HealthCheck { - var s HealthCheck +func HealthCheckFromStructs(t *structs.HealthCheck, s *HealthCheck) { + if s == nil { + return + } s.Node = t.Node - s.CheckID = t.CheckID + s.CheckID = string(t.CheckID) s.Name = t.Name s.Status = t.Status s.Notes = t.Notes @@ -128,16 +111,21 @@ func NewHealthCheckFromStructs(t structs.HealthCheck) HealthCheck { s.ServiceName = t.ServiceName s.ServiceTags = t.ServiceTags s.Type = t.Type - s.ExposedPort = int32(t.ExposedPort) - s.Definition = NewHealthCheckDefinitionFromStructs(t.Definition) - s.EnterpriseMeta = NewEnterpriseMetaFromStructs(t.EnterpriseMeta) - s.RaftIndex = NewRaftIndexFromStructs(t.RaftIndex) s.Interval = t.Interval s.Timeout = t.Timeout - return s + s.ExposedPort = int32(t.ExposedPort) + { + var x HealthCheckDefinition + HealthCheckDefinitionFromStructs(&t.Definition, &x) + s.Definition = &x + } + s.EnterpriseMeta = NewEnterpriseMetaFromStructs(t.EnterpriseMeta) + s.RaftIndex = NewRaftIndexFromStructs(t.RaftIndex) } -func HealthCheckDefinitionToStructs(s HealthCheckDefinition) (structs.HealthCheckDefinition, error) { - var t structs.HealthCheckDefinition +func HealthCheckDefinitionToStructs(s *HealthCheckDefinition, t *structs.HealthCheckDefinition) { + if s == nil { + return + } t.HTTP = s.HTTP t.TLSServerName = s.TLSServerName t.TLSSkipVerify = s.TLSSkipVerify @@ -147,22 +135,10 @@ func HealthCheckDefinitionToStructs(s HealthCheckDefinition) (structs.HealthChec t.TCP = s.TCP t.H2PING = s.H2PING t.H2PingUseTLS = s.H2PingUseTLS - interval, err := pbutil.DurationFromProto(&s.Interval) - if err != nil { - return t, err - } - t.Interval = interval + t.Interval = structs.DurationFromProto(s.Interval) t.OutputMaxSize = uint(s.OutputMaxSize) - timeout, err := pbutil.DurationFromProto(&s.Timeout) - if err != nil { - return t, err - } - t.Timeout = timeout - deregisterCriticalServiceAfter, err := pbutil.DurationFromProto(&s.DeregisterCriticalServiceAfter) - if err != nil { - return t, err - } - t.DeregisterCriticalServiceAfter = deregisterCriticalServiceAfter + t.Timeout = structs.DurationFromProto(s.Timeout) + t.DeregisterCriticalServiceAfter = structs.DurationFromProto(s.DeregisterCriticalServiceAfter) t.ScriptArgs = s.ScriptArgs t.DockerContainerID = s.DockerContainerID t.Shell = s.Shell @@ -170,15 +146,12 @@ func HealthCheckDefinitionToStructs(s HealthCheckDefinition) (structs.HealthChec t.GRPCUseTLS = s.GRPCUseTLS t.AliasNode = s.AliasNode t.AliasService = s.AliasService - ttl, err := pbutil.DurationFromProto(&s.TTL) - if err != nil { - return t, err - } - t.TTL = ttl - return t, nil + t.TTL = structs.DurationFromProto(s.TTL) } -func NewHealthCheckDefinitionFromStructs(t structs.HealthCheckDefinition) HealthCheckDefinition { - var s HealthCheckDefinition +func HealthCheckDefinitionFromStructs(t *structs.HealthCheckDefinition, s *HealthCheckDefinition) { + if s == nil { + return + } s.HTTP = t.HTTP s.TLSServerName = t.TLSServerName s.TLSSkipVerify = t.TLSSkipVerify @@ -188,10 +161,10 @@ func NewHealthCheckDefinitionFromStructs(t structs.HealthCheckDefinition) Health s.TCP = t.TCP s.H2PING = t.H2PING s.H2PingUseTLS = t.H2PingUseTLS - s.Interval = *pbutil.DurationToProto(t.Interval) + s.Interval = structs.DurationToProto(t.Interval) s.OutputMaxSize = uint32(t.OutputMaxSize) - s.Timeout = *pbutil.DurationToProto(t.Timeout) - s.DeregisterCriticalServiceAfter = *pbutil.DurationToProto(t.DeregisterCriticalServiceAfter) + s.Timeout = structs.DurationToProto(t.Timeout) + s.DeregisterCriticalServiceAfter = structs.DurationToProto(t.DeregisterCriticalServiceAfter) s.ScriptArgs = t.ScriptArgs s.DockerContainerID = t.DockerContainerID s.Shell = t.Shell @@ -199,6 +172,5 @@ func NewHealthCheckDefinitionFromStructs(t structs.HealthCheckDefinition) Health s.GRPCUseTLS = t.GRPCUseTLS s.AliasNode = t.AliasNode s.AliasService = t.AliasService - s.TTL = *pbutil.DurationToProto(t.TTL) - return s + s.TTL = structs.DurationToProto(t.TTL) } diff --git a/proto/pbservice/healthcheck.pb.go b/proto/pbservice/healthcheck.pb.go index cb9eed6f8..3f5fe637b 100644 --- a/proto/pbservice/healthcheck.pb.go +++ b/proto/pbservice/healthcheck.pb.go @@ -1,18 +1,14 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: proto/pbservice/healthcheck.proto package pbservice import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - types "github.com/gogo/protobuf/types" proto "github.com/golang/protobuf/proto" - pbcommongogo "github.com/hashicorp/consul/proto/pbcommongogo" - github_com_hashicorp_consul_types "github.com/hashicorp/consul/types" - io "io" + duration "github.com/golang/protobuf/ptypes/duration" + pbcommon "github.com/hashicorp/consul/proto/pbcommon" math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -34,25 +30,29 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // 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"` + Node string `protobuf:"bytes,1,opt,name=Node,proto3" json:"Node,omitempty"` + // mog: func-to=CheckIDType func-from=string + CheckID string `protobuf:"bytes,2,opt,name=CheckID,proto3" 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,omitempty"` // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs - pbcommongogo.RaftIndex `protobuf:"bytes,11,opt,name=RaftIndex,proto3,embedded=RaftIndex" json:"RaftIndex"` + RaftIndex *pbcommon.RaftIndex `protobuf:"bytes,11,opt,name=RaftIndex,proto3" json:"RaftIndex,omitempty"` // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs - EnterpriseMeta pbcommongogo.EnterpriseMeta `protobuf:"bytes,13,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta"` + EnterpriseMeta *pbcommon.EnterpriseMeta `protobuf:"bytes,13,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta,omitempty"` // mog: func-to=int func-from=int32 - ExposedPort int32 `protobuf:"varint,14,opt,name=ExposedPort,proto3" json:"ExposedPort,omitempty"` - Interval string `protobuf:"bytes,15,opt,name=Interval,proto3" json:"Interval,omitempty"` - Timeout string `protobuf:"bytes,16,opt,name=Timeout,proto3" json:"Timeout,omitempty"` + ExposedPort int32 `protobuf:"varint,14,opt,name=ExposedPort,proto3" json:"ExposedPort,omitempty"` + Interval string `protobuf:"bytes,15,opt,name=Interval,proto3" json:"Interval,omitempty"` + Timeout string `protobuf:"bytes,16,opt,name=Timeout,proto3" json:"Timeout,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *HealthCheck) Reset() { *m = HealthCheck{} } @@ -61,26 +61,18 @@ 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) + return xxx_messageInfo_HealthCheck.Unmarshal(m, 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 - } + return xxx_messageInfo_HealthCheck.Marshal(b, m, deterministic) } func (m *HealthCheck) XXX_Merge(src proto.Message) { xxx_messageInfo_HealthCheck.Merge(m, src) } func (m *HealthCheck) XXX_Size() int { - return m.Size() + return xxx_messageInfo_HealthCheck.Size(m) } func (m *HealthCheck) XXX_DiscardUnknown() { xxx_messageInfo_HealthCheck.DiscardUnknown(m) @@ -88,8 +80,123 @@ func (m *HealthCheck) XXX_DiscardUnknown() { var xxx_messageInfo_HealthCheck proto.InternalMessageInfo +func (m *HealthCheck) GetNode() string { + if m != nil { + return m.Node + } + return "" +} + +func (m *HealthCheck) GetCheckID() string { + if m != nil { + return m.CheckID + } + return "" +} + +func (m *HealthCheck) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *HealthCheck) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +func (m *HealthCheck) GetNotes() string { + if m != nil { + return m.Notes + } + return "" +} + +func (m *HealthCheck) GetOutput() string { + if m != nil { + return m.Output + } + return "" +} + +func (m *HealthCheck) GetServiceID() string { + if m != nil { + return m.ServiceID + } + return "" +} + +func (m *HealthCheck) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *HealthCheck) GetServiceTags() []string { + if m != nil { + return m.ServiceTags + } + return nil +} + +func (m *HealthCheck) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *HealthCheck) GetDefinition() *HealthCheckDefinition { + if m != nil { + return m.Definition + } + return nil +} + +func (m *HealthCheck) GetRaftIndex() *pbcommon.RaftIndex { + if m != nil { + return m.RaftIndex + } + return nil +} + +func (m *HealthCheck) GetEnterpriseMeta() *pbcommon.EnterpriseMeta { + if m != nil { + return m.EnterpriseMeta + } + return nil +} + +func (m *HealthCheck) GetExposedPort() int32 { + if m != nil { + return m.ExposedPort + } + return 0 +} + +func (m *HealthCheck) GetInterval() string { + if m != nil { + return m.Interval + } + return "" +} + +func (m *HealthCheck) GetTimeout() string { + if m != nil { + return m.Timeout + } + return "" +} + type HeaderValue struct { - Value []string `protobuf:"bytes,1,rep,name=Value,proto3" json:"Value,omitempty"` + Value []string `protobuf:"bytes,1,rep,name=Value,proto3" json:"Value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *HeaderValue) Reset() { *m = HeaderValue{} } @@ -98,26 +205,18 @@ 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) + return xxx_messageInfo_HeaderValue.Unmarshal(m, 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 - } + return xxx_messageInfo_HeaderValue.Marshal(b, m, deterministic) } func (m *HeaderValue) XXX_Merge(src proto.Message) { xxx_messageInfo_HeaderValue.Merge(m, src) } func (m *HeaderValue) XXX_Size() int { - return m.Size() + return xxx_messageInfo_HeaderValue.Size(m) } func (m *HeaderValue) XXX_DiscardUnknown() { xxx_messageInfo_HeaderValue.DiscardUnknown(m) @@ -125,6 +224,13 @@ func (m *HeaderValue) XXX_DiscardUnknown() { var xxx_messageInfo_HeaderValue proto.InternalMessageInfo +func (m *HeaderValue) GetValue() []string { + if m != nil { + return m.Value + } + return nil +} + // HealthCheckDefinition of a single HealthCheck. // // mog annotation: @@ -137,25 +243,32 @@ type HealthCheckDefinition struct { TLSServerName string `protobuf:"bytes,19,opt,name=TLSServerName,proto3" json:"TLSServerName,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 types.Duration `protobuf:"bytes,6,opt,name=Interval,proto3" json:"Interval"` + Header map[string]*HeaderValue `protobuf:"bytes,3,rep,name=Header,proto3" json:"Header,omitempty" 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"` + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + Interval *duration.Duration `protobuf:"bytes,6,opt,name=Interval,proto3" json:"Interval,omitempty"` // mog: func-to=uint func-from=uint32 - OutputMaxSize uint32 `protobuf:"varint,9,opt,name=OutputMaxSize,proto3" json:"OutputMaxSize,omitempty"` - Timeout types.Duration `protobuf:"bytes,7,opt,name=Timeout,proto3" json:"Timeout"` - DeregisterCriticalServiceAfter types.Duration `protobuf:"bytes,8,opt,name=DeregisterCriticalServiceAfter,proto3" 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"` - H2PING string `protobuf:"bytes,20,opt,name=H2PING,proto3" json:"H2PING,omitempty"` - H2PingUseTLS bool `protobuf:"varint,21,opt,name=H2PingUseTLS,proto3" json:"H2PingUseTLS,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 types.Duration `protobuf:"bytes,17,opt,name=TTL,proto3" json:"TTL"` + OutputMaxSize uint32 `protobuf:"varint,9,opt,name=OutputMaxSize,proto3" json:"OutputMaxSize,omitempty"` + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + Timeout *duration.Duration `protobuf:"bytes,7,opt,name=Timeout,proto3" json:"Timeout,omitempty"` + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + DeregisterCriticalServiceAfter *duration.Duration `protobuf:"bytes,8,opt,name=DeregisterCriticalServiceAfter,proto3" json:"DeregisterCriticalServiceAfter,omitempty"` + 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"` + H2PING string `protobuf:"bytes,20,opt,name=H2PING,proto3" json:"H2PING,omitempty"` + H2PingUseTLS bool `protobuf:"varint,21,opt,name=H2PingUseTLS,proto3" json:"H2PingUseTLS,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"` + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + TTL *duration.Duration `protobuf:"bytes,17,opt,name=TTL,proto3" json:"TTL,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *HealthCheckDefinition) Reset() { *m = HealthCheckDefinition{} } @@ -164,26 +277,18 @@ 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) + return xxx_messageInfo_HealthCheckDefinition.Unmarshal(m, 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 - } + return xxx_messageInfo_HealthCheckDefinition.Marshal(b, m, deterministic) } func (m *HealthCheckDefinition) XXX_Merge(src proto.Message) { xxx_messageInfo_HealthCheckDefinition.Merge(m, src) } func (m *HealthCheckDefinition) XXX_Size() int { - return m.Size() + return xxx_messageInfo_HealthCheckDefinition.Size(m) } func (m *HealthCheckDefinition) XXX_DiscardUnknown() { xxx_messageInfo_HealthCheckDefinition.DiscardUnknown(m) @@ -191,6 +296,153 @@ func (m *HealthCheckDefinition) XXX_DiscardUnknown() { var xxx_messageInfo_HealthCheckDefinition proto.InternalMessageInfo +func (m *HealthCheckDefinition) GetHTTP() string { + if m != nil { + return m.HTTP + } + return "" +} + +func (m *HealthCheckDefinition) GetTLSServerName() string { + if m != nil { + return m.TLSServerName + } + return "" +} + +func (m *HealthCheckDefinition) GetTLSSkipVerify() bool { + if m != nil { + return m.TLSSkipVerify + } + return false +} + +func (m *HealthCheckDefinition) GetHeader() map[string]*HeaderValue { + if m != nil { + return m.Header + } + return nil +} + +func (m *HealthCheckDefinition) GetMethod() string { + if m != nil { + return m.Method + } + return "" +} + +func (m *HealthCheckDefinition) GetBody() string { + if m != nil { + return m.Body + } + return "" +} + +func (m *HealthCheckDefinition) GetTCP() string { + if m != nil { + return m.TCP + } + return "" +} + +func (m *HealthCheckDefinition) GetInterval() *duration.Duration { + if m != nil { + return m.Interval + } + return nil +} + +func (m *HealthCheckDefinition) GetOutputMaxSize() uint32 { + if m != nil { + return m.OutputMaxSize + } + return 0 +} + +func (m *HealthCheckDefinition) GetTimeout() *duration.Duration { + if m != nil { + return m.Timeout + } + return nil +} + +func (m *HealthCheckDefinition) GetDeregisterCriticalServiceAfter() *duration.Duration { + if m != nil { + return m.DeregisterCriticalServiceAfter + } + return nil +} + +func (m *HealthCheckDefinition) GetScriptArgs() []string { + if m != nil { + return m.ScriptArgs + } + return nil +} + +func (m *HealthCheckDefinition) GetDockerContainerID() string { + if m != nil { + return m.DockerContainerID + } + return "" +} + +func (m *HealthCheckDefinition) GetShell() string { + if m != nil { + return m.Shell + } + return "" +} + +func (m *HealthCheckDefinition) GetH2PING() string { + if m != nil { + return m.H2PING + } + return "" +} + +func (m *HealthCheckDefinition) GetH2PingUseTLS() bool { + if m != nil { + return m.H2PingUseTLS + } + return false +} + +func (m *HealthCheckDefinition) GetGRPC() string { + if m != nil { + return m.GRPC + } + return "" +} + +func (m *HealthCheckDefinition) GetGRPCUseTLS() bool { + if m != nil { + return m.GRPCUseTLS + } + return false +} + +func (m *HealthCheckDefinition) GetAliasNode() string { + if m != nil { + return m.AliasNode + } + return "" +} + +func (m *HealthCheckDefinition) GetAliasService() string { + if m != nil { + return m.AliasService + } + return "" +} + +func (m *HealthCheckDefinition) GetTTL() *duration.Duration { + if m != nil { + return m.TTL + } + return nil +} + // CheckType is used to create either the CheckMonitor or the CheckTTL. // The following types are supported: Script, HTTP, TCP, Docker, TTL, GRPC, // Alias. Script, H2PING, @@ -204,30 +456,34 @@ var xxx_messageInfo_HealthCheckDefinition proto.InternalMessageInfo // 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=CheckIDType func-from=string + CheckID string `protobuf:"bytes,1,opt,name=CheckID,proto3" 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 types.Duration `protobuf:"bytes,9,opt,name=Interval,proto3" 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"` - H2PING string `protobuf:"bytes,28,opt,name=H2PING,proto3" json:"H2PING,omitempty"` - H2PingUseTLS bool `protobuf:"varint,30,opt,name=H2PingUseTLS,proto3" json:"H2PingUseTLS,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"` - TLSServerName string `protobuf:"bytes,27,opt,name=TLSServerName,proto3" json:"TLSServerName,omitempty"` - TLSSkipVerify bool `protobuf:"varint,16,opt,name=TLSSkipVerify,proto3" json:"TLSSkipVerify,omitempty"` - Timeout types.Duration `protobuf:"bytes,17,opt,name=Timeout,proto3" json:"Timeout"` - TTL types.Duration `protobuf:"bytes,18,opt,name=TTL,proto3" json:"TTL"` + Header map[string]*HeaderValue `protobuf:"bytes,20,rep,name=Header,proto3" json:"Header,omitempty" 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"` + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + Interval *duration.Duration `protobuf:"bytes,9,opt,name=Interval,proto3" json:"Interval,omitempty"` + 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"` + H2PING string `protobuf:"bytes,28,opt,name=H2PING,proto3" json:"H2PING,omitempty"` + H2PingUseTLS bool `protobuf:"varint,30,opt,name=H2PingUseTLS,proto3" json:"H2PingUseTLS,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"` + TLSServerName string `protobuf:"bytes,27,opt,name=TLSServerName,proto3" json:"TLSServerName,omitempty"` + TLSSkipVerify bool `protobuf:"varint,16,opt,name=TLSSkipVerify,proto3" json:"TLSSkipVerify,omitempty"` + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + Timeout *duration.Duration `protobuf:"bytes,17,opt,name=Timeout,proto3" json:"Timeout,omitempty"` + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + TTL *duration.Duration `protobuf:"bytes,18,opt,name=TTL,proto3" json:"TTL,omitempty"` // 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 @@ -240,9 +496,13 @@ type CheckType struct { // DeregisterCriticalServiceAfter, if >0, will cause the associated // service, if any, to be deregistered if this check is critical for // longer than this duration. - DeregisterCriticalServiceAfter types.Duration `protobuf:"bytes,19,opt,name=DeregisterCriticalServiceAfter,proto3" json:"DeregisterCriticalServiceAfter"` + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + DeregisterCriticalServiceAfter *duration.Duration `protobuf:"bytes,19,opt,name=DeregisterCriticalServiceAfter,proto3" json:"DeregisterCriticalServiceAfter,omitempty"` // mog: func-to=int func-from=int32 - OutputMaxSize int32 `protobuf:"varint,25,opt,name=OutputMaxSize,proto3" json:"OutputMaxSize,omitempty"` + OutputMaxSize int32 `protobuf:"varint,25,opt,name=OutputMaxSize,proto3" json:"OutputMaxSize,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *CheckType) Reset() { *m = CheckType{} } @@ -251,26 +511,18 @@ 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) + return xxx_messageInfo_CheckType.Unmarshal(m, 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 - } + return xxx_messageInfo_CheckType.Marshal(b, m, deterministic) } func (m *CheckType) XXX_Merge(src proto.Message) { xxx_messageInfo_CheckType.Merge(m, src) } func (m *CheckType) XXX_Size() int { - return m.Size() + return xxx_messageInfo_CheckType.Size(m) } func (m *CheckType) XXX_DiscardUnknown() { xxx_messageInfo_CheckType.DiscardUnknown(m) @@ -278,3604 +530,292 @@ func (m *CheckType) XXX_DiscardUnknown() { var xxx_messageInfo_CheckType proto.InternalMessageInfo +func (m *CheckType) GetCheckID() string { + if m != nil { + return m.CheckID + } + return "" +} + +func (m *CheckType) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CheckType) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +func (m *CheckType) GetNotes() string { + if m != nil { + return m.Notes + } + return "" +} + +func (m *CheckType) GetScriptArgs() []string { + if m != nil { + return m.ScriptArgs + } + return nil +} + +func (m *CheckType) GetHTTP() string { + if m != nil { + return m.HTTP + } + return "" +} + +func (m *CheckType) GetHeader() map[string]*HeaderValue { + if m != nil { + return m.Header + } + return nil +} + +func (m *CheckType) GetMethod() string { + if m != nil { + return m.Method + } + return "" +} + +func (m *CheckType) GetBody() string { + if m != nil { + return m.Body + } + return "" +} + +func (m *CheckType) GetTCP() string { + if m != nil { + return m.TCP + } + return "" +} + +func (m *CheckType) GetInterval() *duration.Duration { + if m != nil { + return m.Interval + } + return nil +} + +func (m *CheckType) GetAliasNode() string { + if m != nil { + return m.AliasNode + } + return "" +} + +func (m *CheckType) GetAliasService() string { + if m != nil { + return m.AliasService + } + return "" +} + +func (m *CheckType) GetDockerContainerID() string { + if m != nil { + return m.DockerContainerID + } + return "" +} + +func (m *CheckType) GetShell() string { + if m != nil { + return m.Shell + } + return "" +} + +func (m *CheckType) GetH2PING() string { + if m != nil { + return m.H2PING + } + return "" +} + +func (m *CheckType) GetH2PingUseTLS() bool { + if m != nil { + return m.H2PingUseTLS + } + return false +} + +func (m *CheckType) GetGRPC() string { + if m != nil { + return m.GRPC + } + return "" +} + +func (m *CheckType) GetGRPCUseTLS() bool { + if m != nil { + return m.GRPCUseTLS + } + return false +} + +func (m *CheckType) GetTLSServerName() string { + if m != nil { + return m.TLSServerName + } + return "" +} + +func (m *CheckType) GetTLSSkipVerify() bool { + if m != nil { + return m.TLSSkipVerify + } + return false +} + +func (m *CheckType) GetTimeout() *duration.Duration { + if m != nil { + return m.Timeout + } + return nil +} + +func (m *CheckType) GetTTL() *duration.Duration { + if m != nil { + return m.TTL + } + return nil +} + +func (m *CheckType) GetSuccessBeforePassing() int32 { + if m != nil { + return m.SuccessBeforePassing + } + return 0 +} + +func (m *CheckType) GetFailuresBeforeWarning() int32 { + if m != nil { + return m.FailuresBeforeWarning + } + return 0 +} + +func (m *CheckType) GetFailuresBeforeCritical() int32 { + if m != nil { + return m.FailuresBeforeCritical + } + return 0 +} + +func (m *CheckType) GetProxyHTTP() string { + if m != nil { + return m.ProxyHTTP + } + return "" +} + +func (m *CheckType) GetProxyGRPC() string { + if m != nil { + return m.ProxyGRPC + } + return "" +} + +func (m *CheckType) GetDeregisterCriticalServiceAfter() *duration.Duration { + if m != nil { + return m.DeregisterCriticalServiceAfter + } + return nil +} + +func (m *CheckType) GetOutputMaxSize() int32 { + if m != nil { + return m.OutputMaxSize + } + return 0 +} + 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.RegisterMapType((map[string]*HeaderValue)(nil), "pbservice.HealthCheckDefinition.HeaderEntry") proto.RegisterType((*CheckType)(nil), "pbservice.CheckType") - proto.RegisterMapType((map[string]HeaderValue)(nil), "pbservice.CheckType.HeaderEntry") + proto.RegisterMapType((map[string]*HeaderValue)(nil), "pbservice.CheckType.HeaderEntry") } -func init() { proto.RegisterFile("proto/pbservice/healthcheck.proto", fileDescriptor_8a6f7448747c9fbe) } +func init() { + proto.RegisterFile("proto/pbservice/healthcheck.proto", fileDescriptor_8a6f7448747c9fbe) +} var fileDescriptor_8a6f7448747c9fbe = []byte{ - // 1096 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xdd, 0x4e, 0xe3, 0xc6, - 0x17, 0x8f, 0x09, 0x49, 0xf0, 0x64, 0x61, 0x97, 0x59, 0xe0, 0x3f, 0x9b, 0xff, 0xd6, 0xa4, 0x74, - 0x2f, 0xa8, 0x4a, 0x1d, 0x95, 0x56, 0x55, 0x3f, 0xd4, 0x4a, 0x84, 0xb0, 0x90, 0x0a, 0x68, 0xea, - 0xa4, 0x5b, 0xa9, 0x77, 0xc6, 0x99, 0x38, 0x16, 0x89, 0x27, 0x1a, 0x8f, 0x11, 0xe9, 0x53, 0xf4, - 0xb2, 0x0f, 0xd0, 0x87, 0xe1, 0x92, 0xcb, 0x5e, 0xa1, 0x16, 0x9e, 0xa1, 0x37, 0xbd, 0xaa, 0xe6, - 0x8c, 0x9d, 0xd8, 0x1b, 0x2f, 0x64, 0xa5, 0xed, 0x55, 0xce, 0xf9, 0x9d, 0x8f, 0x19, 0x9f, 0x73, - 0x7e, 0x67, 0x82, 0xde, 0x1f, 0x71, 0x26, 0x58, 0x6d, 0x74, 0x16, 0x50, 0x7e, 0xe1, 0x39, 0xb4, - 0xd6, 0xa7, 0xf6, 0x40, 0xf4, 0x9d, 0x3e, 0x75, 0xce, 0x4d, 0xb0, 0x61, 0x7d, 0x62, 0xac, 0x18, - 0x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24, 0x24, 0xef, 0xde, 0x19, 0x8f, 0x28, 0x79, - 0xa4, 0xee, 0x2e, 0x65, 0xfc, 0x12, 0xa1, 0x06, 0xed, 0x79, 0xbe, 0x27, 0xfb, 0x40, 0x50, 0x55, - 0xdb, 0x2e, 0xef, 0x56, 0xcd, 0x49, 0xcf, 0xcc, 0x44, 0x61, 0xa7, 0x7e, 0xf5, 0xc5, 0xab, 0x9b, - 0xcd, 0x9c, 0x95, 0x88, 0xc4, 0xdf, 0x20, 0xdd, 0xb2, 0x7b, 0xa2, 0xe9, 0x77, 0xe9, 0x25, 0x29, - 0x43, 0x9a, 0x75, 0x73, 0xda, 0x47, 0x73, 0x62, 0xac, 0x2f, 0xc9, 0xd8, 0xeb, 0x9b, 0x4d, 0xcd, - 0x9a, 0x46, 0xe0, 0x23, 0xb4, 0x72, 0xe0, 0x0b, 0xca, 0x47, 0xdc, 0x0b, 0xe8, 0x09, 0x15, 0x36, - 0x59, 0x86, 0x1c, 0x95, 0x64, 0x8e, 0xb4, 0x47, 0x74, 0x89, 0xd7, 0xe2, 0x64, 0x19, 0x0e, 0x2e, - 0x47, 0x2c, 0xa0, 0xdd, 0x16, 0xe3, 0x82, 0xac, 0x54, 0xb5, 0xed, 0x82, 0x95, 0x84, 0x70, 0x05, - 0x2d, 0x35, 0x65, 0xcc, 0x85, 0x3d, 0x20, 0x8f, 0xa1, 0x14, 0x13, 0x1d, 0x13, 0x54, 0xea, 0x78, - 0x43, 0xca, 0x42, 0x41, 0x9e, 0x80, 0x29, 0x56, 0xb7, 0x3e, 0x80, 0x21, 0xeb, 0x52, 0xfe, 0xca, - 0x1e, 0x84, 0x54, 0xf6, 0x16, 0x04, 0xa2, 0x41, 0x9d, 0x95, 0xb2, 0xf5, 0x7b, 0x09, 0xad, 0x67, - 0x56, 0x4c, 0xd6, 0xfe, 0xa8, 0xd3, 0x69, 0xc5, 0x43, 0x29, 0x65, 0xfc, 0x02, 0x2d, 0x77, 0x8e, - 0xdb, 0xb2, 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 0xee, 0xea, 0xd6, 0xd0, 0xae, 0x6f, 0x0d, 0xed, 0xcf, 0x5b, 0x43, 0xfb, 0xf5, 0xce, - 0xc8, 0xfd, 0x76, 0x67, 0xe4, 0xae, 0xef, 0x8c, 0xdc, 0x1f, 0x77, 0x46, 0xee, 0xe7, 0x8f, 0xee, - 0x5b, 0x7b, 0xaf, 0xfd, 0xd9, 0x3f, 0x2b, 0x02, 0xf0, 0xe9, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x87, 0x18, 0xc2, 0xd7, 0x06, 0x0c, 0x00, 0x00, + // 994 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xd1, 0x6e, 0x22, 0x37, + 0x14, 0x15, 0x21, 0x40, 0xc6, 0x84, 0x6c, 0xe2, 0x4d, 0x52, 0x2f, 0xbb, 0x8d, 0x28, 0xdd, 0x07, + 0xa4, 0x4d, 0x41, 0x62, 0xdb, 0x6a, 0xd5, 0x87, 0xaa, 0x09, 0xa4, 0x1b, 0xa4, 0x24, 0xa5, 0xc3, + 0x74, 0x2b, 0xf5, 0xcd, 0x19, 0x0c, 0x58, 0x19, 0xc6, 0x23, 0x8f, 0x27, 0x0a, 0xfd, 0x80, 0x7e, + 0x42, 0xbf, 0xa1, 0x9f, 0x59, 0xf9, 0x7a, 0x06, 0x66, 0x96, 0x49, 0x88, 0x54, 0xf5, 0x09, 0xdf, + 0x7b, 0xae, 0x8d, 0x7d, 0xef, 0x39, 0x07, 0xd0, 0x57, 0x81, 0x14, 0x4a, 0x74, 0x82, 0xdb, 0x90, + 0xc9, 0x7b, 0xee, 0xb2, 0xce, 0x8c, 0x51, 0x4f, 0xcd, 0xdc, 0x19, 0x73, 0xef, 0xda, 0x80, 0x61, + 0x6b, 0x09, 0xd6, 0x4f, 0xa6, 0x42, 0x4c, 0x3d, 0xd6, 0x01, 0xe0, 0x36, 0x9a, 0x74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xe8, 0x70, 0x14, 0xb9, 0x2e, 0x0b, 0xc3, 0x73, 0x36, 0x11, + 0x92, 0x0d, 0x69, 0x18, 0x72, 0x7f, 0x0a, 0x96, 0x50, 0xb2, 0x73, 0x31, 0xfc, 0x2d, 0x3a, 0xfa, + 0x99, 0x72, 0x2f, 0x92, 0x2c, 0x06, 0x7e, 0xa7, 0xd2, 0xd7, 0x9b, 0xbe, 0x84, 0x4d, 0xf9, 0x20, + 0xfe, 0x1e, 0x1d, 0x67, 0x81, 0xc4, 0x16, 0xc9, 0x31, 0x6c, 0x7b, 0x04, 0xd5, 0x2c, 0x1a, 0x4a, + 0xf1, 0xb0, 0x00, 0x35, 0x7c, 0x61, 0x58, 0xb4, 0x4c, 0x2c, 0x51, 0x18, 0x13, 0x49, 0xa1, 0x30, + 0xab, 0xcd, 0x3e, 0xfe, 0xf2, 0xbf, 0xfa, 0xf8, 0xda, 0xaf, 0xd0, 0x2b, 0x78, 0x4d, 0x36, 0xf9, + 0x3f, 0x58, 0xd5, 0xf9, 0x37, 0x7f, 0xbc, 0x9b, 0x72, 0x35, 0x8b, 0x6e, 0xf5, 0x1f, 0x9c, 0xce, + 0x8c, 0x86, 0x33, 0xee, 0x0a, 0x19, 0x74, 0x5c, 0xe1, 0x87, 0x91, 0xd7, 0xf9, 0xec, 0xaf, 0xef, + 0x6d, 0x19, 0x12, 0xef, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x33, 0x6c, 0x46, 0x9d, 0x14, 0x0b, + 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 - if len(m.Timeout) > 0 { - i -= len(m.Timeout) - copy(dAtA[i:], m.Timeout) - i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Timeout))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - if len(m.Interval) > 0 { - i -= len(m.Interval) - copy(dAtA[i:], m.Interval) - i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.Interval))) - i-- - dAtA[i] = 0x7a - } - if m.ExposedPort != 0 { - i = encodeVarintHealthcheck(dAtA, i, uint64(m.ExposedPort)) - i-- - dAtA[i] = 0x70 - } - { - 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 m.H2PingUseTLS { - i-- - if m.H2PingUseTLS { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa8 - } - if len(m.H2PING) > 0 { - i -= len(m.H2PING) - copy(dAtA[i:], m.H2PING) - i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.H2PING))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa2 - } - if len(m.TLSServerName) > 0 { - i -= len(m.TLSServerName) - copy(dAtA[i:], m.TLSServerName) - i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.TLSServerName))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x9a - } - 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 - } - { - size, err := m.TTL.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHealthcheck(dAtA, i, uint64(size)) - } - 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 - } - { - size, err := m.DeregisterCriticalServiceAfter.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHealthcheck(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - { - size, err := m.Timeout.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHealthcheck(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - { - size, err := m.Interval.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHealthcheck(dAtA, i, uint64(size)) - } - 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 m.H2PingUseTLS { - i-- - if m.H2PingUseTLS { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xf0 - } - if m.FailuresBeforeWarning != 0 { - i = encodeVarintHealthcheck(dAtA, i, uint64(m.FailuresBeforeWarning)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xe8 - } - if len(m.H2PING) > 0 { - i -= len(m.H2PING) - copy(dAtA[i:], m.H2PING) - i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.H2PING))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xe2 - } - if len(m.TLSServerName) > 0 { - i -= len(m.TLSServerName) - copy(dAtA[i:], m.TLSServerName) - i = encodeVarintHealthcheck(dAtA, i, uint64(len(m.TLSServerName))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xda - } - 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 - } - } - { - size, err := m.DeregisterCriticalServiceAfter.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHealthcheck(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x9a - { - size, err := m.TTL.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHealthcheck(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 - { - size, err := m.Timeout.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHealthcheck(dAtA, i, uint64(size)) - } - 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 - } - { - size, err := m.Interval.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHealthcheck(dAtA, i, uint64(size)) - } - 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)) - if m.ExposedPort != 0 { - n += 1 + sovHealthcheck(uint64(m.ExposedPort)) - } - l = len(m.Interval) - if l > 0 { - n += 1 + l + sovHealthcheck(uint64(l)) - } - l = len(m.Timeout) - if l > 0 { - n += 2 + 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 = m.Interval.Size() - n += 1 + l + sovHealthcheck(uint64(l)) - l = m.Timeout.Size() - n += 1 + l + sovHealthcheck(uint64(l)) - l = m.DeregisterCriticalServiceAfter.Size() - 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 = m.TTL.Size() - n += 2 + l + sovHealthcheck(uint64(l)) - l = len(m.Body) - if l > 0 { - n += 2 + l + sovHealthcheck(uint64(l)) - } - l = len(m.TLSServerName) - if l > 0 { - n += 2 + l + sovHealthcheck(uint64(l)) - } - l = len(m.H2PING) - if l > 0 { - n += 2 + l + sovHealthcheck(uint64(l)) - } - if m.H2PingUseTLS { - n += 3 - } - 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 = m.Interval.Size() - 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 = m.Timeout.Size() - n += 2 + l + sovHealthcheck(uint64(l)) - l = m.TTL.Size() - n += 2 + l + sovHealthcheck(uint64(l)) - l = m.DeregisterCriticalServiceAfter.Size() - 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)) - } - l = len(m.TLSServerName) - if l > 0 { - n += 2 + l + sovHealthcheck(uint64(l)) - } - l = len(m.H2PING) - if l > 0 { - n += 2 + l + sovHealthcheck(uint64(l)) - } - if m.FailuresBeforeWarning != 0 { - n += 2 + sovHealthcheck(uint64(m.FailuresBeforeWarning)) - } - if m.H2PingUseTLS { - n += 3 - } - 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 - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExposedPort", wireType) - } - m.ExposedPort = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHealthcheck - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ExposedPort |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Interval", 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.Interval = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeout", 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.Timeout = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipHealthcheck(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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) || (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) || (iNdEx+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 := m.Interval.Unmarshal(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 := m.Timeout.Unmarshal(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 := m.DeregisterCriticalServiceAfter.Unmarshal(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 := m.TTL.Unmarshal(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 - case 19: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TLSServerName", 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.TLSServerName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 20: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field H2PING", 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.H2PING = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 21: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field H2PingUseTLS", 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.H2PingUseTLS = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipHealthcheck(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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 := m.Interval.Unmarshal(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 := m.Timeout.Unmarshal(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 := m.TTL.Unmarshal(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 := m.DeregisterCriticalServiceAfter.Unmarshal(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) || (iNdEx+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 - case 27: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TLSServerName", 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.TLSServerName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 28: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field H2PING", 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.H2PING = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 29: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FailuresBeforeWarning", wireType) - } - m.FailuresBeforeWarning = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHealthcheck - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FailuresBeforeWarning |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 30: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field H2PingUseTLS", 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.H2PingUseTLS = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipHealthcheck(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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 - depth := 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 - } - } - case 1: - iNdEx += 8 - 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 - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupHealthcheck - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthHealthcheck - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthHealthcheck = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowHealthcheck = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupHealthcheck = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/pbservice/healthcheck.proto b/proto/pbservice/healthcheck.proto index 15a5d3dce..6d709d874 100644 --- a/proto/pbservice/healthcheck.proto +++ b/proto/pbservice/healthcheck.proto @@ -5,15 +5,7 @@ package pbservice; option go_package = "github.com/hashicorp/consul/proto/pbservice"; import "google/protobuf/duration.proto"; -import "proto/pbcommongogo/common.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; +import "proto/pbcommon/common.proto"; // HealthCheck represents a single check on a given node // @@ -24,7 +16,8 @@ option (gogoproto.goproto_sizecache_all) = false; // name=Structs message HealthCheck { string Node = 1; - string CheckID = 2 [(gogoproto.casttype) = "github.com/hashicorp/consul/types.CheckID"]; + // mog: func-to=CheckIDType func-from=string + string CheckID = 2; string Name = 3; string Status = 4; // The current check status string Notes = 5; // Additional notes with the status @@ -34,13 +27,13 @@ message HealthCheck { repeated string ServiceTags = 9; // optional service tags string Type = 12; // Check type: http/ttl/tcp/etc - HealthCheckDefinition Definition = 10 [(gogoproto.nullable) = false]; + HealthCheckDefinition Definition = 10; // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs - commongogo.RaftIndex RaftIndex = 11 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + common.RaftIndex RaftIndex = 11; // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs - commongogo.EnterpriseMeta EnterpriseMeta = 13 [(gogoproto.nullable) = false]; + common.EnterpriseMeta EnterpriseMeta = 13; // mog: func-to=int func-from=int32 int32 ExposedPort = 14; @@ -66,19 +59,19 @@ message HealthCheckDefinition { bool TLSSkipVerify = 2; // mog: func-to=MapHeadersToStructs func-from=NewMapHeadersFromStructs - map Header = 3 [(gogoproto.nullable) = false]; + map Header = 3; string Method = 4; string Body = 18; string TCP = 5; - google.protobuf.Duration Interval = 6 - [(gogoproto.nullable) = false]; + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + google.protobuf.Duration Interval = 6; // mog: func-to=uint func-from=uint32 uint32 OutputMaxSize = 9; - google.protobuf.Duration Timeout = 7 - [(gogoproto.nullable) = false]; - google.protobuf.Duration DeregisterCriticalServiceAfter = 8 - [(gogoproto.nullable) = false]; + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + google.protobuf.Duration Timeout = 7; + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + google.protobuf.Duration DeregisterCriticalServiceAfter = 8; repeated string ScriptArgs = 10; string DockerContainerID = 11; string Shell = 12; @@ -88,8 +81,8 @@ message HealthCheckDefinition { bool GRPCUseTLS = 14; string AliasNode = 15; string AliasService = 16; - google.protobuf.Duration TTL = 17 - [(gogoproto.nullable) = false]; + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + google.protobuf.Duration TTL = 17; } // CheckType is used to create either the CheckMonitor or the CheckTTL. @@ -105,7 +98,8 @@ message HealthCheckDefinition { // output=healthcheck.gen.go // name=Structs message CheckType { - string CheckID = 1 [(gogoproto.casttype) = "github.com/hashicorp/consul/types.CheckID"]; + // mog: func-to=CheckIDType func-from=string + string CheckID = 1; string Name = 2; string Status = 3; string Notes = 4; @@ -113,12 +107,12 @@ message CheckType { repeated string ScriptArgs = 5; string HTTP = 6; // mog: func-to=MapHeadersToStructs func-from=NewMapHeadersFromStructs - map Header = 20 [(gogoproto.nullable) = false]; + map Header = 20; string Method = 7; string Body = 26; string TCP = 8; - google.protobuf.Duration Interval = 9 - [(gogoproto.nullable) = false]; + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + google.protobuf.Duration Interval = 9; string AliasNode = 10; string AliasService = 11; @@ -130,10 +124,10 @@ message CheckType { bool GRPCUseTLS = 15; string TLSServerName = 27; bool TLSSkipVerify = 16; - google.protobuf.Duration Timeout = 17 - [(gogoproto.nullable) = false]; - google.protobuf.Duration TTL = 18 - [(gogoproto.nullable) = false]; + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + google.protobuf.Duration Timeout = 17; + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + google.protobuf.Duration TTL = 18; // mog: func-to=int func-from=int32 int32 SuccessBeforePassing = 21; @@ -149,8 +143,8 @@ message CheckType { // 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.nullable) = false]; + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + google.protobuf.Duration DeregisterCriticalServiceAfter = 19; // mog: func-to=int func-from=int32 int32 OutputMaxSize = 25; diff --git a/proto/pbservice/ids.go b/proto/pbservice/ids.go index 7fac22f42..ef46d3eaa 100644 --- a/proto/pbservice/ids.go +++ b/proto/pbservice/ids.go @@ -23,14 +23,22 @@ func (m *CheckServiceNode) UniqueID() string { case m.Node != nil: builder.WriteString(m.Node.Partition + "/") case m.Service != nil: - builder.WriteString(m.Service.EnterpriseMeta.Partition + "/") + partition := "" + if m.Service.EnterpriseMeta != nil { + partition = m.Service.EnterpriseMeta.Partition + } + builder.WriteString(partition + "/") } if m.Node != nil { builder.WriteString(m.Node.Node + "/") } if m.Service != nil { - builder.WriteString(m.Service.EnterpriseMeta.Namespace + "/") + namespace := "" + if m.Service.EnterpriseMeta != nil { + namespace = m.Service.EnterpriseMeta.Namespace + } + builder.WriteString(namespace + "/") builder.WriteString(m.Service.ID) } return builder.String() diff --git a/proto/pbservice/ids_test.go b/proto/pbservice/ids_test.go index 2856aa70a..2d534e902 100644 --- a/proto/pbservice/ids_test.go +++ b/proto/pbservice/ids_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/hashicorp/consul/proto/pbcommongogo" + "github.com/hashicorp/consul/proto/pbcommon" ) func TestCheckServiceNode_UniqueID(t *testing.T) { @@ -25,7 +25,7 @@ func TestCheckServiceNode_UniqueID(t *testing.T) { Node: &Node{Node: "the-node-name"}, Service: &NodeService{ ID: "the-service-id", - EnterpriseMeta: pbcommongogo.EnterpriseMeta{Namespace: "the-namespace"}, + EnterpriseMeta: &pbcommon.EnterpriseMeta{Namespace: "the-namespace"}, }, }, expected: "/the-node-name/the-namespace/the-service-id", @@ -35,7 +35,7 @@ func TestCheckServiceNode_UniqueID(t *testing.T) { csn: CheckServiceNode{ Service: &NodeService{ ID: "the-service-id", - EnterpriseMeta: pbcommongogo.EnterpriseMeta{Namespace: "the-namespace"}, + EnterpriseMeta: &pbcommon.EnterpriseMeta{Namespace: "the-namespace"}, }, }, expected: "/the-namespace/the-service-id", diff --git a/proto/pbservice/node.gen.go b/proto/pbservice/node.gen.go index 0d9b1f641..cadf2c7e9 100644 --- a/proto/pbservice/node.gen.go +++ b/proto/pbservice/node.gen.go @@ -2,11 +2,13 @@ package pbservice -import structs "github.com/hashicorp/consul/agent/structs" +import "github.com/hashicorp/consul/agent/structs" -func NodeToStructs(s Node) structs.Node { - var t structs.Node - t.ID = s.ID +func NodeToStructs(s *Node, t *structs.Node) { + if s == nil { + return + } + t.ID = NodeIDType(s.ID) t.Node = s.Node t.Address = s.Address t.Datacenter = s.Datacenter @@ -14,11 +16,12 @@ func NodeToStructs(s Node) structs.Node { t.TaggedAddresses = s.TaggedAddresses t.Meta = s.Meta t.RaftIndex = RaftIndexToStructs(s.RaftIndex) - return t } -func NewNodeFromStructs(t structs.Node) Node { - var s Node - s.ID = t.ID +func NodeFromStructs(t *structs.Node, s *Node) { + if s == nil { + return + } + s.ID = string(t.ID) s.Node = t.Node s.Address = t.Address s.Datacenter = t.Datacenter @@ -26,11 +29,12 @@ func NewNodeFromStructs(t structs.Node) Node { s.TaggedAddresses = t.TaggedAddresses s.Meta = t.Meta s.RaftIndex = NewRaftIndexFromStructs(t.RaftIndex) - return s } -func NodeServiceToStructs(s NodeService) structs.NodeService { - var t structs.NodeService - t.Kind = s.Kind +func NodeServiceToStructs(s *NodeService, t *structs.NodeService) { + if s == nil { + return + } + t.Kind = structs.ServiceKind(s.Kind) t.ID = s.ID t.Service = s.Service t.Tags = s.Tags @@ -41,16 +45,21 @@ func NodeServiceToStructs(s NodeService) structs.NodeService { t.SocketPath = s.SocketPath t.Weights = WeightsPtrToStructs(s.Weights) t.EnableTagOverride = s.EnableTagOverride - t.Proxy = ConnectProxyConfigToStructs(s.Proxy) - t.Connect = ServiceConnectToStructs(s.Connect) + if s.Proxy != nil { + ConnectProxyConfigToStructs(s.Proxy, &t.Proxy) + } + if s.Connect != nil { + ServiceConnectToStructs(s.Connect, &t.Connect) + } t.LocallyRegisteredAsSidecar = s.LocallyRegisteredAsSidecar t.EnterpriseMeta = EnterpriseMetaToStructs(s.EnterpriseMeta) t.RaftIndex = RaftIndexToStructs(s.RaftIndex) - return t } -func NewNodeServiceFromStructs(t structs.NodeService) NodeService { - var s NodeService - s.Kind = t.Kind +func NodeServiceFromStructs(t *structs.NodeService, s *NodeService) { + if s == nil { + return + } + s.Kind = string(t.Kind) s.ID = t.ID s.Service = t.Service s.Tags = t.Tags @@ -61,10 +70,17 @@ func NewNodeServiceFromStructs(t structs.NodeService) NodeService { s.SocketPath = t.SocketPath s.Weights = NewWeightsPtrFromStructs(t.Weights) s.EnableTagOverride = t.EnableTagOverride - s.Proxy = NewConnectProxyConfigFromStructs(t.Proxy) - s.Connect = NewServiceConnectFromStructs(t.Connect) + { + var x ConnectProxyConfig + ConnectProxyConfigFromStructs(&t.Proxy, &x) + s.Proxy = &x + } + { + var x ServiceConnect + ServiceConnectFromStructs(&t.Connect, &x) + s.Connect = &x + } s.LocallyRegisteredAsSidecar = t.LocallyRegisteredAsSidecar s.EnterpriseMeta = NewEnterpriseMetaFromStructs(t.EnterpriseMeta) s.RaftIndex = NewRaftIndexFromStructs(t.RaftIndex) - return s } diff --git a/proto/pbservice/node.pb.go b/proto/pbservice/node.pb.go index a93dc6da1..556f37d57 100644 --- a/proto/pbservice/node.pb.go +++ b/proto/pbservice/node.pb.go @@ -1,18 +1,13 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. 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" - pbcommongogo "github.com/hashicorp/consul/proto/pbcommongogo" - github_com_hashicorp_consul_types "github.com/hashicorp/consul/types" - io "io" + pbcommon "github.com/hashicorp/consul/proto/pbcommon" math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -29,9 +24,12 @@ const _ = proto.ProtoPackageIsVersion3 // 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"` + 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"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *CheckServiceNode) Reset() { *m = CheckServiceNode{} } @@ -40,26 +38,18 @@ 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) + return xxx_messageInfo_CheckServiceNode.Unmarshal(m, 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 - } + return xxx_messageInfo_CheckServiceNode.Marshal(b, m, deterministic) } func (m *CheckServiceNode) XXX_Merge(src proto.Message) { xxx_messageInfo_CheckServiceNode.Merge(m, src) } func (m *CheckServiceNode) XXX_Size() int { - return m.Size() + return xxx_messageInfo_CheckServiceNode.Size(m) } func (m *CheckServiceNode) XXX_DiscardUnknown() { xxx_messageInfo_CheckServiceNode.DiscardUnknown(m) @@ -67,6 +57,27 @@ func (m *CheckServiceNode) XXX_DiscardUnknown() { var xxx_messageInfo_CheckServiceNode proto.InternalMessageInfo +func (m *CheckServiceNode) GetNode() *Node { + if m != nil { + return m.Node + } + return nil +} + +func (m *CheckServiceNode) GetService() *NodeService { + if m != nil { + return m.Service + } + return nil +} + +func (m *CheckServiceNode) GetChecks() []*HealthCheck { + if m != nil { + return m.Checks + } + return nil +} + // Node contains information about a node. // // mog annotation: @@ -75,15 +86,19 @@ var xxx_messageInfo_CheckServiceNode proto.InternalMessageInfo // 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"` - Partition string `protobuf:"bytes,8,opt,name=Partition,proto3" json:"Partition,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=NodeIDType func-from=string + ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` + Node string `protobuf:"bytes,2,opt,name=Node,proto3" json:"Node,omitempty"` + Partition string `protobuf:"bytes,8,opt,name=Partition,proto3" json:"Partition,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 - pbcommongogo.RaftIndex `protobuf:"bytes,7,opt,name=RaftIndex,proto3,embedded=RaftIndex" json:"RaftIndex"` + RaftIndex *pbcommon.RaftIndex `protobuf:"bytes,7,opt,name=RaftIndex,proto3" json:"RaftIndex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Node) Reset() { *m = Node{} } @@ -92,26 +107,18 @@ 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) + return xxx_messageInfo_Node.Unmarshal(m, 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 - } + return xxx_messageInfo_Node.Marshal(b, m, deterministic) } func (m *Node) XXX_Merge(src proto.Message) { xxx_messageInfo_Node.Merge(m, src) } func (m *Node) XXX_Size() int { - return m.Size() + return xxx_messageInfo_Node.Size(m) } func (m *Node) XXX_DiscardUnknown() { xxx_messageInfo_Node.DiscardUnknown(m) @@ -119,6 +126,62 @@ func (m *Node) XXX_DiscardUnknown() { var xxx_messageInfo_Node proto.InternalMessageInfo +func (m *Node) GetID() string { + if m != nil { + return m.ID + } + return "" +} + +func (m *Node) GetNode() string { + if m != nil { + return m.Node + } + return "" +} + +func (m *Node) GetPartition() string { + if m != nil { + return m.Partition + } + return "" +} + +func (m *Node) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Node) GetDatacenter() string { + if m != nil { + return m.Datacenter + } + return "" +} + +func (m *Node) GetTaggedAddresses() map[string]string { + if m != nil { + return m.TaggedAddresses + } + return nil +} + +func (m *Node) GetMeta() map[string]string { + if m != nil { + return m.Meta + } + return nil +} + +func (m *Node) GetRaftIndex() *pbcommon.RaftIndex { + if m != nil { + return m.RaftIndex + } + return nil +} + // NodeService is a service provided by a node // // mog annotation: @@ -130,14 +193,15 @@ 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=structs.ServiceKind func-from=string + Kind string `protobuf:"bytes,1,opt,name=Kind,proto3" 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"` + 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"` // mog: func-to=int func-from=int32 Port int32 `protobuf:"varint,7,opt,name=Port,proto3" json:"Port,omitempty"` SocketPath string `protobuf:"bytes,17,opt,name=SocketPath,proto3" json:"SocketPath,omitempty"` @@ -154,10 +218,10 @@ type NodeService struct { // 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"` + Proxy *ConnectProxyConfig `protobuf:"bytes,11,opt,name=Proxy,proto3" json:"Proxy,omitempty"` // 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"` + Connect *ServiceConnect `protobuf:"bytes,12,opt,name=Connect,proto3" json:"Connect,omitempty"` // 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 @@ -177,9 +241,12 @@ type NodeService struct { // 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 pbcommongogo.EnterpriseMeta `protobuf:"bytes,16,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta"` + EnterpriseMeta *pbcommon.EnterpriseMeta `protobuf:"bytes,16,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta,omitempty"` // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs - pbcommongogo.RaftIndex `protobuf:"bytes,14,opt,name=RaftIndex,proto3,embedded=RaftIndex" json:"RaftIndex"` + RaftIndex *pbcommon.RaftIndex `protobuf:"bytes,14,opt,name=RaftIndex,proto3" json:"RaftIndex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *NodeService) Reset() { *m = NodeService{} } @@ -188,26 +255,18 @@ 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) + return xxx_messageInfo_NodeService.Unmarshal(m, 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 - } + return xxx_messageInfo_NodeService.Marshal(b, m, deterministic) } func (m *NodeService) XXX_Merge(src proto.Message) { xxx_messageInfo_NodeService.Merge(m, src) } func (m *NodeService) XXX_Size() int { - return m.Size() + return xxx_messageInfo_NodeService.Size(m) } func (m *NodeService) XXX_DiscardUnknown() { xxx_messageInfo_NodeService.DiscardUnknown(m) @@ -215,6 +274,118 @@ func (m *NodeService) XXX_DiscardUnknown() { var xxx_messageInfo_NodeService proto.InternalMessageInfo +func (m *NodeService) GetKind() string { + if m != nil { + return m.Kind + } + return "" +} + +func (m *NodeService) GetID() string { + if m != nil { + return m.ID + } + return "" +} + +func (m *NodeService) GetService() string { + if m != nil { + return m.Service + } + return "" +} + +func (m *NodeService) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + +func (m *NodeService) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *NodeService) GetTaggedAddresses() map[string]*ServiceAddress { + if m != nil { + return m.TaggedAddresses + } + return nil +} + +func (m *NodeService) GetMeta() map[string]string { + if m != nil { + return m.Meta + } + return nil +} + +func (m *NodeService) GetPort() int32 { + if m != nil { + return m.Port + } + return 0 +} + +func (m *NodeService) GetSocketPath() string { + if m != nil { + return m.SocketPath + } + return "" +} + +func (m *NodeService) GetWeights() *Weights { + if m != nil { + return m.Weights + } + return nil +} + +func (m *NodeService) GetEnableTagOverride() bool { + if m != nil { + return m.EnableTagOverride + } + return false +} + +func (m *NodeService) GetProxy() *ConnectProxyConfig { + if m != nil { + return m.Proxy + } + return nil +} + +func (m *NodeService) GetConnect() *ServiceConnect { + if m != nil { + return m.Connect + } + return nil +} + +func (m *NodeService) GetLocallyRegisteredAsSidecar() bool { + if m != nil { + return m.LocallyRegisteredAsSidecar + } + return false +} + +func (m *NodeService) GetEnterpriseMeta() *pbcommon.EnterpriseMeta { + if m != nil { + return m.EnterpriseMeta + } + return nil +} + +func (m *NodeService) GetRaftIndex() *pbcommon.RaftIndex { + if m != nil { + return m.RaftIndex + } + return nil +} + func init() { proto.RegisterType((*CheckServiceNode)(nil), "pbservice.CheckServiceNode") proto.RegisterType((*Node)(nil), "pbservice.Node") @@ -222,2041 +393,54 @@ func init() { 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") + proto.RegisterMapType((map[string]*ServiceAddress)(nil), "pbservice.NodeService.TaggedAddressesEntry") } -func init() { proto.RegisterFile("proto/pbservice/node.proto", fileDescriptor_bbc215b78fa95fe5) } +func init() { + proto.RegisterFile("proto/pbservice/node.proto", fileDescriptor_bbc215b78fa95fe5) +} var fileDescriptor_bbc215b78fa95fe5 = []byte{ - // 777 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcd, 0x6e, 0xd3, 0x4a, - 0x14, 0x8e, 0x13, 0xa7, 0x69, 0x26, 0xf7, 0xf6, 0x67, 0xd4, 0x7b, 0x35, 0x37, 0xba, 0x75, 0x42, - 0x61, 0x51, 0xa9, 0xc5, 0x46, 0x05, 0x04, 0x45, 0x80, 0xd4, 0x34, 0x95, 0x1a, 0x41, 0x4b, 0xe4, - 0x56, 0x42, 0x02, 0xb1, 0x98, 0xd8, 0x53, 0xdb, 0x6a, 0xea, 0x89, 0xc6, 0x93, 0xaa, 0x79, 0x0b, - 0x96, 0xf0, 0x12, 0x3c, 0x47, 0x97, 0x5d, 0xb2, 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0x28, - 0xeb, 0x58, 0x0e, 0x0d, 0xa3, 0x6e, 0xdb, 0xe2, 0xbd, 0x0e, 0x89, 0xe4, 0x00, 0x8d, 0xba, 0x9d, - 0x6d, 0xd4, 0x21, 0x54, 0xb7, 0x11, 0x53, 0x16, 0xd5, 0xf0, 0xff, 0x83, 0x62, 0x13, 0x33, 0x1e, - 0xf0, 0x80, 0x86, 0x68, 0x56, 0x16, 0xc6, 0x09, 0x88, 0x40, 0x61, 0xcb, 0x75, 0x19, 0x89, 0xc4, - 0xa4, 0xa2, 0x36, 0xfc, 0x84, 0x06, 0x00, 0x75, 0xcc, 0xb1, 0x43, 0x42, 0x4e, 0x18, 0xd2, 0x65, - 0x31, 0x91, 0x81, 0xfb, 0x60, 0xfe, 0x10, 0x7b, 0x1e, 0x71, 0x55, 0x03, 0x89, 0x50, 0x5e, 0xde, - 0xf5, 0x5e, 0xea, 0x71, 0xcc, 0x14, 0x6c, 0x27, 0xe4, 0xac, 0x67, 0xa7, 0x9b, 0xe1, 0x7d, 0xa0, - 0xef, 0x11, 0x8e, 0xd1, 0x8c, 0x24, 0xf9, 0x2f, 0x4d, 0x22, 0x6a, 0x71, 0xa7, 0x84, 0xc1, 0x17, - 0xa0, 0x68, 0xe3, 0x23, 0xde, 0x08, 0x5d, 0x72, 0x86, 0x0a, 0x52, 0x95, 0x7f, 0xcc, 0xb1, 0xa5, - 0xcc, 0x51, 0xb1, 0x36, 0x7b, 0xde, 0xaf, 0x64, 0x2e, 0xfa, 0x15, 0xcd, 0x1e, 0x77, 0x94, 0x6b, - 0x60, 0x69, 0xda, 0x58, 0x70, 0x01, 0xe4, 0x8e, 0x49, 0x2f, 0x16, 0xc0, 0x16, 0x21, 0x5c, 0x02, - 0xf9, 0x53, 0xdc, 0xee, 0x0e, 0x1f, 0x35, 0xfe, 0x78, 0x96, 0x7d, 0xaa, 0x95, 0x9f, 0x80, 0xe2, - 0x68, 0xaa, 0xdb, 0x34, 0xae, 0x7c, 0x29, 0x80, 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34, 0x3c, - 0x0a, 0x3c, 0xf5, 0x14, 0x71, 0x07, 0xdc, 0x04, 0x05, 0x05, 0x41, 0x7f, 0xc9, 0xe6, 0xe4, 0x0a, - 0xa8, 0xfb, 0x2b, 0x80, 0x6a, 0x1c, 0xe2, 0xe1, 0x4b, 0x50, 0x7e, 0x4d, 0x1d, 0xdc, 0x6e, 0xf7, - 0x6c, 0xe2, 0x05, 0x11, 0x27, 0x8c, 0xb8, 0x5b, 0xd1, 0x41, 0xe0, 0x12, 0x07, 0x33, 0xf4, 0xb7, - 0x1c, 0xf6, 0x06, 0x04, 0xdc, 0x05, 0x73, 0x3b, 0x62, 0xa7, 0x3b, 0x2c, 0x88, 0x88, 0x54, 0x61, - 0x41, 0x4e, 0x50, 0x4e, 0x2e, 0xd4, 0x24, 0x42, 0x8d, 0x90, 0xea, 0x9b, 0xdc, 0xca, 0xb9, 0x5b, - 0x6f, 0xe5, 0x87, 0xdf, 0xde, 0x4a, 0x2b, 0xb9, 0x5c, 0x53, 0xdf, 0x4a, 0x51, 0xfc, 0x89, 0x85, - 0xad, 0xed, 0x9d, 0x7f, 0x37, 0x32, 0xe7, 0x97, 0x86, 0x76, 0x71, 0x69, 0x68, 0xdf, 0x2e, 0x0d, - 0xed, 0xe3, 0xc0, 0xc8, 0x7c, 0x1a, 0x18, 0x99, 0x8b, 0x81, 0x91, 0xf9, 0x3a, 0x30, 0x32, 0xef, - 0xd6, 0x6e, 0x5a, 0xd8, 0xd4, 0xbf, 0x55, 0x6b, 0x46, 0x26, 0x1e, 0xfe, 0x0c, 0x00, 0x00, 0xff, - 0xff, 0xf9, 0x3e, 0x1b, 0x2c, 0x32, 0x07, 0x00, 0x00, + // 646 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xdb, 0x6e, 0xd3, 0x40, + 0x10, 0x55, 0xee, 0xcd, 0x04, 0x7a, 0x59, 0x55, 0x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 0x5d, 0xdc, 0xd4, + 0xcf, 0xa2, 0xa2, 0xc0, 0x9e, 0x5d, 0x98, 0xc5, 0x39, 0x16, 0xe6, 0xfb, 0xdc, 0x0b, 0xe3, 0xe5, + 0xe7, 0xfe, 0xde, 0x6e, 0xb8, 0x14, 0xff, 0x63, 0x97, 0x0e, 0xb6, 0xbf, 0x6d, 0x86, 0xb1, 0x89, + 0xae, 0xfb, 0xb6, 0x7a, 0x2f, 0x92, 0x69, 0x14, 0xfb, 0x4a, 0x0f, 0x3d, 0x5f, 0x25, 0xe9, 0xf5, + 0xc0, 0x2b, 0xfc, 0xd6, 0xfb, 0x75, 0x0a, 0xec, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x69, + 0xf0, 0xb9, 0x57, 0x06, 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 - if len(m.Partition) > 0 { - i -= len(m.Partition) - copy(dAtA[i:], m.Partition) - i = encodeVarintNode(dAtA, i, uint64(len(m.Partition))) - i-- - dAtA[i] = 0x42 - } - { - 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 - if len(m.SocketPath) > 0 { - i -= len(m.SocketPath) - copy(dAtA[i:], m.SocketPath) - i = encodeVarintNode(dAtA, i, uint64(len(m.SocketPath))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } - { - 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)) - l = len(m.Partition) - if l > 0 { - 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)) - l = len(m.SocketPath) - if l > 0 { - 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) || (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) || (iNdEx+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) || (iNdEx+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 - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Partition", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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.Partition = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipNode(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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) || (iNdEx+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) || (iNdEx+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 - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SocketPath", 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.SocketPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipNode(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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 - depth := 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 - } - } - case 1: - iNdEx += 8 - 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 - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupNode - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthNode - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthNode = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowNode = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupNode = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/pbservice/node.proto b/proto/pbservice/node.proto index c07e809a8..4b8389352 100644 --- a/proto/pbservice/node.proto +++ b/proto/pbservice/node.proto @@ -4,18 +4,10 @@ package pbservice; option go_package = "github.com/hashicorp/consul/proto/pbservice"; -import "proto/pbcommongogo/common.proto"; +import "proto/pbcommon/common.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 { @@ -32,7 +24,8 @@ message CheckServiceNode { // output=node.gen.go // name=Structs message Node { - string ID = 1 [(gogoproto.casttype) = "github.com/hashicorp/consul/types.NodeID"]; + // mog: func-to=NodeIDType func-from=string + string ID = 1; string Node = 2; string Partition = 8; @@ -42,7 +35,7 @@ message Node { map Meta = 6; // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs - commongogo.RaftIndex RaftIndex = 7 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + common.RaftIndex RaftIndex = 7; } // NodeService is a service provided by a node @@ -56,14 +49,15 @@ 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"]; + // mog: func-to=structs.ServiceKind func-from=string + string Kind = 1; 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 TaggedAddresses = 15; map Meta = 6; // mog: func-to=int func-from=int32 int32 Port = 7; @@ -83,11 +77,11 @@ message NodeService { // 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]; + ConnectProxyConfig Proxy = 11; // 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]; + ServiceConnect Connect = 12; // 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 @@ -109,8 +103,8 @@ message NodeService { bool LocallyRegisteredAsSidecar = 13; // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs - commongogo.EnterpriseMeta EnterpriseMeta = 16 [(gogoproto.nullable) = false]; + common.EnterpriseMeta EnterpriseMeta = 16; // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs - commongogo.RaftIndex RaftIndex = 14 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + common.RaftIndex RaftIndex = 14; } diff --git a/proto/pbservice/service.gen.go b/proto/pbservice/service.gen.go index 88dfe596d..9644f7c87 100644 --- a/proto/pbservice/service.gen.go +++ b/proto/pbservice/service.gen.go @@ -2,93 +2,123 @@ package pbservice -import structs "github.com/hashicorp/consul/agent/structs" +import "github.com/hashicorp/consul/agent/structs" -func ConnectProxyConfigToStructs(s ConnectProxyConfig) structs.ConnectProxyConfig { - var t structs.ConnectProxyConfig +func ConnectProxyConfigToStructs(s *ConnectProxyConfig, t *structs.ConnectProxyConfig) { + if s == nil { + return + } t.DestinationServiceName = s.DestinationServiceName t.DestinationServiceID = s.DestinationServiceID t.LocalServiceAddress = s.LocalServiceAddress t.LocalServicePort = int(s.LocalServicePort) t.LocalServiceSocketPath = s.LocalServiceSocketPath - t.Mode = s.Mode + t.Mode = structs.ProxyMode(s.Mode) t.Config = ProtobufTypesStructToMapStringInterface(s.Config) t.Upstreams = UpstreamsToStructs(s.Upstreams) - t.MeshGateway = MeshGatewayConfigToStructs(s.MeshGateway) - t.Expose = ExposeConfigToStructs(s.Expose) - t.TransparentProxy = TransparentProxyConfigToStructs(s.TransparentProxy) - return t + if s.MeshGateway != nil { + MeshGatewayConfigToStructs(s.MeshGateway, &t.MeshGateway) + } + if s.Expose != nil { + ExposeConfigToStructs(s.Expose, &t.Expose) + } + if s.TransparentProxy != nil { + TransparentProxyConfigToStructs(s.TransparentProxy, &t.TransparentProxy) + } } -func NewConnectProxyConfigFromStructs(t structs.ConnectProxyConfig) ConnectProxyConfig { - var s ConnectProxyConfig +func ConnectProxyConfigFromStructs(t *structs.ConnectProxyConfig, s *ConnectProxyConfig) { + if s == nil { + return + } s.DestinationServiceName = t.DestinationServiceName s.DestinationServiceID = t.DestinationServiceID s.LocalServiceAddress = t.LocalServiceAddress s.LocalServicePort = int32(t.LocalServicePort) s.LocalServiceSocketPath = t.LocalServiceSocketPath - s.Mode = t.Mode + s.Mode = string(t.Mode) s.Config = MapStringInterfaceToProtobufTypesStruct(t.Config) s.Upstreams = NewUpstreamsFromStructs(t.Upstreams) - s.MeshGateway = NewMeshGatewayConfigFromStructs(t.MeshGateway) - s.Expose = NewExposeConfigFromStructs(t.Expose) - s.TransparentProxy = NewTransparentProxyConfigFromStructs(t.TransparentProxy) - return s + { + var x MeshGatewayConfig + MeshGatewayConfigFromStructs(&t.MeshGateway, &x) + s.MeshGateway = &x + } + { + var x ExposeConfig + ExposeConfigFromStructs(&t.Expose, &x) + s.Expose = &x + } + { + var x TransparentProxyConfig + TransparentProxyConfigFromStructs(&t.TransparentProxy, &x) + s.TransparentProxy = &x + } } -func ExposeConfigToStructs(s ExposeConfig) structs.ExposeConfig { - var t structs.ExposeConfig +func ExposeConfigToStructs(s *ExposeConfig, t *structs.ExposeConfig) { + if s == nil { + return + } t.Checks = s.Checks t.Paths = ExposePathSliceToStructs(s.Paths) - return t } -func NewExposeConfigFromStructs(t structs.ExposeConfig) ExposeConfig { - var s ExposeConfig +func ExposeConfigFromStructs(t *structs.ExposeConfig, s *ExposeConfig) { + if s == nil { + return + } s.Checks = t.Checks s.Paths = NewExposePathSliceFromStructs(t.Paths) - return s } -func ExposePathToStructs(s ExposePath) structs.ExposePath { - var t structs.ExposePath +func ExposePathToStructs(s *ExposePath, t *structs.ExposePath) { + if s == nil { + return + } t.ListenerPort = int(s.ListenerPort) t.Path = s.Path t.LocalPathPort = int(s.LocalPathPort) t.Protocol = s.Protocol t.ParsedFromCheck = s.ParsedFromCheck - return t } -func NewExposePathFromStructs(t structs.ExposePath) ExposePath { - var s ExposePath +func ExposePathFromStructs(t *structs.ExposePath, s *ExposePath) { + if s == nil { + return + } s.ListenerPort = int32(t.ListenerPort) s.Path = t.Path s.LocalPathPort = int32(t.LocalPathPort) s.Protocol = t.Protocol s.ParsedFromCheck = t.ParsedFromCheck - return s } -func MeshGatewayConfigToStructs(s MeshGatewayConfig) structs.MeshGatewayConfig { - var t structs.MeshGatewayConfig - t.Mode = s.Mode - return t +func MeshGatewayConfigToStructs(s *MeshGatewayConfig, t *structs.MeshGatewayConfig) { + if s == nil { + return + } + t.Mode = structs.MeshGatewayMode(s.Mode) } -func NewMeshGatewayConfigFromStructs(t structs.MeshGatewayConfig) MeshGatewayConfig { - var s MeshGatewayConfig - s.Mode = t.Mode - return s +func MeshGatewayConfigFromStructs(t *structs.MeshGatewayConfig, s *MeshGatewayConfig) { + if s == nil { + return + } + s.Mode = string(t.Mode) } -func ServiceConnectToStructs(s ServiceConnect) structs.ServiceConnect { - var t structs.ServiceConnect +func ServiceConnectToStructs(s *ServiceConnect, t *structs.ServiceConnect) { + if s == nil { + return + } t.Native = s.Native t.SidecarService = ServiceDefinitionPtrToStructs(s.SidecarService) - return t } -func NewServiceConnectFromStructs(t structs.ServiceConnect) ServiceConnect { - var s ServiceConnect +func ServiceConnectFromStructs(t *structs.ServiceConnect, s *ServiceConnect) { + if s == nil { + return + } s.Native = t.Native s.SidecarService = NewServiceDefinitionPtrFromStructs(t.SidecarService) - return s } -func ServiceDefinitionToStructs(s ServiceDefinition) (structs.ServiceDefinition, error) { - var t structs.ServiceDefinition - t.Kind = s.Kind +func ServiceDefinitionToStructs(s *ServiceDefinition, t *structs.ServiceDefinition) { + if s == nil { + return + } + t.Kind = structs.ServiceKind(s.Kind) t.ID = s.ID t.Name = s.Name t.Tags = s.Tags @@ -97,27 +127,22 @@ func ServiceDefinitionToStructs(s ServiceDefinition) (structs.ServiceDefinition, t.Meta = s.Meta t.Port = int(s.Port) t.SocketPath = s.SocketPath - check, err := CheckTypeToStructs(s.Check) - if err != nil { - return t, err + if s.Check != nil { + CheckTypeToStructs(s.Check, &t.Check) } - t.Check = check - checks, err := CheckTypesToStructs(s.Checks) - if err != nil { - return t, err - } - t.Checks = checks + t.Checks = CheckTypesToStructs(s.Checks) t.Weights = WeightsPtrToStructs(s.Weights) t.Token = s.Token t.EnableTagOverride = s.EnableTagOverride t.Proxy = ConnectProxyConfigPtrToStructs(s.Proxy) t.EnterpriseMeta = EnterpriseMetaToStructs(s.EnterpriseMeta) t.Connect = ServiceConnectPtrToStructs(s.Connect) - return t, nil } -func NewServiceDefinitionFromStructs(t structs.ServiceDefinition) ServiceDefinition { - var s ServiceDefinition - s.Kind = t.Kind +func ServiceDefinitionFromStructs(t *structs.ServiceDefinition, s *ServiceDefinition) { + if s == nil { + return + } + s.Kind = string(t.Kind) s.ID = t.ID s.Name = t.Name s.Tags = t.Tags @@ -126,7 +151,11 @@ func NewServiceDefinitionFromStructs(t structs.ServiceDefinition) ServiceDefinit s.Meta = t.Meta s.Port = int32(t.Port) s.SocketPath = t.SocketPath - s.Check = NewCheckTypeFromStructs(t.Check) + { + var x CheckType + CheckTypeFromStructs(&t.Check, &x) + s.Check = &x + } s.Checks = NewCheckTypesFromStructs(t.Checks) s.Weights = NewWeightsPtrFromStructs(t.Weights) s.Token = t.Token @@ -134,22 +163,25 @@ func NewServiceDefinitionFromStructs(t structs.ServiceDefinition) ServiceDefinit s.Proxy = NewConnectProxyConfigPtrFromStructs(t.Proxy) s.EnterpriseMeta = NewEnterpriseMetaFromStructs(t.EnterpriseMeta) s.Connect = NewServiceConnectPtrFromStructs(t.Connect) - return s } -func TransparentProxyConfigToStructs(s TransparentProxyConfig) structs.TransparentProxyConfig { - var t structs.TransparentProxyConfig +func TransparentProxyConfigToStructs(s *TransparentProxyConfig, t *structs.TransparentProxyConfig) { + if s == nil { + return + } t.OutboundListenerPort = int(s.OutboundListenerPort) t.DialedDirectly = s.DialedDirectly - return t } -func NewTransparentProxyConfigFromStructs(t structs.TransparentProxyConfig) TransparentProxyConfig { - var s TransparentProxyConfig +func TransparentProxyConfigFromStructs(t *structs.TransparentProxyConfig, s *TransparentProxyConfig) { + if s == nil { + return + } s.OutboundListenerPort = int32(t.OutboundListenerPort) s.DialedDirectly = t.DialedDirectly - return s } -func UpstreamToStructs(s Upstream) structs.Upstream { - var t structs.Upstream +func UpstreamToStructs(s *Upstream, t *structs.Upstream) { + if s == nil { + return + } t.DestinationType = s.DestinationType t.DestinationNamespace = s.DestinationNamespace t.DestinationPartition = s.DestinationPartition @@ -160,12 +192,15 @@ func UpstreamToStructs(s Upstream) structs.Upstream { t.LocalBindSocketPath = s.LocalBindSocketPath t.LocalBindSocketMode = s.LocalBindSocketMode t.Config = ProtobufTypesStructToMapStringInterface(s.Config) - t.MeshGateway = MeshGatewayConfigToStructs(s.MeshGateway) + if s.MeshGateway != nil { + MeshGatewayConfigToStructs(s.MeshGateway, &t.MeshGateway) + } t.CentrallyConfigured = s.CentrallyConfigured - return t } -func NewUpstreamFromStructs(t structs.Upstream) Upstream { - var s Upstream +func UpstreamFromStructs(t *structs.Upstream, s *Upstream) { + if s == nil { + return + } s.DestinationType = t.DestinationType s.DestinationNamespace = t.DestinationNamespace s.DestinationPartition = t.DestinationPartition @@ -176,7 +211,10 @@ func NewUpstreamFromStructs(t structs.Upstream) Upstream { s.LocalBindSocketPath = t.LocalBindSocketPath s.LocalBindSocketMode = t.LocalBindSocketMode s.Config = MapStringInterfaceToProtobufTypesStruct(t.Config) - s.MeshGateway = NewMeshGatewayConfigFromStructs(t.MeshGateway) + { + var x MeshGatewayConfig + MeshGatewayConfigFromStructs(&t.MeshGateway, &x) + s.MeshGateway = &x + } s.CentrallyConfigured = t.CentrallyConfigured - return s } diff --git a/proto/pbservice/service.pb.go b/proto/pbservice/service.pb.go index ca5761fdc..b71a0a387 100644 --- a/proto/pbservice/service.pb.go +++ b/proto/pbservice/service.pb.go @@ -1,18 +1,14 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. 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" - pbcommongogo "github.com/hashicorp/consul/proto/pbcommongogo" - io "io" + _struct "github.com/golang/protobuf/ptypes/struct" + pbcommon "github.com/hashicorp/consul/proto/pbcommon" math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -62,22 +58,26 @@ type ConnectProxyConfig struct { // Config is the arbitrary configuration data provided with the proxy // registration. // mog: func-to=ProtobufTypesStructToMapStringInterface func-from=MapStringInterfaceToProtobufTypesStruct - Config *types.Struct `protobuf:"bytes,5,opt,name=Config,proto3" json:"Config,omitempty"` + Config *_struct.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"` + Upstreams []*Upstream `protobuf:"bytes,6,rep,name=Upstreams,proto3" json:"Upstreams,omitempty"` // MeshGateway defines the mesh gateway configuration for upstreams - MeshGateway MeshGatewayConfig `protobuf:"bytes,7,opt,name=MeshGateway,proto3" json:"MeshGateway"` + 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"` + Expose *ExposeConfig `protobuf:"bytes,8,opt,name=Expose,proto3" json:"Expose,omitempty"` // Mode represents how the proxy's inbound and upstream listeners are dialed. - Mode github_com_hashicorp_consul_agent_structs.ProxyMode `protobuf:"bytes,9,opt,name=Mode,proto3,casttype=github.com/hashicorp/consul/agent/structs.ProxyMode" json:"Mode,omitempty"` + // mog: func-to=structs.ProxyMode func-from=string + Mode string `protobuf:"bytes,9,opt,name=Mode,proto3" json:"Mode,omitempty"` // TransparentProxy defines configuration for when the proxy is in // transparent mode. - TransparentProxy TransparentProxyConfig `protobuf:"bytes,10,opt,name=TransparentProxy,proto3" json:"TransparentProxy"` + TransparentProxy *TransparentProxyConfig `protobuf:"bytes,10,opt,name=TransparentProxy,proto3" json:"TransparentProxy,omitempty"` // LocalServiceSocketPath is the path to the unix domain socket for the local service instance - LocalServiceSocketPath string `protobuf:"bytes,11,opt,name=LocalServiceSocketPath,proto3" json:"LocalServiceSocketPath,omitempty"` + LocalServiceSocketPath string `protobuf:"bytes,11,opt,name=LocalServiceSocketPath,proto3" json:"LocalServiceSocketPath,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ConnectProxyConfig) Reset() { *m = ConnectProxyConfig{} } @@ -86,26 +86,18 @@ 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) + return xxx_messageInfo_ConnectProxyConfig.Unmarshal(m, 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 - } + return xxx_messageInfo_ConnectProxyConfig.Marshal(b, m, deterministic) } func (m *ConnectProxyConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_ConnectProxyConfig.Merge(m, src) } func (m *ConnectProxyConfig) XXX_Size() int { - return m.Size() + return xxx_messageInfo_ConnectProxyConfig.Size(m) } func (m *ConnectProxyConfig) XXX_DiscardUnknown() { xxx_messageInfo_ConnectProxyConfig.DiscardUnknown(m) @@ -113,6 +105,83 @@ func (m *ConnectProxyConfig) XXX_DiscardUnknown() { var xxx_messageInfo_ConnectProxyConfig proto.InternalMessageInfo +func (m *ConnectProxyConfig) GetDestinationServiceName() string { + if m != nil { + return m.DestinationServiceName + } + return "" +} + +func (m *ConnectProxyConfig) GetDestinationServiceID() string { + if m != nil { + return m.DestinationServiceID + } + return "" +} + +func (m *ConnectProxyConfig) GetLocalServiceAddress() string { + if m != nil { + return m.LocalServiceAddress + } + return "" +} + +func (m *ConnectProxyConfig) GetLocalServicePort() int32 { + if m != nil { + return m.LocalServicePort + } + return 0 +} + +func (m *ConnectProxyConfig) GetConfig() *_struct.Struct { + if m != nil { + return m.Config + } + return nil +} + +func (m *ConnectProxyConfig) GetUpstreams() []*Upstream { + if m != nil { + return m.Upstreams + } + return nil +} + +func (m *ConnectProxyConfig) GetMeshGateway() *MeshGatewayConfig { + if m != nil { + return m.MeshGateway + } + return nil +} + +func (m *ConnectProxyConfig) GetExpose() *ExposeConfig { + if m != nil { + return m.Expose + } + return nil +} + +func (m *ConnectProxyConfig) GetMode() string { + if m != nil { + return m.Mode + } + return "" +} + +func (m *ConnectProxyConfig) GetTransparentProxy() *TransparentProxyConfig { + if m != nil { + return m.TransparentProxy + } + return nil +} + +func (m *ConnectProxyConfig) GetLocalServiceSocketPath() string { + if m != nil { + return m.LocalServiceSocketPath + } + return "" +} + // 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 @@ -150,16 +219,19 @@ type Upstream struct { // It can be used to pass arbitrary configuration for this specific upstream // to the proxy. // mog: func-to=ProtobufTypesStructToMapStringInterface func-from=MapStringInterfaceToProtobufTypesStruct - Config *types.Struct `protobuf:"bytes,7,opt,name=Config,proto3" json:"Config,omitempty"` + Config *_struct.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"` + MeshGateway *MeshGatewayConfig `protobuf:"bytes,8,opt,name=MeshGateway,proto3" json:"MeshGateway,omitempty"` // CentrallyConfigured indicates whether the upstream was defined in a proxy // instance registration or whether it was generated from a config entry. CentrallyConfigured bool `protobuf:"varint,9,opt,name=CentrallyConfigured,proto3" json:"CentrallyConfigured,omitempty"` // LocalBindSocketPath is the socket to create to connect to the upstream service - LocalBindSocketPath string `protobuf:"bytes,10,opt,name=LocalBindSocketPath,proto3" json:"LocalBindSocketPath,omitempty"` - LocalBindSocketMode string `protobuf:"bytes,11,opt,name=LocalBindSocketMode,proto3" json:"LocalBindSocketMode,omitempty"` - DestinationPartition string `protobuf:"bytes,12,opt,name=DestinationPartition,proto3" json:"DestinationPartition,omitempty"` + LocalBindSocketPath string `protobuf:"bytes,10,opt,name=LocalBindSocketPath,proto3" json:"LocalBindSocketPath,omitempty"` + LocalBindSocketMode string `protobuf:"bytes,11,opt,name=LocalBindSocketMode,proto3" json:"LocalBindSocketMode,omitempty"` + DestinationPartition string `protobuf:"bytes,12,opt,name=DestinationPartition,proto3" json:"DestinationPartition,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Upstream) Reset() { *m = Upstream{} } @@ -168,26 +240,18 @@ 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) + return xxx_messageInfo_Upstream.Unmarshal(m, 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 - } + return xxx_messageInfo_Upstream.Marshal(b, m, deterministic) } func (m *Upstream) XXX_Merge(src proto.Message) { xxx_messageInfo_Upstream.Merge(m, src) } func (m *Upstream) XXX_Size() int { - return m.Size() + return xxx_messageInfo_Upstream.Size(m) } func (m *Upstream) XXX_DiscardUnknown() { xxx_messageInfo_Upstream.DiscardUnknown(m) @@ -195,6 +259,90 @@ func (m *Upstream) XXX_DiscardUnknown() { var xxx_messageInfo_Upstream proto.InternalMessageInfo +func (m *Upstream) GetDestinationType() string { + if m != nil { + return m.DestinationType + } + return "" +} + +func (m *Upstream) GetDestinationNamespace() string { + if m != nil { + return m.DestinationNamespace + } + return "" +} + +func (m *Upstream) GetDestinationName() string { + if m != nil { + return m.DestinationName + } + return "" +} + +func (m *Upstream) GetDatacenter() string { + if m != nil { + return m.Datacenter + } + return "" +} + +func (m *Upstream) GetLocalBindAddress() string { + if m != nil { + return m.LocalBindAddress + } + return "" +} + +func (m *Upstream) GetLocalBindPort() int32 { + if m != nil { + return m.LocalBindPort + } + return 0 +} + +func (m *Upstream) GetConfig() *_struct.Struct { + if m != nil { + return m.Config + } + return nil +} + +func (m *Upstream) GetMeshGateway() *MeshGatewayConfig { + if m != nil { + return m.MeshGateway + } + return nil +} + +func (m *Upstream) GetCentrallyConfigured() bool { + if m != nil { + return m.CentrallyConfigured + } + return false +} + +func (m *Upstream) GetLocalBindSocketPath() string { + if m != nil { + return m.LocalBindSocketPath + } + return "" +} + +func (m *Upstream) GetLocalBindSocketMode() string { + if m != nil { + return m.LocalBindSocketMode + } + return "" +} + +func (m *Upstream) GetDestinationPartition() string { + if m != nil { + return m.DestinationPartition + } + return "" +} + // ServiceConnect are the shared Connect settings between all service // definitions from the agent to the state store. // mog annotation: @@ -213,7 +361,10 @@ type ServiceConnect struct { // 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"` + SidecarService *ServiceDefinition `protobuf:"bytes,3,opt,name=SidecarService,proto3" json:"SidecarService,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ServiceConnect) Reset() { *m = ServiceConnect{} } @@ -222,26 +373,18 @@ 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) + return xxx_messageInfo_ServiceConnect.Unmarshal(m, 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 - } + return xxx_messageInfo_ServiceConnect.Marshal(b, m, deterministic) } func (m *ServiceConnect) XXX_Merge(src proto.Message) { xxx_messageInfo_ServiceConnect.Merge(m, src) } func (m *ServiceConnect) XXX_Size() int { - return m.Size() + return xxx_messageInfo_ServiceConnect.Size(m) } func (m *ServiceConnect) XXX_DiscardUnknown() { xxx_messageInfo_ServiceConnect.DiscardUnknown(m) @@ -249,6 +392,20 @@ func (m *ServiceConnect) XXX_DiscardUnknown() { var xxx_messageInfo_ServiceConnect proto.InternalMessageInfo +func (m *ServiceConnect) GetNative() bool { + if m != nil { + return m.Native + } + return false +} + +func (m *ServiceConnect) GetSidecarService() *ServiceDefinition { + if m != nil { + return m.SidecarService + } + return nil +} + // ExposeConfig describes HTTP paths to expose through Envoy outside of Connect. // Users can expose individual paths and/or all HTTP/GRPC paths for checks. // @@ -263,7 +420,10 @@ type ExposeConfig struct { 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"` + Paths []*ExposePath `protobuf:"bytes,2,rep,name=Paths,proto3" json:"Paths,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ExposeConfig) Reset() { *m = ExposeConfig{} } @@ -272,26 +432,18 @@ 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) + return xxx_messageInfo_ExposeConfig.Unmarshal(m, 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 - } + return xxx_messageInfo_ExposeConfig.Marshal(b, m, deterministic) } func (m *ExposeConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_ExposeConfig.Merge(m, src) } func (m *ExposeConfig) XXX_Size() int { - return m.Size() + return xxx_messageInfo_ExposeConfig.Size(m) } func (m *ExposeConfig) XXX_DiscardUnknown() { xxx_messageInfo_ExposeConfig.DiscardUnknown(m) @@ -299,6 +451,20 @@ func (m *ExposeConfig) XXX_DiscardUnknown() { var xxx_messageInfo_ExposeConfig proto.InternalMessageInfo +func (m *ExposeConfig) GetChecks() bool { + if m != nil { + return m.Checks + } + return false +} + +func (m *ExposeConfig) GetPaths() []*ExposePath { + if m != nil { + return m.Paths + } + return nil +} + // mog annotation: // // target=github.com/hashicorp/consul/agent/structs.ExposePath @@ -317,7 +483,10 @@ type ExposePath struct { // 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"` + ParsedFromCheck bool `protobuf:"varint,5,opt,name=ParsedFromCheck,proto3" json:"ParsedFromCheck,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ExposePath) Reset() { *m = ExposePath{} } @@ -326,26 +495,18 @@ 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) + return xxx_messageInfo_ExposePath.Unmarshal(m, 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 - } + return xxx_messageInfo_ExposePath.Marshal(b, m, deterministic) } func (m *ExposePath) XXX_Merge(src proto.Message) { xxx_messageInfo_ExposePath.Merge(m, src) } func (m *ExposePath) XXX_Size() int { - return m.Size() + return xxx_messageInfo_ExposePath.Size(m) } func (m *ExposePath) XXX_DiscardUnknown() { xxx_messageInfo_ExposePath.DiscardUnknown(m) @@ -353,13 +514,52 @@ func (m *ExposePath) XXX_DiscardUnknown() { var xxx_messageInfo_ExposePath proto.InternalMessageInfo +func (m *ExposePath) GetListenerPort() int32 { + if m != nil { + return m.ListenerPort + } + return 0 +} + +func (m *ExposePath) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *ExposePath) GetLocalPathPort() int32 { + if m != nil { + return m.LocalPathPort + } + return 0 +} + +func (m *ExposePath) GetProtocol() string { + if m != nil { + return m.Protocol + } + return "" +} + +func (m *ExposePath) GetParsedFromCheck() bool { + if m != nil { + return m.ParsedFromCheck + } + return false +} + // 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"` + // mog: func-to=structs.MeshGatewayMode func-from=string + Mode string `protobuf:"bytes,1,opt,name=Mode,proto3" json:"Mode,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *MeshGatewayConfig) Reset() { *m = MeshGatewayConfig{} } @@ -368,26 +568,18 @@ 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) + return xxx_messageInfo_MeshGatewayConfig.Unmarshal(m, 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 - } + return xxx_messageInfo_MeshGatewayConfig.Marshal(b, m, deterministic) } func (m *MeshGatewayConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_MeshGatewayConfig.Merge(m, src) } func (m *MeshGatewayConfig) XXX_Size() int { - return m.Size() + return xxx_messageInfo_MeshGatewayConfig.Size(m) } func (m *MeshGatewayConfig) XXX_DiscardUnknown() { xxx_messageInfo_MeshGatewayConfig.DiscardUnknown(m) @@ -395,6 +587,13 @@ func (m *MeshGatewayConfig) XXX_DiscardUnknown() { var xxx_messageInfo_MeshGatewayConfig proto.InternalMessageInfo +func (m *MeshGatewayConfig) GetMode() string { + if m != nil { + return m.Mode + } + return "" +} + // mog annotation: // // target=github.com/hashicorp/consul/agent/structs.TransparentProxyConfig @@ -406,7 +605,10 @@ type TransparentProxyConfig struct { // DialedDirectly indicates whether transparent proxies can dial this proxy instance directly. // The discovery chain is not considered when dialing a service instance directly. // This setting is useful when addressing stateful services, such as a database cluster with a leader node. - DialedDirectly bool `protobuf:"varint,2,opt,name=DialedDirectly,proto3" json:"DialedDirectly,omitempty"` + DialedDirectly bool `protobuf:"varint,2,opt,name=DialedDirectly,proto3" json:"DialedDirectly,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *TransparentProxyConfig) Reset() { *m = TransparentProxyConfig{} } @@ -415,26 +617,18 @@ func (*TransparentProxyConfig) ProtoMessage() {} func (*TransparentProxyConfig) Descriptor() ([]byte, []int) { return fileDescriptor_cbb99233b75fb80b, []int{6} } + func (m *TransparentProxyConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_TransparentProxyConfig.Unmarshal(m, b) } func (m *TransparentProxyConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TransparentProxyConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_TransparentProxyConfig.Marshal(b, m, deterministic) } func (m *TransparentProxyConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_TransparentProxyConfig.Merge(m, src) } func (m *TransparentProxyConfig) XXX_Size() int { - return m.Size() + return xxx_messageInfo_TransparentProxyConfig.Size(m) } func (m *TransparentProxyConfig) XXX_DiscardUnknown() { xxx_messageInfo_TransparentProxyConfig.DiscardUnknown(m) @@ -442,6 +636,20 @@ func (m *TransparentProxyConfig) XXX_DiscardUnknown() { var xxx_messageInfo_TransparentProxyConfig proto.InternalMessageInfo +func (m *TransparentProxyConfig) GetOutboundListenerPort() int32 { + if m != nil { + return m.OutboundListenerPort + } + return 0 +} + +func (m *TransparentProxyConfig) GetDialedDirectly() bool { + if m != nil { + return m.DialedDirectly + } + return false +} + // ServiceDefinition is used to JSON decode the Service definitions. For // documentation on specific fields see NodeService which is better documented. // @@ -451,19 +659,20 @@ var xxx_messageInfo_TransparentProxyConfig proto.InternalMessageInfo // 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=structs.ServiceKind func-from=string + Kind string `protobuf:"bytes,1,opt,name=Kind,proto3" 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"` + 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"` // mog: func-to=int func-from=int32 Port int32 `protobuf:"varint,7,opt,name=Port,proto3" json:"Port,omitempty"` // Path for socket - SocketPath string `protobuf:"bytes,18,opt,name=SocketPath,proto3" json:"SocketPath,omitempty"` - Check CheckType `protobuf:"bytes,8,opt,name=Check,proto3" json:"Check"` + SocketPath string `protobuf:"bytes,18,opt,name=SocketPath,proto3" json:"SocketPath,omitempty"` + Check *CheckType `protobuf:"bytes,8,opt,name=Check,proto3" json:"Check,omitempty"` // 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 @@ -483,9 +692,12 @@ type ServiceDefinition struct { // 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 pbcommongogo.EnterpriseMeta `protobuf:"bytes,17,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta"` + EnterpriseMeta *pbcommon.EnterpriseMeta `protobuf:"bytes,17,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta,omitempty"` // mog: func-to=ServiceConnectPtrToStructs func-from=NewServiceConnectPtrFromStructs - Connect *ServiceConnect `protobuf:"bytes,15,opt,name=Connect,proto3" json:"Connect,omitempty"` + Connect *ServiceConnect `protobuf:"bytes,15,opt,name=Connect,proto3" json:"Connect,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ServiceDefinition) Reset() { *m = ServiceDefinition{} } @@ -494,26 +706,18 @@ func (*ServiceDefinition) ProtoMessage() {} func (*ServiceDefinition) Descriptor() ([]byte, []int) { return fileDescriptor_cbb99233b75fb80b, []int{7} } + func (m *ServiceDefinition) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_ServiceDefinition.Unmarshal(m, 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 - } + return xxx_messageInfo_ServiceDefinition.Marshal(b, m, deterministic) } func (m *ServiceDefinition) XXX_Merge(src proto.Message) { xxx_messageInfo_ServiceDefinition.Merge(m, src) } func (m *ServiceDefinition) XXX_Size() int { - return m.Size() + return xxx_messageInfo_ServiceDefinition.Size(m) } func (m *ServiceDefinition) XXX_DiscardUnknown() { xxx_messageInfo_ServiceDefinition.DiscardUnknown(m) @@ -521,11 +725,133 @@ func (m *ServiceDefinition) XXX_DiscardUnknown() { var xxx_messageInfo_ServiceDefinition proto.InternalMessageInfo +func (m *ServiceDefinition) GetKind() string { + if m != nil { + return m.Kind + } + return "" +} + +func (m *ServiceDefinition) GetID() string { + if m != nil { + return m.ID + } + return "" +} + +func (m *ServiceDefinition) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ServiceDefinition) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + +func (m *ServiceDefinition) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *ServiceDefinition) GetTaggedAddresses() map[string]*ServiceAddress { + if m != nil { + return m.TaggedAddresses + } + return nil +} + +func (m *ServiceDefinition) GetMeta() map[string]string { + if m != nil { + return m.Meta + } + return nil +} + +func (m *ServiceDefinition) GetPort() int32 { + if m != nil { + return m.Port + } + return 0 +} + +func (m *ServiceDefinition) GetSocketPath() string { + if m != nil { + return m.SocketPath + } + return "" +} + +func (m *ServiceDefinition) GetCheck() *CheckType { + if m != nil { + return m.Check + } + return nil +} + +func (m *ServiceDefinition) GetChecks() []*CheckType { + if m != nil { + return m.Checks + } + return nil +} + +func (m *ServiceDefinition) GetWeights() *Weights { + if m != nil { + return m.Weights + } + return nil +} + +func (m *ServiceDefinition) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *ServiceDefinition) GetEnableTagOverride() bool { + if m != nil { + return m.EnableTagOverride + } + return false +} + +func (m *ServiceDefinition) GetProxy() *ConnectProxyConfig { + if m != nil { + return m.Proxy + } + return nil +} + +func (m *ServiceDefinition) GetEnterpriseMeta() *pbcommon.EnterpriseMeta { + if m != nil { + return m.EnterpriseMeta + } + return nil +} + +func (m *ServiceDefinition) GetConnect() *ServiceConnect { + if m != nil { + return m.Connect + } + return nil +} + // 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"` + Port int32 `protobuf:"varint,2,opt,name=Port,proto3" json:"Port,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ServiceAddress) Reset() { *m = ServiceAddress{} } @@ -534,26 +860,18 @@ func (*ServiceAddress) ProtoMessage() {} func (*ServiceAddress) Descriptor() ([]byte, []int) { return fileDescriptor_cbb99233b75fb80b, []int{8} } + func (m *ServiceAddress) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_ServiceAddress.Unmarshal(m, 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 - } + return xxx_messageInfo_ServiceAddress.Marshal(b, m, deterministic) } func (m *ServiceAddress) XXX_Merge(src proto.Message) { xxx_messageInfo_ServiceAddress.Merge(m, src) } func (m *ServiceAddress) XXX_Size() int { - return m.Size() + return xxx_messageInfo_ServiceAddress.Size(m) } func (m *ServiceAddress) XXX_DiscardUnknown() { xxx_messageInfo_ServiceAddress.DiscardUnknown(m) @@ -561,12 +879,29 @@ func (m *ServiceAddress) XXX_DiscardUnknown() { var xxx_messageInfo_ServiceAddress proto.InternalMessageInfo +func (m *ServiceAddress) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *ServiceAddress) GetPort() int32 { + if m != nil { + return m.Port + } + return 0 +} + // 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"` + Warning int32 `protobuf:"varint,2,opt,name=Warning,proto3" json:"Warning,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Weights) Reset() { *m = Weights{} } @@ -575,26 +910,18 @@ func (*Weights) ProtoMessage() {} func (*Weights) Descriptor() ([]byte, []int) { return fileDescriptor_cbb99233b75fb80b, []int{9} } + func (m *Weights) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_Weights.Unmarshal(m, 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 - } + return xxx_messageInfo_Weights.Marshal(b, m, deterministic) } func (m *Weights) XXX_Merge(src proto.Message) { xxx_messageInfo_Weights.Merge(m, src) } func (m *Weights) XXX_Size() int { - return m.Size() + return xxx_messageInfo_Weights.Size(m) } func (m *Weights) XXX_DiscardUnknown() { xxx_messageInfo_Weights.DiscardUnknown(m) @@ -602,6 +929,20 @@ func (m *Weights) XXX_DiscardUnknown() { var xxx_messageInfo_Weights proto.InternalMessageInfo +func (m *Weights) GetPassing() int32 { + if m != nil { + return m.Passing + } + return 0 +} + +func (m *Weights) GetWarning() int32 { + if m != nil { + return m.Warning + } + return 0 +} + func init() { proto.RegisterType((*ConnectProxyConfig)(nil), "pbservice.ConnectProxyConfig") proto.RegisterType((*Upstream)(nil), "pbservice.Upstream") @@ -612,3554 +953,83 @@ func init() { proto.RegisterType((*TransparentProxyConfig)(nil), "pbservice.TransparentProxyConfig") 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.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) } +func init() { + proto.RegisterFile("proto/pbservice/service.proto", fileDescriptor_cbb99233b75fb80b) +} var fileDescriptor_cbb99233b75fb80b = []byte{ - // 1216 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x96, 0xdf, 0x6e, 0x13, 0x47, - 0x17, 0xc0, 0xb3, 0x89, 0x1d, 0xdb, 0x27, 0x7c, 0x21, 0x19, 0xf2, 0xd1, 0xad, 0x05, 0x4e, 0xb0, - 0x2a, 0x14, 0xb5, 0xc8, 0x06, 0x22, 0x4a, 0x41, 0xa2, 0x52, 0x13, 0xa7, 0x2d, 0x82, 0x80, 0xbb, - 0x71, 0x85, 0x5a, 0xa9, 0x17, 0xe3, 0xf5, 0x64, 0xbd, 0x8a, 0xbd, 0x63, 0xcd, 0x8c, 0x53, 0xfc, - 0x16, 0xbd, 0xec, 0x0b, 0x70, 0xdf, 0xc7, 0x40, 0xea, 0x0d, 0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, 0xcd, 0xdb, 0x86, - 0xf3, 0xe7, 0xdb, 0x86, 0xf3, 0xcb, 0x45, 0x63, 0xe9, 0xd7, 0x8b, 0xc6, 0xd2, 0x9b, 0x8b, 0xc6, - 0xd2, 0x1f, 0x17, 0x8d, 0xa5, 0x1f, 0x3f, 0x7b, 0xdf, 0x80, 0xc8, 0xfc, 0xdf, 0xef, 0xaf, 0xa2, - 0x60, 0xef, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6d, 0x83, 0xcc, 0x12, 0x72, 0x0c, 0x00, 0x00, + // 1086 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xef, 0x6e, 0x1b, 0x45, + 0x10, 0x97, 0xff, 0xdb, 0x93, 0xe0, 0x24, 0x9b, 0x10, 0x8e, 0xd0, 0xa2, 0xf4, 0x84, 0x4a, 0xd4, + 0x06, 0xbb, 0x4d, 0x24, 0x40, 0x95, 0x88, 0x44, 0xe3, 0x80, 0x2a, 0x9a, 0xd6, 0xba, 0x18, 0x55, + 0x02, 0xf1, 0x61, 0x7d, 0xb7, 0xb1, 0x4f, 0xb9, 0xec, 0x59, 0xbb, 0xeb, 0x50, 0xbf, 0x15, 0x6f, + 0xc0, 0x1b, 0xf0, 0x89, 0x07, 0x42, 0x3b, 0xbb, 0x77, 0x59, 0xdf, 0x1d, 0x15, 0x7c, 0xf2, 0xee, + 0xfc, 0xe6, 0x37, 0xbb, 0x9e, 0xf9, 0xcd, 0xec, 0xc1, 0xc3, 0x85, 0x48, 0x55, 0x3a, 0x5c, 0x4c, + 0x25, 0x13, 0x77, 0x71, 0xc8, 0x86, 0xf6, 0x77, 0x80, 0x76, 0xd2, 0xcb, 0x81, 0x83, 0x07, 0xb3, + 0x34, 0x9d, 0x25, 0x6c, 0x88, 0xc0, 0x74, 0x79, 0x3d, 0x94, 0x4a, 0x2c, 0x43, 0x65, 0x1c, 0x0f,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, 0xc0, 0x21, 0x39, 0xa8, 0x39, 0x25, 0x70, 0x09, 0xfa, 0x8e, 0x17, + 0xef, 0x17, 0xa9, 0x64, 0x5e, 0xd7, 0xde, 0xf1, 0x9e, 0x6a, 0x00, 0xcb, 0xb2, 0x6e, 0x84, 0x40, + 0xf3, 0x32, 0x8d, 0x98, 0xd7, 0xc3, 0x1c, 0xe1, 0x9a, 0x5c, 0xc2, 0xf6, 0x44, 0x50, 0x2e, 0x17, + 0x54, 0x30, 0x6e, 0x8a, 0xe9, 0x01, 0x86, 0x7b, 0xe4, 0x84, 0x2b, 0xba, 0xd8, 0xc0, 0x25, 0xaa, + 0x56, 0x80, 0x9b, 0xcb, 0xab, 0x34, 0xbc, 0x61, 0x6a, 0x4c, 0xd5, 0xdc, 0xdb, 0x30, 0x0a, 0xa8, + 0x46, 0xfd, 0x3f, 0x9b, 0xd0, 0xcd, 0x32, 0x43, 0x8e, 0x60, 0xcb, 0x29, 0xf9, 0x64, 0xb5, 0xc8, + 0xf4, 0x53, 0x34, 0x17, 0x84, 0xa3, 0xb5, 0x24, 0x17, 0x34, 0x64, 0x15, 0xc2, 0xc9, 0xb1, 0x42, + 0x74, 0x54, 0x67, 0xa3, 0x14, 0x1d, 0x65, 0xf9, 0x39, 0xc0, 0x88, 0x2a, 0x1a, 0x32, 0xae, 0x98, + 0x40, 0xa9, 0xf4, 0x02, 0xc7, 0x92, 0x0b, 0xea, 0x65, 0xcc, 0xa3, 0x4c, 0x7f, 0x2d, 0xf4, 0x2a, + 0xd9, 0xc9, 0x17, 0xf0, 0x51, 0x6e, 0x43, 0xe5, 0xb5, 0x51, 0x79, 0xeb, 0x46, 0x47, 0x76, 0x9d, + 0xff, 0x26, 0xbb, 0x82, 0x86, 0xba, 0xff, 0x57, 0x43, 0xcf, 0x60, 0xf7, 0x9c, 0x71, 0x25, 0x68, + 0x92, 0x58, 0x7c, 0x29, 0x58, 0x84, 0x0a, 0xe9, 0x06, 0x55, 0x50, 0xde, 0x77, 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xdb, 0xbe, + 0xfc, 0xea, 0x97, 0xa7, 0xb3, 0x58, 0xcd, 0x97, 0x53, 0x9d, 0xfb, 0xe1, 0x9c, 0xca, 0x79, 0x1c, + 0xa6, 0x62, 0x31, 0x0c, 0x53, 0x2e, 0x97, 0xc9, 0xb0, 0xf0, 0x01, 0x3b, 0x6d, 0xa3, 0xe1, 0xf4, + 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xba, 0x23, 0xd7, 0x20, 0x3f, 0x0b, 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 - if len(m.LocalServiceSocketPath) > 0 { - i -= len(m.LocalServiceSocketPath) - copy(dAtA[i:], m.LocalServiceSocketPath) - i = encodeVarintService(dAtA, i, uint64(len(m.LocalServiceSocketPath))) - i-- - dAtA[i] = 0x5a - } - { - size, err := m.TransparentProxy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - 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] = 0x4a - } - { - 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 - if len(m.DestinationPartition) > 0 { - i -= len(m.DestinationPartition) - copy(dAtA[i:], m.DestinationPartition) - i = encodeVarintService(dAtA, i, uint64(len(m.DestinationPartition))) - i-- - dAtA[i] = 0x62 - } - if len(m.LocalBindSocketMode) > 0 { - i -= len(m.LocalBindSocketMode) - copy(dAtA[i:], m.LocalBindSocketMode) - i = encodeVarintService(dAtA, i, uint64(len(m.LocalBindSocketMode))) - i-- - dAtA[i] = 0x5a - } - if len(m.LocalBindSocketPath) > 0 { - i -= len(m.LocalBindSocketPath) - copy(dAtA[i:], m.LocalBindSocketPath) - i = encodeVarintService(dAtA, i, uint64(len(m.LocalBindSocketPath))) - i-- - dAtA[i] = 0x52 - } - if m.CentrallyConfigured { - i-- - if m.CentrallyConfigured { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x48 - } - { - 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 *TransparentProxyConfig) 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 *TransparentProxyConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TransparentProxyConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DialedDirectly { - i-- - if m.DialedDirectly { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.OutboundListenerPort != 0 { - i = encodeVarintService(dAtA, i, uint64(m.OutboundListenerPort)) - i-- - dAtA[i] = 0x8 - } - 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 len(m.SocketPath) > 0 { - i -= len(m.SocketPath) - copy(dAtA[i:], m.SocketPath) - i = encodeVarintService(dAtA, i, uint64(len(m.SocketPath))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 - } - { - 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)) - l = len(m.Mode) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - l = m.TransparentProxy.Size() - n += 1 + l + sovService(uint64(l)) - l = len(m.LocalServiceSocketPath) - if l > 0 { - 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)) - if m.CentrallyConfigured { - n += 2 - } - l = len(m.LocalBindSocketPath) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - l = len(m.LocalBindSocketMode) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - l = len(m.DestinationPartition) - if l > 0 { - 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 *TransparentProxyConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.OutboundListenerPort != 0 { - n += 1 + sovService(uint64(m.OutboundListenerPort)) - } - if m.DialedDirectly { - n += 2 - } - 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)) - l = len(m.SocketPath) - if l > 0 { - 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 - case 9: - 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.ProxyMode(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TransparentProxy", 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.TransparentProxy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LocalServiceSocketPath", 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.LocalServiceSocketPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipService(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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 - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CentrallyConfigured", 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.CentrallyConfigured = bool(v != 0) - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LocalBindSocketPath", 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.LocalBindSocketPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LocalBindSocketMode", 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.LocalBindSocketMode = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationPartition", 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.DestinationPartition = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipService(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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) || (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) || (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) || (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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthService - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TransparentProxyConfig) 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: TransparentProxyConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TransparentProxyConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OutboundListenerPort", wireType) - } - m.OutboundListenerPort = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.OutboundListenerPort |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DialedDirectly", 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.DialedDirectly = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipService(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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) || (iNdEx+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) || (iNdEx+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 - case 18: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SocketPath", 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.SocketPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipService(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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) || (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) || (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 - depth := 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 - } - } - case 1: - iNdEx += 8 - 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 - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupService - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthService - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthService = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowService = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupService = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/pbservice/service.proto b/proto/pbservice/service.proto index 360e3e3ff..64860625b 100644 --- a/proto/pbservice/service.proto +++ b/proto/pbservice/service.proto @@ -5,17 +5,9 @@ package pbservice; option go_package = "github.com/hashicorp/consul/proto/pbservice"; import "google/protobuf/struct.proto"; -import "proto/pbcommongogo/common.proto"; +import "proto/pbcommon/common.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 @@ -57,25 +49,26 @@ message ConnectProxyConfig { // Config is the arbitrary configuration data provided with the proxy // registration. // mog: func-to=ProtobufTypesStructToMapStringInterface func-from=MapStringInterfaceToProtobufTypesStruct - google.protobuf.Struct Config = 5 [(gogoproto.nullable) = true]; + google.protobuf.Struct Config = 5; // Upstreams describes any upstream dependencies the proxy instance should // setup. // mog: func-to=UpstreamsToStructs func-from=NewUpstreamsFromStructs - repeated Upstream Upstreams = 6 [(gogoproto.nullable) = false]; + repeated Upstream Upstreams = 6; // MeshGateway defines the mesh gateway configuration for upstreams - MeshGatewayConfig MeshGateway = 7 [(gogoproto.nullable) = false]; + MeshGatewayConfig MeshGateway = 7; // Expose defines whether checks or paths are exposed through the proxy - ExposeConfig Expose = 8 [(gogoproto.nullable) = false]; + ExposeConfig Expose = 8; // Mode represents how the proxy's inbound and upstream listeners are dialed. - string Mode = 9 [(gogoproto.casttype) = "github.com/hashicorp/consul/agent/structs.ProxyMode"]; + // mog: func-to=structs.ProxyMode func-from=string + string Mode = 9; // TransparentProxy defines configuration for when the proxy is in // transparent mode. - TransparentProxyConfig TransparentProxy = 10 [(gogoproto.nullable) = false]; + TransparentProxyConfig TransparentProxy = 10; // LocalServiceSocketPath is the path to the unix domain socket for the local service instance string LocalServiceSocketPath = 11; @@ -122,10 +115,10 @@ message Upstream { // It can be used to pass arbitrary configuration for this specific upstream // to the proxy. // mog: func-to=ProtobufTypesStructToMapStringInterface func-from=MapStringInterfaceToProtobufTypesStruct - google.protobuf.Struct Config = 7 [(gogoproto.nullable) = true]; + google.protobuf.Struct Config = 7; // MeshGateway is the configuration for mesh gateway usage of this upstream - MeshGatewayConfig MeshGateway = 8 [(gogoproto.nullable) = false]; + MeshGatewayConfig MeshGateway = 8; // CentrallyConfigured indicates whether the upstream was defined in a proxy // instance registration or whether it was generated from a config entry. @@ -174,7 +167,7 @@ message ExposeConfig { // Paths is the list of paths exposed through the proxy. // mog: func-to=ExposePathSliceToStructs func-from=NewExposePathSliceFromStructs - repeated ExposePath Paths = 2 [(gogoproto.nullable) = false]; + repeated ExposePath Paths = 2; } // mog annotation: @@ -208,7 +201,8 @@ message ExposePath { // output=service.gen.go // name=Structs message MeshGatewayConfig { - string Mode = 1 [(gogoproto.casttype) = "github.com/hashicorp/consul/agent/structs.MeshGatewayMode"]; + // mog: func-to=structs.MeshGatewayMode func-from=string + string Mode = 1; } // mog annotation: @@ -235,19 +229,20 @@ message TransparentProxyConfig { // output=service.gen.go // name=Structs message ServiceDefinition { - string Kind = 1 [(gogoproto.casttype) = "github.com/hashicorp/consul/agent/structs.ServiceKind"]; + // mog: func-to=structs.ServiceKind func-from=string + string Kind = 1; 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 TaggedAddresses = 16; map Meta = 6; // mog: func-to=int func-from=int32 int32 Port = 7; // Path for socket string SocketPath = 18; - CheckType Check = 8 [(gogoproto.nullable) = false]; + CheckType Check = 8; // mog: func-to=CheckTypesToStructs func-from=NewCheckTypesFromStructs repeated CheckType Checks = 9; // mog: func-to=WeightsPtrToStructs func-from=NewWeightsPtrFromStructs @@ -269,7 +264,7 @@ message ServiceDefinition { ConnectProxyConfig Proxy = 14; // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs - commongogo.EnterpriseMeta EnterpriseMeta = 17 [(gogoproto.nullable) = false]; + common.EnterpriseMeta EnterpriseMeta = 17; // mog: func-to=ServiceConnectPtrToStructs func-from=NewServiceConnectPtrFromStructs ServiceConnect Connect = 15; diff --git a/proto/pbsubscribe/subscribe.pb.go b/proto/pbsubscribe/subscribe.pb.go index 98ad79087..9df5bba25 100644 --- a/proto/pbsubscribe/subscribe.pb.go +++ b/proto/pbsubscribe/subscribe.pb.go @@ -1,4 +1,4 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: proto/pbsubscribe/subscribe.proto package pbsubscribe @@ -11,9 +11,7 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - io "io" math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -129,26 +127,18 @@ func (*SubscribeRequest) ProtoMessage() {} func (*SubscribeRequest) Descriptor() ([]byte, []int) { return fileDescriptor_ab3eb8c810e315fb, []int{0} } + func (m *SubscribeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_SubscribeRequest.Unmarshal(m, b) } func (m *SubscribeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SubscribeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_SubscribeRequest.Marshal(b, m, deterministic) } func (m *SubscribeRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_SubscribeRequest.Merge(m, src) } func (m *SubscribeRequest) XXX_Size() int { - return m.Size() + return xxx_messageInfo_SubscribeRequest.Size(m) } func (m *SubscribeRequest) XXX_DiscardUnknown() { xxx_messageInfo_SubscribeRequest.DiscardUnknown(m) @@ -234,26 +224,18 @@ func (*Event) ProtoMessage() {} func (*Event) Descriptor() ([]byte, []int) { return fileDescriptor_ab3eb8c810e315fb, []int{1} } + func (m *Event) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_Event.Unmarshal(m, b) } func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Event.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_Event.Marshal(b, m, deterministic) } func (m *Event) XXX_Merge(src proto.Message) { xxx_messageInfo_Event.Merge(m, src) } func (m *Event) XXX_Size() int { - return m.Size() + return xxx_messageInfo_Event.Size(m) } func (m *Event) XXX_DiscardUnknown() { xxx_messageInfo_Event.DiscardUnknown(m) @@ -261,29 +243,40 @@ func (m *Event) XXX_DiscardUnknown() { var xxx_messageInfo_Event proto.InternalMessageInfo +func (m *Event) GetIndex() uint64 { + if m != nil { + return m.Index + } + return 0 +} + type isEvent_Payload interface { isEvent_Payload() - MarshalTo([]byte) (int, error) - Size() int } type Event_EndOfSnapshot struct { - EndOfSnapshot bool `protobuf:"varint,2,opt,name=EndOfSnapshot,proto3,oneof" json:"EndOfSnapshot,omitempty"` -} -type Event_NewSnapshotToFollow struct { - NewSnapshotToFollow bool `protobuf:"varint,3,opt,name=NewSnapshotToFollow,proto3,oneof" json:"NewSnapshotToFollow,omitempty"` -} -type Event_EventBatch struct { - EventBatch *EventBatch `protobuf:"bytes,4,opt,name=EventBatch,proto3,oneof" json:"EventBatch,omitempty"` -} -type Event_ServiceHealth struct { - ServiceHealth *ServiceHealthUpdate `protobuf:"bytes,10,opt,name=ServiceHealth,proto3,oneof" json:"ServiceHealth,omitempty"` + EndOfSnapshot bool `protobuf:"varint,2,opt,name=EndOfSnapshot,proto3,oneof"` } -func (*Event_EndOfSnapshot) isEvent_Payload() {} +type Event_NewSnapshotToFollow struct { + NewSnapshotToFollow bool `protobuf:"varint,3,opt,name=NewSnapshotToFollow,proto3,oneof"` +} + +type Event_EventBatch struct { + EventBatch *EventBatch `protobuf:"bytes,4,opt,name=EventBatch,proto3,oneof"` +} + +type Event_ServiceHealth struct { + ServiceHealth *ServiceHealthUpdate `protobuf:"bytes,10,opt,name=ServiceHealth,proto3,oneof"` +} + +func (*Event_EndOfSnapshot) isEvent_Payload() {} + func (*Event_NewSnapshotToFollow) isEvent_Payload() {} -func (*Event_EventBatch) isEvent_Payload() {} -func (*Event_ServiceHealth) isEvent_Payload() {} + +func (*Event_EventBatch) isEvent_Payload() {} + +func (*Event_ServiceHealth) isEvent_Payload() {} func (m *Event) GetPayload() isEvent_Payload { if m != nil { @@ -292,13 +285,6 @@ func (m *Event) GetPayload() isEvent_Payload { return nil } -func (m *Event) GetIndex() uint64 { - if m != nil { - return m.Index - } - return 0 -} - func (m *Event) GetEndOfSnapshot() bool { if x, ok := m.GetPayload().(*Event_EndOfSnapshot); ok { return x.EndOfSnapshot @@ -350,26 +336,18 @@ func (*EventBatch) ProtoMessage() {} func (*EventBatch) Descriptor() ([]byte, []int) { return fileDescriptor_ab3eb8c810e315fb, []int{2} } + func (m *EventBatch) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_EventBatch.Unmarshal(m, b) } func (m *EventBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventBatch.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_EventBatch.Marshal(b, m, deterministic) } func (m *EventBatch) XXX_Merge(src proto.Message) { xxx_messageInfo_EventBatch.Merge(m, src) } func (m *EventBatch) XXX_Size() int { - return m.Size() + return xxx_messageInfo_EventBatch.Size(m) } func (m *EventBatch) XXX_DiscardUnknown() { xxx_messageInfo_EventBatch.DiscardUnknown(m) @@ -398,26 +376,18 @@ func (*ServiceHealthUpdate) ProtoMessage() {} func (*ServiceHealthUpdate) Descriptor() ([]byte, []int) { return fileDescriptor_ab3eb8c810e315fb, []int{3} } + func (m *ServiceHealthUpdate) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_ServiceHealthUpdate.Unmarshal(m, b) } func (m *ServiceHealthUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ServiceHealthUpdate.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_ServiceHealthUpdate.Marshal(b, m, deterministic) } func (m *ServiceHealthUpdate) XXX_Merge(src proto.Message) { xxx_messageInfo_ServiceHealthUpdate.Merge(m, src) } func (m *ServiceHealthUpdate) XXX_Size() int { - return m.Size() + return xxx_messageInfo_ServiceHealthUpdate.Size(m) } func (m *ServiceHealthUpdate) XXX_DiscardUnknown() { xxx_messageInfo_ServiceHealthUpdate.DiscardUnknown(m) @@ -448,54 +418,54 @@ func init() { proto.RegisterType((*ServiceHealthUpdate)(nil), "subscribe.ServiceHealthUpdate") } -func init() { proto.RegisterFile("proto/pbsubscribe/subscribe.proto", fileDescriptor_ab3eb8c810e315fb) } +func init() { + proto.RegisterFile("proto/pbsubscribe/subscribe.proto", fileDescriptor_ab3eb8c810e315fb) +} var fileDescriptor_ab3eb8c810e315fb = []byte{ - // 550 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x53, 0xcb, 0x6e, 0xd3, 0x4c, - 0x14, 0xf6, 0xa4, 0x57, 0x9f, 0xfc, 0xad, 0xfc, 0x4f, 0x83, 0xb0, 0x52, 0x64, 0x85, 0x08, 0x55, - 0xa1, 0x12, 0x31, 0x0a, 0x12, 0xec, 0x40, 0x24, 0x6d, 0x09, 0x42, 0x4a, 0x2a, 0xa7, 0x5d, 0xc0, - 0x6e, 0x62, 0x1f, 0x62, 0x2b, 0xee, 0x8c, 0xb1, 0x27, 0x0d, 0xdd, 0xc3, 0x3b, 0xf0, 0x48, 0x2c, - 0x59, 0xf0, 0x00, 0x28, 0xbc, 0x08, 0xf2, 0xc4, 0x71, 0x9c, 0xa4, 0xbb, 0x39, 0xdf, 0x65, 0xce, - 0xcc, 0xb9, 0xc0, 0xe3, 0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04, 0x38, 0xc3, 0x78, 0x11, 0x93, 0xd6, 0x47, 0x78, 0x38, 0x90, 0x4c, 0x62, 0xc7, 0x67, - 0x7c, 0x84, 0xd9, 0x56, 0x44, 0xe9, 0x3c, 0xd1, 0xd7, 0xa0, 0xe7, 0x5b, 0x42, 0x8f, 0x8b, 0x0d, - 0x59, 0xdb, 0x9d, 0xea, 0x46, 0x4d, 0xeb, 0xda, 0x73, 0xd2, 0x7e, 0xf3, 0x73, 0x66, 0x91, 0x5f, - 0x33, 0x8b, 0xfc, 0x99, 0x59, 0xe4, 0xc7, 0x5f, 0x4b, 0xfb, 0xf4, 0x6c, 0x14, 0x48, 0x7f, 0x32, - 0x6c, 0xba, 0xe2, 0xc6, 0xf6, 0x59, 0xe2, 0x07, 0xae, 0x88, 0x23, 0xdb, 0x15, 0x3c, 0x99, 0x84, - 0xf6, 0xc6, 0x7a, 0x0f, 0x77, 0x15, 0xf4, 0xe2, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc9, 0xb6, - 0x48, 0xa0, 0xfa, 0x03, 0x00, 0x00, + // 527 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x53, 0x5d, 0x6f, 0xda, 0x3c, + 0x14, 0xc6, 0xb4, 0x85, 0xe6, 0xf0, 0xb6, 0xca, 0xeb, 0x32, 0x2d, 0xa2, 0x53, 0xc5, 0xd0, 0x54, + 0xb1, 0x4a, 0x23, 0x13, 0x93, 0xb6, 0xbb, 0x49, 0x83, 0xb6, 0x63, 0x9a, 0x04, 0x55, 0x68, 0x2f, + 0xb6, 0x3b, 0xe3, 0x9c, 0x91, 0x88, 0xd4, 0xf6, 0x12, 0x53, 0xd6, 0xfb, 0xed, 0x1f, 0xee, 0x07, + 0x4d, 0x31, 0x21, 0x04, 0xe8, 0x9d, 0xcf, 0xf3, 0xe1, 0x63, 0x9f, 0x0f, 0x78, 0xa9, 0x62,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x62, 0xbc, 0x8a, 0x49, 0xf7, + 0x1b, 0x3c, 0x1f, 0x6b, 0xa6, 0xb1, 0x1f, 0x30, 0x31, 0xc5, 0x6c, 0x2b, 0x54, 0x3a, 0x4f, 0xf4, + 0x23, 0x58, 0xf9, 0x96, 0xd0, 0xd3, 0x62, 0x43, 0xb6, 0x76, 0xa7, 0xb1, 0x53, 0xd3, 0x56, 0xe9, + 0x2d, 0xe9, 0xb9, 0xdf, 0xdf, 0x4c, 0x43, 0x1d, 0xcc, 0x27, 0x1d, 0x2e, 0xef, 0xdd, 0x80, 0x25, + 0x41, 0xc8, 0x65, 0xac, 0x5c, 0x2e, 0x45, 0x32, 0x8f, 0xdc, 0x9d, 0x75, 0x9e, 0x54, 0x0c, 0xf4, + 0xee, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0xb3, 0x69, 0x51, 0xea, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConn +var _ grpc.ClientConnInterface // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +const _ = grpc.SupportPackageIsVersion6 // StateChangeSubscriptionClient is the client API for StateChangeSubscription service. // @@ -524,10 +494,10 @@ type StateChangeSubscriptionClient interface { } type stateChangeSubscriptionClient struct { - cc *grpc.ClientConn + cc grpc.ClientConnInterface } -func NewStateChangeSubscriptionClient(cc *grpc.ClientConn) StateChangeSubscriptionClient { +func NewStateChangeSubscriptionClient(cc grpc.ClientConnInterface) StateChangeSubscriptionClient { return &stateChangeSubscriptionClient{cc} } @@ -633,1136 +603,3 @@ var _StateChangeSubscription_serviceDesc = grpc.ServiceDesc{ }, Metadata: "proto/pbsubscribe/subscribe.proto", } - -func (m *SubscribeRequest) 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 *SubscribeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SubscribeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Partition) > 0 { - i -= len(m.Partition) - copy(dAtA[i:], m.Partition) - i = encodeVarintSubscribe(dAtA, i, uint64(len(m.Partition))) - i-- - dAtA[i] = 0x3a - } - if len(m.Namespace) > 0 { - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarintSubscribe(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0x32 - } - if len(m.Datacenter) > 0 { - i -= len(m.Datacenter) - copy(dAtA[i:], m.Datacenter) - i = encodeVarintSubscribe(dAtA, i, uint64(len(m.Datacenter))) - i-- - dAtA[i] = 0x2a - } - if m.Index != 0 { - i = encodeVarintSubscribe(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x20 - } - if len(m.Token) > 0 { - i -= len(m.Token) - copy(dAtA[i:], m.Token) - i = encodeVarintSubscribe(dAtA, i, uint64(len(m.Token))) - i-- - dAtA[i] = 0x1a - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintSubscribe(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x12 - } - if m.Topic != 0 { - i = encodeVarintSubscribe(dAtA, i, uint64(m.Topic)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Event) 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 *Event) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Payload != nil { - { - size := m.Payload.Size() - i -= size - if _, err := m.Payload.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.Index != 0 { - i = encodeVarintSubscribe(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Event_EndOfSnapshot) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Event_EndOfSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i-- - if m.EndOfSnapshot { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - return len(dAtA) - i, nil -} -func (m *Event_NewSnapshotToFollow) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Event_NewSnapshotToFollow) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i-- - if m.NewSnapshotToFollow { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - return len(dAtA) - i, nil -} -func (m *Event_EventBatch) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Event_EventBatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.EventBatch != nil { - { - size, err := m.EventBatch.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSubscribe(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *Event_ServiceHealth) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Event_ServiceHealth) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ServiceHealth != nil { - { - size, err := m.ServiceHealth.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSubscribe(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - return len(dAtA) - i, nil -} -func (m *EventBatch) 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 *EventBatch) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventBatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSubscribe(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ServiceHealthUpdate) 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 *ServiceHealthUpdate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceHealthUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.CheckServiceNode != nil { - { - size, err := m.CheckServiceNode.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSubscribe(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Op != 0 { - i = encodeVarintSubscribe(dAtA, i, uint64(m.Op)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintSubscribe(dAtA []byte, offset int, v uint64) int { - offset -= sovSubscribe(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *SubscribeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Topic != 0 { - n += 1 + sovSubscribe(uint64(m.Topic)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovSubscribe(uint64(l)) - } - l = len(m.Token) - if l > 0 { - n += 1 + l + sovSubscribe(uint64(l)) - } - if m.Index != 0 { - n += 1 + sovSubscribe(uint64(m.Index)) - } - l = len(m.Datacenter) - if l > 0 { - n += 1 + l + sovSubscribe(uint64(l)) - } - l = len(m.Namespace) - if l > 0 { - n += 1 + l + sovSubscribe(uint64(l)) - } - l = len(m.Partition) - if l > 0 { - n += 1 + l + sovSubscribe(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Event) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Index != 0 { - n += 1 + sovSubscribe(uint64(m.Index)) - } - if m.Payload != nil { - n += m.Payload.Size() - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Event_EndOfSnapshot) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 2 - return n -} -func (m *Event_NewSnapshotToFollow) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 2 - return n -} -func (m *Event_EventBatch) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.EventBatch != nil { - l = m.EventBatch.Size() - n += 1 + l + sovSubscribe(uint64(l)) - } - return n -} -func (m *Event_ServiceHealth) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ServiceHealth != nil { - l = m.ServiceHealth.Size() - n += 1 + l + sovSubscribe(uint64(l)) - } - return n -} -func (m *EventBatch) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovSubscribe(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ServiceHealthUpdate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Op != 0 { - n += 1 + sovSubscribe(uint64(m.Op)) - } - if m.CheckServiceNode != nil { - l = m.CheckServiceNode.Size() - n += 1 + l + sovSubscribe(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovSubscribe(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSubscribe(x uint64) (n int) { - return sovSubscribe(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *SubscribeRequest) 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 ErrIntOverflowSubscribe - } - 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: SubscribeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SubscribeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) - } - m.Topic = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscribe - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Topic |= Topic(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscribe - } - 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 ErrInvalidLengthSubscribe - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscribe - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - 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 ErrIntOverflowSubscribe - } - 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 ErrInvalidLengthSubscribe - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscribe - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Token = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscribe - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - 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 ErrIntOverflowSubscribe - } - 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 ErrInvalidLengthSubscribe - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscribe - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Datacenter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscribe - } - 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 ErrInvalidLengthSubscribe - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscribe - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Namespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Partition", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscribe - } - 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 ErrInvalidLengthSubscribe - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscribe - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Partition = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSubscribe(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSubscribe - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Event) 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 ErrIntOverflowSubscribe - } - 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: Event: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscribe - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndOfSnapshot", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscribe - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Payload = &Event_EndOfSnapshot{b} - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NewSnapshotToFollow", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscribe - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Payload = &Event_NewSnapshotToFollow{b} - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EventBatch", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscribe - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSubscribe - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSubscribe - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &EventBatch{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Payload = &Event_EventBatch{v} - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceHealth", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscribe - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSubscribe - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSubscribe - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ServiceHealthUpdate{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Payload = &Event_ServiceHealth{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSubscribe(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSubscribe - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventBatch) 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 ErrIntOverflowSubscribe - } - 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: EventBatch: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventBatch: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscribe - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSubscribe - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSubscribe - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Events = append(m.Events, &Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSubscribe(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSubscribe - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ServiceHealthUpdate) 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 ErrIntOverflowSubscribe - } - 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: ServiceHealthUpdate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceHealthUpdate: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Op", wireType) - } - m.Op = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscribe - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Op |= CatalogOp(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CheckServiceNode", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscribe - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSubscribe - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSubscribe - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CheckServiceNode == nil { - m.CheckServiceNode = &pbservice.CheckServiceNode{} - } - if err := m.CheckServiceNode.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSubscribe(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSubscribe - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSubscribe(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSubscribe - } - 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, ErrIntOverflowSubscribe - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSubscribe - } - 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, ErrInvalidLengthSubscribe - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSubscribe - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSubscribe - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthSubscribe = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSubscribe = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSubscribe = fmt.Errorf("proto: unexpected end of group") -)