replumbing a bunch of api and agent structs for partitions (#10681)
This commit is contained in:
parent
254557a1f6
commit
b2facb35a9
|
@ -21,6 +21,6 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
ConsulCompoundServiceID = NewServiceID(ConsulServiceID, nil)
|
||||
SerfCompoundCheckID = NewCheckID(SerfCheckID, nil)
|
||||
ConsulCompoundServiceID = NewServiceID(ConsulServiceID, nil) // TODO(partitions): delete this in favor of IsConsulServiceID(ServiceID)
|
||||
SerfCompoundCheckID = NewCheckID(SerfCheckID, nil) // TODO(partitions): delete this in favor of IsSerfCheckID(CheckID)
|
||||
)
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
// +build !consulent
|
||||
|
||||
package structs
|
||||
|
||||
func IsConsulServiceID(id ServiceID) bool {
|
||||
return id.ID == ConsulServiceID
|
||||
}
|
||||
|
||||
func IsSerfCheckID(id CheckID) bool {
|
||||
return id.ID == SerfCheckID
|
||||
}
|
|
@ -407,6 +407,7 @@ type RegisterRequest struct {
|
|||
// node portion of this update will not apply.
|
||||
SkipNodeUpdate bool
|
||||
|
||||
// TODO(partitions): ensure the partition part is used for node reg
|
||||
// EnterpriseMeta is the embedded enterprise metadata
|
||||
EnterpriseMeta `hcl:",squash" mapstructure:",squash"`
|
||||
|
||||
|
@ -436,6 +437,7 @@ func (r *RegisterRequest) ChangesNode(node *Node) bool {
|
|||
// Check if any of the node-level fields are being changed.
|
||||
if r.ID != node.ID ||
|
||||
r.Node != node.Node ||
|
||||
// TODO(partitions): do we need to check partition here?
|
||||
r.Address != node.Address ||
|
||||
r.Datacenter != node.Datacenter ||
|
||||
!reflect.DeepEqual(r.TaggedAddresses, node.TaggedAddresses) ||
|
||||
|
@ -450,10 +452,11 @@ func (r *RegisterRequest) ChangesNode(node *Node) bool {
|
|||
// to deregister a node as providing a service. If no service is
|
||||
// provided the entire node is deregistered.
|
||||
type DeregisterRequest struct {
|
||||
Datacenter string
|
||||
Node string
|
||||
ServiceID string
|
||||
CheckID types.CheckID
|
||||
Datacenter string
|
||||
Node string
|
||||
ServiceID string
|
||||
CheckID types.CheckID
|
||||
// TODO(partitions): ensure the partition part is used for node reg
|
||||
EnterpriseMeta `hcl:",squash" mapstructure:",squash"`
|
||||
WriteRequest
|
||||
}
|
||||
|
@ -481,10 +484,19 @@ func (r *DeregisterRequest) UnmarshalJSON(data []byte) error {
|
|||
// in queries so that we can adjust the response based on its network
|
||||
// coordinates.
|
||||
type QuerySource struct {
|
||||
Datacenter string
|
||||
Segment string
|
||||
Node string
|
||||
Ip string
|
||||
Datacenter string
|
||||
Segment string
|
||||
Node string
|
||||
NodePartition string `json:",omitempty"`
|
||||
Ip string
|
||||
}
|
||||
|
||||
func (s QuerySource) NodeEnterpriseMeta() *EnterpriseMeta {
|
||||
return NodeEnterpriseMetaInPartition(s.NodePartition)
|
||||
}
|
||||
|
||||
func (s QuerySource) NodePartitionOrDefault() string {
|
||||
return PartitionOrDefault(s.NodePartition)
|
||||
}
|
||||
|
||||
type DatacentersRequest struct {
|
||||
|
@ -737,12 +749,21 @@ type Node struct {
|
|||
Node string
|
||||
Address string
|
||||
Datacenter string
|
||||
Partition string `json:",omitempty"`
|
||||
TaggedAddresses map[string]string
|
||||
Meta map[string]string
|
||||
|
||||
RaftIndex `bexpr:"-"`
|
||||
}
|
||||
|
||||
func (n *Node) GetEnterpriseMeta() *EnterpriseMeta {
|
||||
return NodeEnterpriseMetaInPartition(n.Partition)
|
||||
}
|
||||
|
||||
func (n *Node) PartitionOrDefault() string {
|
||||
return PartitionOrDefault(n.Partition)
|
||||
}
|
||||
|
||||
func (n *Node) BestAddress(wan bool) string {
|
||||
if wan {
|
||||
if addr, ok := n.TaggedAddresses[TaggedAddressWAN]; ok {
|
||||
|
@ -759,6 +780,7 @@ type Nodes []*Node
|
|||
func (n *Node) IsSame(other *Node) bool {
|
||||
return n.ID == other.ID &&
|
||||
n.Node == other.Node &&
|
||||
n.PartitionOrDefault() == other.PartitionOrDefault() &&
|
||||
n.Address == other.Address &&
|
||||
n.Datacenter == other.Datacenter &&
|
||||
reflect.DeepEqual(n.TaggedAddresses, other.TaggedAddresses) &&
|
||||
|
@ -877,15 +899,12 @@ type ServiceNode struct {
|
|||
ServiceProxy ConnectProxyConfig
|
||||
ServiceConnect ServiceConnect
|
||||
|
||||
// TODO(partitions): ensure that Node+Service are both in the same Partition
|
||||
EnterpriseMeta `hcl:",squash" mapstructure:",squash" bexpr:"-"`
|
||||
|
||||
RaftIndex `bexpr:"-"`
|
||||
}
|
||||
|
||||
func (s *ServiceNode) NodeIdentity() Identity {
|
||||
return Identity{ID: s.Node}
|
||||
}
|
||||
|
||||
// PartialClone() returns a clone of the given service node, minus the node-
|
||||
// related fields that get filled in later, Address and TaggedAddresses.
|
||||
func (s *ServiceNode) PartialClone() *ServiceNode {
|
||||
|
@ -1082,6 +1101,7 @@ type NodeService struct {
|
|||
// somewhere this is used in API output.
|
||||
LocallyRegisteredAsSidecar bool `json:"-" bexpr:"-"`
|
||||
|
||||
// TODO(partitions): ensure that Node+Service are both in the same Partition
|
||||
EnterpriseMeta `hcl:",squash" mapstructure:",squash" bexpr:"-"`
|
||||
|
||||
RaftIndex `bexpr:"-"`
|
||||
|
@ -1139,6 +1159,7 @@ func (ns *NodeService) CompoundServiceName() ServiceName {
|
|||
//
|
||||
// Note: We do not have strict character restrictions in all node names, so this should NOT be split on / to retrieve components.
|
||||
func UniqueID(node string, compoundID string) string {
|
||||
// TODO(partitions)
|
||||
return fmt.Sprintf("%s/%s", node, compoundID)
|
||||
}
|
||||
|
||||
|
@ -1198,6 +1219,8 @@ func (s *NodeService) IsGateway() bool {
|
|||
func (s *NodeService) Validate() error {
|
||||
var result error
|
||||
|
||||
// TODO(partitions): remember to double check that this doesn't cross partition boundaries
|
||||
|
||||
// ConnectProxy validation
|
||||
if s.Kind == ServiceKindConnectProxy {
|
||||
if strings.TrimSpace(s.Proxy.DestinationServiceName) == "" {
|
||||
|
@ -1467,7 +1490,10 @@ type HealthCheck struct {
|
|||
}
|
||||
|
||||
func (hc *HealthCheck) NodeIdentity() Identity {
|
||||
return Identity{ID: hc.Node}
|
||||
return Identity{
|
||||
ID: hc.Node,
|
||||
EnterpriseMeta: *hc.NodeEnterpriseMetaForPartition(),
|
||||
}
|
||||
}
|
||||
|
||||
func (hc *HealthCheck) CompoundServiceID() ServiceID {
|
||||
|
@ -1787,6 +1813,7 @@ OUTER:
|
|||
type NodeInfo struct {
|
||||
ID types.NodeID
|
||||
Node string
|
||||
Partition string `json:",omitempty"`
|
||||
Address string
|
||||
TaggedAddresses map[string]string
|
||||
Meta map[string]string
|
||||
|
@ -2239,7 +2266,7 @@ type Sessions []*Session
|
|||
type Session struct {
|
||||
ID string
|
||||
Name string
|
||||
Node string
|
||||
Node string // TODO(partitions): ensure that the entmeta interacts with this node field properly
|
||||
LockDelay time.Duration
|
||||
Behavior SessionBehavior // What to do when session is invalidated
|
||||
TTL string
|
||||
|
@ -2328,9 +2355,18 @@ type IndexedSessions struct {
|
|||
|
||||
// Coordinate stores a node name with its associated network coordinate.
|
||||
type Coordinate struct {
|
||||
Node string
|
||||
Segment string
|
||||
Coord *coordinate.Coordinate
|
||||
Node string
|
||||
Segment string
|
||||
Partition string `json:",omitempty"` // TODO(partitions): fully thread this needle
|
||||
Coord *coordinate.Coordinate
|
||||
}
|
||||
|
||||
func (c *Coordinate) GetEnterpriseMeta() *EnterpriseMeta {
|
||||
return NodeEnterpriseMetaInPartition(c.Partition)
|
||||
}
|
||||
|
||||
func (c *Coordinate) PartitionOrDefault() string {
|
||||
return PartitionOrDefault(c.Partition)
|
||||
}
|
||||
|
||||
type Coordinates []*Coordinate
|
||||
|
@ -2361,10 +2397,11 @@ type DatacenterMap struct {
|
|||
// CoordinateUpdateRequest is used to update the network coordinate of a given
|
||||
// node.
|
||||
type CoordinateUpdateRequest struct {
|
||||
Datacenter string
|
||||
Node string
|
||||
Segment string
|
||||
Coord *coordinate.Coordinate
|
||||
Datacenter string
|
||||
Node string
|
||||
Segment string
|
||||
Coord *coordinate.Coordinate
|
||||
EnterpriseMeta `hcl:",squash" mapstructure:",squash"`
|
||||
WriteRequest
|
||||
}
|
||||
|
||||
|
|
|
@ -299,6 +299,11 @@ var expectedFieldConfigNode bexpr.FieldConfigurations = bexpr.FieldConfiguration
|
|||
CoerceFn: bexpr.CoerceString,
|
||||
SupportedOperations: []bexpr.MatchOperator{bexpr.MatchEqual, bexpr.MatchNotEqual, bexpr.MatchIn, bexpr.MatchNotIn, bexpr.MatchMatches, bexpr.MatchNotMatches},
|
||||
},
|
||||
"Partition": &bexpr.FieldConfiguration{
|
||||
StructFieldName: "Partition",
|
||||
CoerceFn: bexpr.CoerceString,
|
||||
SupportedOperations: []bexpr.MatchOperator{bexpr.MatchEqual, bexpr.MatchNotEqual, bexpr.MatchIn, bexpr.MatchNotIn, bexpr.MatchMatches, bexpr.MatchNotMatches},
|
||||
},
|
||||
"Address": &bexpr.FieldConfiguration{
|
||||
StructFieldName: "Address",
|
||||
CoerceFn: bexpr.CoerceString,
|
||||
|
@ -584,6 +589,11 @@ var expectedFieldConfigNodeInfo bexpr.FieldConfigurations = bexpr.FieldConfigura
|
|||
CoerceFn: bexpr.CoerceString,
|
||||
SupportedOperations: []bexpr.MatchOperator{bexpr.MatchEqual, bexpr.MatchNotEqual, bexpr.MatchIn, bexpr.MatchNotIn, bexpr.MatchMatches, bexpr.MatchNotMatches},
|
||||
},
|
||||
"Partition": &bexpr.FieldConfiguration{
|
||||
StructFieldName: "Partition",
|
||||
CoerceFn: bexpr.CoerceString,
|
||||
SupportedOperations: []bexpr.MatchOperator{bexpr.MatchEqual, bexpr.MatchNotEqual, bexpr.MatchIn, bexpr.MatchNotIn, bexpr.MatchMatches, bexpr.MatchNotMatches},
|
||||
},
|
||||
"Address": &bexpr.FieldConfiguration{
|
||||
StructFieldName: "Address",
|
||||
CoerceFn: bexpr.CoerceString,
|
||||
|
|
|
@ -110,6 +110,7 @@ func NodeEnterpriseMetaInPartition(_ string) *EnterpriseMeta {
|
|||
return &emptyEnterpriseMeta
|
||||
}
|
||||
|
||||
// TODO(partition): stop using this
|
||||
func NodeEnterpriseMetaInDefaultPartition() *EnterpriseMeta {
|
||||
return &emptyEnterpriseMeta
|
||||
}
|
||||
|
@ -213,3 +214,7 @@ func (t *Intention) HasWildcardSource() bool {
|
|||
func (t *Intention) HasWildcardDestination() bool {
|
||||
return t.DestinationName == WildcardSpecifier
|
||||
}
|
||||
|
||||
func (s *ServiceNode) NodeIdentity() Identity {
|
||||
return Identity{ID: s.Node}
|
||||
}
|
||||
|
|
|
@ -66,6 +66,7 @@ type AgentCheck struct {
|
|||
ExposedPort int
|
||||
Definition HealthCheckDefinition
|
||||
Namespace string `json:",omitempty"`
|
||||
Partition string `json:",omitempty"`
|
||||
}
|
||||
|
||||
// AgentWeights represent optional weights for a service
|
||||
|
@ -96,6 +97,7 @@ type AgentService struct {
|
|||
// to include the Namespace in the hash. When we do, then we are in for lots of fun with tests.
|
||||
// For now though, ignoring it works well enough.
|
||||
Namespace string `json:",omitempty" bexpr:"-" hash:"ignore"`
|
||||
Partition string `json:",omitempty" bexpr:"-" hash:"ignore"`
|
||||
// Datacenter is only ever returned and is ignored if presented.
|
||||
Datacenter string `json:",omitempty" bexpr:"-" hash:"ignore"`
|
||||
}
|
||||
|
@ -270,6 +272,7 @@ type AgentServiceRegistration struct {
|
|||
Proxy *AgentServiceConnectProxyConfig `json:",omitempty"`
|
||||
Connect *AgentServiceConnect `json:",omitempty"`
|
||||
Namespace string `json:",omitempty" bexpr:"-" hash:"ignore"`
|
||||
Partition string `json:",omitempty" bexpr:"-" hash:"ignore"`
|
||||
}
|
||||
|
||||
// ServiceRegisterOpts is used to pass extra options to the service register.
|
||||
|
@ -299,6 +302,7 @@ type AgentCheckRegistration struct {
|
|||
ServiceID string `json:",omitempty"`
|
||||
AgentServiceCheck
|
||||
Namespace string `json:",omitempty"`
|
||||
Partition string `json:",omitempty"`
|
||||
}
|
||||
|
||||
// AgentServiceCheck is used to define a node or service level check
|
||||
|
@ -404,8 +408,9 @@ type ConnectProxyConfig struct {
|
|||
|
||||
// Upstream is the response structure for a proxy upstream configuration.
|
||||
type Upstream struct {
|
||||
DestinationType UpstreamDestType `json:",omitempty"`
|
||||
DestinationNamespace string `json:",omitempty"`
|
||||
DestinationType UpstreamDestType `json:",omitempty"`
|
||||
// DestinationPartition string `json:",omitempty"` // TODO(partitions)?
|
||||
DestinationNamespace string `json:",omitempty"`
|
||||
DestinationName string
|
||||
Datacenter string `json:",omitempty"`
|
||||
LocalBindAddress string `json:",omitempty"`
|
||||
|
|
|
@ -19,6 +19,7 @@ type Node struct {
|
|||
Meta map[string]string
|
||||
CreateIndex uint64
|
||||
ModifyIndex uint64
|
||||
Partition string `json:",omitempty"`
|
||||
}
|
||||
|
||||
type ServiceAddress struct {
|
||||
|
@ -71,6 +72,7 @@ type CatalogRegistration struct {
|
|||
Check *AgentCheck
|
||||
Checks HealthChecks
|
||||
SkipNodeUpdate bool
|
||||
Partition string `json:",omitempty"`
|
||||
}
|
||||
|
||||
type CatalogDeregistration struct {
|
||||
|
@ -80,6 +82,7 @@ type CatalogDeregistration struct {
|
|||
ServiceID string
|
||||
CheckID string
|
||||
Namespace string `json:",omitempty"`
|
||||
Partition string `json:",omitempty"`
|
||||
}
|
||||
|
||||
type CompoundServiceName struct {
|
||||
|
@ -87,6 +90,8 @@ type CompoundServiceName struct {
|
|||
|
||||
// Namespacing is a Consul Enterprise feature.
|
||||
Namespace string `json:",omitempty"`
|
||||
// Partitions are a Consul Enterprise feature.
|
||||
Partition string `json:",omitempty"`
|
||||
}
|
||||
|
||||
// GatewayService associates a gateway with a linked service.
|
||||
|
|
|
@ -5,10 +5,11 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/consul/sdk/testutil"
|
||||
"github.com/hashicorp/consul/sdk/testutil/retry"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/hashicorp/consul/sdk/testutil"
|
||||
"github.com/hashicorp/consul/sdk/testutil/retry"
|
||||
)
|
||||
|
||||
func TestAPI_CatalogDatacenters(t *testing.T) {
|
||||
|
@ -1151,8 +1152,8 @@ func TestAPI_CatalogGatewayServices_Terminating(t *testing.T) {
|
|||
|
||||
expect := []*GatewayService{
|
||||
{
|
||||
Service: CompoundServiceName{"api", defaultNamespace},
|
||||
Gateway: CompoundServiceName{"terminating", defaultNamespace},
|
||||
Service: CompoundServiceName{Name: "api", Namespace: defaultNamespace},
|
||||
Gateway: CompoundServiceName{Name: "terminating", Namespace: defaultNamespace},
|
||||
GatewayKind: ServiceKindTerminatingGateway,
|
||||
CAFile: "api/ca.crt",
|
||||
CertFile: "api/client.crt",
|
||||
|
@ -1160,8 +1161,8 @@ func TestAPI_CatalogGatewayServices_Terminating(t *testing.T) {
|
|||
SNI: "my-domain",
|
||||
},
|
||||
{
|
||||
Service: CompoundServiceName{"redis", defaultNamespace},
|
||||
Gateway: CompoundServiceName{"terminating", defaultNamespace},
|
||||
Service: CompoundServiceName{Name: "redis", Namespace: defaultNamespace},
|
||||
Gateway: CompoundServiceName{Name: "terminating", Namespace: defaultNamespace},
|
||||
GatewayKind: ServiceKindTerminatingGateway,
|
||||
CAFile: "ca.crt",
|
||||
CertFile: "client.crt",
|
||||
|
@ -1219,15 +1220,15 @@ func TestAPI_CatalogGatewayServices_Ingress(t *testing.T) {
|
|||
|
||||
expect := []*GatewayService{
|
||||
{
|
||||
Service: CompoundServiceName{"api", defaultNamespace},
|
||||
Gateway: CompoundServiceName{"ingress", defaultNamespace},
|
||||
Service: CompoundServiceName{Name: "api", Namespace: defaultNamespace},
|
||||
Gateway: CompoundServiceName{Name: "ingress", Namespace: defaultNamespace},
|
||||
GatewayKind: ServiceKindIngressGateway,
|
||||
Protocol: "tcp",
|
||||
Port: 8888,
|
||||
},
|
||||
{
|
||||
Service: CompoundServiceName{"redis", defaultNamespace},
|
||||
Gateway: CompoundServiceName{"ingress", defaultNamespace},
|
||||
Service: CompoundServiceName{Name: "redis", Namespace: defaultNamespace},
|
||||
Gateway: CompoundServiceName{Name: "ingress", Namespace: defaultNamespace},
|
||||
GatewayKind: ServiceKindIngressGateway,
|
||||
Protocol: "tcp",
|
||||
Port: 9999,
|
||||
|
|
|
@ -6,9 +6,10 @@ import (
|
|||
|
||||
// CoordinateEntry represents a node and its associated network coordinate.
|
||||
type CoordinateEntry struct {
|
||||
Node string
|
||||
Segment string
|
||||
Coord *coordinate.Coordinate
|
||||
Node string
|
||||
Segment string
|
||||
Partition string `json:",omitempty"`
|
||||
Coord *coordinate.Coordinate
|
||||
}
|
||||
|
||||
// CoordinateDatacenterMap has the coordinates for servers in a given datacenter
|
||||
|
|
|
@ -82,6 +82,7 @@ type KVTxnOp struct {
|
|||
Index uint64
|
||||
Session string
|
||||
Namespace string `json:",omitempty"`
|
||||
Partition string `json:",omitempty"`
|
||||
}
|
||||
|
||||
// KVTxnOps defines a set of operations to be performed inside a single
|
||||
|
|
|
@ -18,6 +18,14 @@ func (m *CheckServiceNode) UniqueID() string {
|
|||
return ""
|
||||
}
|
||||
builder := new(strings.Builder)
|
||||
|
||||
switch {
|
||||
case m.Node != nil:
|
||||
builder.WriteString(m.Node.Partition + "/")
|
||||
case m.Service != nil:
|
||||
builder.WriteString(m.Service.EnterpriseMeta.Partition + "/")
|
||||
}
|
||||
|
||||
if m.Node != nil {
|
||||
builder.WriteString(m.Node.Node + "/")
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ func TestCheckServiceNode_UniqueID(t *testing.T) {
|
|||
EnterpriseMeta: pbcommon.EnterpriseMeta{Namespace: "the-namespace"},
|
||||
},
|
||||
},
|
||||
expected: "the-node-name/the-namespace/the-service-id",
|
||||
expected: "/the-node-name/the-namespace/the-service-id",
|
||||
},
|
||||
{
|
||||
name: "without node",
|
||||
|
@ -38,14 +38,14 @@ func TestCheckServiceNode_UniqueID(t *testing.T) {
|
|||
EnterpriseMeta: pbcommon.EnterpriseMeta{Namespace: "the-namespace"},
|
||||
},
|
||||
},
|
||||
expected: "the-namespace/the-service-id",
|
||||
expected: "/the-namespace/the-service-id",
|
||||
},
|
||||
{
|
||||
name: "without service",
|
||||
csn: CheckServiceNode{
|
||||
Node: &Node{Node: "the-node-name"},
|
||||
},
|
||||
expected: "the-node-name/",
|
||||
expected: "/the-node-name/",
|
||||
},
|
||||
{
|
||||
name: "without namespace",
|
||||
|
@ -55,7 +55,7 @@ func TestCheckServiceNode_UniqueID(t *testing.T) {
|
|||
ID: "the-service-id",
|
||||
},
|
||||
},
|
||||
expected: "the-node-name//the-service-id",
|
||||
expected: "/the-node-name//the-service-id",
|
||||
},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
|
|
|
@ -10,6 +10,7 @@ func NodeToStructs(s Node) structs.Node {
|
|||
t.Node = s.Node
|
||||
t.Address = s.Address
|
||||
t.Datacenter = s.Datacenter
|
||||
t.Partition = s.Partition
|
||||
t.TaggedAddresses = s.TaggedAddresses
|
||||
t.Meta = s.Meta
|
||||
t.RaftIndex = RaftIndexToStructs(s.RaftIndex)
|
||||
|
@ -21,6 +22,7 @@ func NewNodeFromStructs(t structs.Node) Node {
|
|||
s.Node = t.Node
|
||||
s.Address = t.Address
|
||||
s.Datacenter = t.Datacenter
|
||||
s.Partition = t.Partition
|
||||
s.TaggedAddresses = t.TaggedAddresses
|
||||
s.Meta = t.Meta
|
||||
s.RaftIndex = NewRaftIndexFromStructs(t.RaftIndex)
|
||||
|
|
|
@ -77,6 +77,7 @@ var xxx_messageInfo_CheckServiceNode proto.InternalMessageInfo
|
|||
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"`
|
||||
|
@ -227,55 +228,56 @@ func init() {
|
|||
func init() { proto.RegisterFile("proto/pbservice/node.proto", fileDescriptor_bbc215b78fa95fe5) }
|
||||
|
||||
var fileDescriptor_bbc215b78fa95fe5 = []byte{
|
||||
// 757 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcd, 0x4e, 0x1b, 0x3b,
|
||||
0x14, 0xce, 0x24, 0x13, 0x42, 0xcc, 0xbd, 0xfc, 0x58, 0xe8, 0xca, 0x37, 0x57, 0x4c, 0x72, 0x69,
|
||||
0x17, 0x48, 0xd0, 0x99, 0xaa, 0x3f, 0x6a, 0x53, 0x55, 0x95, 0x08, 0x41, 0x6a, 0xd4, 0x42, 0xd1,
|
||||
0x80, 0x54, 0xa9, 0x55, 0x17, 0xce, 0x8c, 0x99, 0x19, 0x11, 0xc6, 0x91, 0xed, 0x20, 0xf2, 0x16,
|
||||
0x5d, 0xb6, 0x2f, 0xd0, 0x67, 0xa1, 0x3b, 0x96, 0x5d, 0x45, 0x2d, 0x79, 0x0b, 0x56, 0x95, 0x3d,
|
||||
0x4e, 0x98, 0x0c, 0x29, 0x2a, 0x52, 0x57, 0xf6, 0x9c, 0xf3, 0x9d, 0xcf, 0xc7, 0xfe, 0xbe, 0x93,
|
||||
0x80, 0x4a, 0x97, 0x51, 0x41, 0x9d, 0x6e, 0x9b, 0x13, 0x76, 0x12, 0x79, 0xc4, 0x89, 0xa9, 0x4f,
|
||||
0x6c, 0x15, 0x84, 0xe5, 0x71, 0xb4, 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 0x80, 0x26, 0x16, 0xd8, 0x23, 0xb1, 0x20, 0x0c, 0x99, 0x2a, 0x99,
|
||||
0x8a, 0xc0, 0x5d, 0xb0, 0x70, 0x80, 0x83, 0x80, 0xf8, 0xba, 0x80, 0x70, 0x54, 0x54, 0xb7, 0xb9,
|
||||
0x9b, 0xb9, 0xbe, 0x9d, 0x81, 0x6d, 0xc7, 0x82, 0xf5, 0xdd, 0x6c, 0x31, 0xbc, 0x07, 0xcc, 0x1d,
|
||||
0x22, 0x30, 0x9a, 0x51, 0x24, 0xff, 0x66, 0x49, 0x64, 0x2e, 0xa9, 0x54, 0x30, 0x58, 0x07, 0x65,
|
||||
0x17, 0x1f, 0x8a, 0x56, 0xec, 0x93, 0x53, 0x54, 0x52, 0xef, 0xbe, 0x64, 0x6b, 0xa7, 0x8c, 0x13,
|
||||
0x8d, 0xd9, 0xb3, 0x41, 0x35, 0x77, 0x3e, 0xa8, 0x1a, 0xee, 0x15, 0xba, 0xd2, 0x00, 0xcb, 0xd3,
|
||||
0x5a, 0x82, 0x8b, 0xa0, 0x70, 0x44, 0xfa, 0xc9, 0xf3, 0xba, 0x72, 0x0b, 0x97, 0x41, 0xf1, 0x04,
|
||||
0x77, 0x7a, 0xa3, 0x27, 0x4b, 0x3e, 0x9e, 0xe5, 0x9f, 0x1a, 0x95, 0x27, 0xa0, 0x3c, 0xee, 0xe8,
|
||||
0x36, 0x85, 0xab, 0x5f, 0x4a, 0x60, 0x2e, 0x65, 0x0a, 0xb8, 0x03, 0xcc, 0x57, 0x51, 0xec, 0x6b,
|
||||
0x51, 0xeb, 0x97, 0x83, 0xea, 0xe3, 0x9b, 0x44, 0xc5, 0x01, 0x89, 0x85, 0xc3, 0x05, 0xeb, 0x79,
|
||||
0x82, 0xdb, 0x9a, 0x44, 0x12, 0xb8, 0x8a, 0x06, 0xce, 0x2b, 0x87, 0x24, 0xa7, 0x4a, 0xcd, 0xd1,
|
||||
0x95, 0x39, 0xb5, 0xbe, 0xa3, 0x83, 0x21, 0x30, 0x0f, 0x70, 0xc0, 0x91, 0x59, 0x2b, 0x48, 0x37,
|
||||
0xc8, 0x7d, 0xda, 0x0d, 0xc5, 0x49, 0x37, 0xbc, 0xbf, 0xae, 0xf6, 0x82, 0x12, 0x6a, 0x7d, 0xba,
|
||||
0xd9, 0xa7, 0x8a, 0xde, 0x30, 0xa5, 0x1c, 0xd7, 0xa5, 0x7f, 0x34, 0x21, 0x7d, 0xed, 0x17, 0x8c,
|
||||
0x59, 0x07, 0x40, 0x60, 0xee, 0x51, 0x26, 0x94, 0xf8, 0x45, 0x57, 0xed, 0xa5, 0x69, 0xf7, 0xa9,
|
||||
0x77, 0x44, 0xc4, 0x1e, 0x16, 0x21, 0x5a, 0x4a, 0x4c, 0x7b, 0x15, 0x81, 0x1b, 0xa0, 0xf4, 0x96,
|
||||
0x44, 0x41, 0x28, 0x38, 0x9a, 0x55, 0x9e, 0x81, 0xa9, 0xc3, 0x74, 0xc6, 0x1d, 0x41, 0xe0, 0x06,
|
||||
0x58, 0xda, 0x8e, 0x71, 0xbb, 0x43, 0x0e, 0x70, 0xf0, 0xe6, 0x84, 0x30, 0x16, 0xf9, 0x04, 0x95,
|
||||
0x6b, 0xc6, 0xda, 0xac, 0x7b, 0x3d, 0x01, 0xeb, 0xa0, 0xb8, 0xc7, 0xe8, 0x69, 0x1f, 0xcd, 0x29,
|
||||
0xe6, 0x95, 0x14, 0xf3, 0x16, 0x8d, 0x63, 0xe2, 0x09, 0x95, 0xde, 0xa2, 0xf1, 0x61, 0x14, 0xe8,
|
||||
0xa7, 0x48, 0x2a, 0x60, 0x1d, 0x94, 0x34, 0x04, 0xfd, 0xa5, 0x8a, 0xd3, 0xf6, 0xd7, 0xf7, 0xd7,
|
||||
0x00, 0x5d, 0x38, 0xc2, 0xc3, 0x17, 0xa0, 0xf2, 0x9a, 0x7a, 0xb8, 0xd3, 0xe9, 0xbb, 0x24, 0x88,
|
||||
0xb8, 0x20, 0x8c, 0xf8, 0x9b, 0x7c, 0x3f, 0xf2, 0x89, 0x87, 0x19, 0xfa, 0x5b, 0x35, 0x7b, 0x03,
|
||||
0x02, 0x36, 0xc1, 0xfc, 0xb6, 0x9c, 0xe7, 0x2e, 0x8b, 0x38, 0x51, 0x2a, 0x2c, 0xea, 0x1f, 0x31,
|
||||
0x3d, 0x4c, 0x93, 0x59, 0x7d, 0x7c, 0xa6, 0x66, 0x72, 0x1a, 0xe7, 0x6f, 0x35, 0x8d, 0x1f, 0x7e,
|
||||
0x7b, 0x1a, 0x9d, 0xf4, 0x50, 0x4d, 0x7d, 0x23, 0x4d, 0xf1, 0x27, 0x06, 0xb5, 0xb1, 0x73, 0xf6,
|
||||
0xc3, 0xca, 0x9d, 0x5d, 0x58, 0xc6, 0xf9, 0x85, 0x65, 0x7c, 0xbf, 0xb0, 0x8c, 0x8f, 0x43, 0x2b,
|
||||
0xf7, 0x69, 0x68, 0xe5, 0xce, 0x87, 0x56, 0xee, 0xdb, 0xd0, 0xca, 0xbd, 0x5b, 0xbf, 0x69, 0x50,
|
||||
0x33, 0xff, 0x41, 0xed, 0x19, 0x15, 0x78, 0xf8, 0x33, 0x00, 0x00, 0xff, 0xff, 0x17, 0xe3, 0xec,
|
||||
0x0a, 0x04, 0x07, 0x00, 0x00,
|
||||
// 773 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, 0x54, 0x5d, 0xcd, 0xcd, 0xbd, 0x75, 0x42,
|
||||
0x61, 0x51, 0xa9, 0xc5, 0x46, 0x05, 0x04, 0x41, 0x08, 0xa9, 0x69, 0x2a, 0x11, 0x41, 0x4b, 0xe4,
|
||||
0x56, 0x42, 0x02, 0xb1, 0x98, 0xd8, 0x53, 0xdb, 0x6a, 0xea, 0x89, 0xc6, 0x93, 0xaa, 0x79, 0x0b,
|
||||
0x96, 0xf0, 0x02, 0x3c, 0x4b, 0x97, 0x5d, 0xb2, 0x8a, 0xa0, 0x59, 0xf0, 0x0e, 0x5d, 0xa1, 0x19,
|
||||
0x4f, 0x12, 0xc7, 0x0d, 0x15, 0x95, 0x58, 0xcd, 0xf8, 0x7c, 0xdf, 0x39, 0x73, 0x66, 0xbe, 0xef,
|
||||
0x24, 0xa0, 0xdc, 0x65, 0x94, 0x53, 0xab, 0xdb, 0x8e, 0x08, 0x3b, 0x0d, 0x1c, 0x62, 0x85, 0xd4,
|
||||
0x25, 0xa6, 0x0c, 0xc2, 0xe2, 0x38, 0x5a, 0xfe, 0x6f, 0x44, 0x73, 0xe8, 0xc9, 0x09, 0x0d, 0xad,
|
||||
0x78, 0x89, 0x79, 0xe5, 0x3b, 0xe9, 0x1a, 0x3e, 0xc1, 0x1d, 0xee, 0x3b, 0x3e, 0x71, 0x8e, 0x15,
|
||||
0x65, 0x35, 0x4d, 0x51, 0xab, 0x82, 0x57, 0x3c, 0xea, 0xd1, 0x98, 0x22, 0x76, 0x71, 0x74, 0xed,
|
||||
0xb3, 0x06, 0x96, 0x76, 0x44, 0x91, 0x83, 0x98, 0xbc, 0x4f, 0x5d, 0x02, 0xef, 0x02, 0x5d, 0xac,
|
||||
0x48, 0xab, 0x6a, 0xeb, 0xa5, 0xad, 0x45, 0x73, 0x5c, 0xd2, 0x14, 0x61, 0x5b, 0x82, 0xf0, 0x01,
|
||||
0x28, 0xa8, 0x1c, 0x94, 0x95, 0xbc, 0x7f, 0x52, 0x3c, 0x85, 0xda, 0x23, 0x1a, 0x34, 0xc1, 0x9c,
|
||||
0x3c, 0x2a, 0x42, 0xb9, 0x6a, 0x2e, 0x95, 0xf0, 0x52, 0x5e, 0x47, 0xc2, 0xb6, 0x62, 0xad, 0xfd,
|
||||
0xc8, 0xc5, 0x7d, 0xc0, 0xe7, 0x20, 0xdb, 0x6c, 0xc8, 0x6e, 0x8a, 0xf5, 0xcd, 0xab, 0x41, 0x65,
|
||||
0xdd, 0x0b, 0xb8, 0xdf, 0x6b, 0x9b, 0x0e, 0x3d, 0xb1, 0x7c, 0x1c, 0xf9, 0x81, 0x43, 0x59, 0xd7,
|
||||
0x72, 0x68, 0x18, 0xf5, 0x3a, 0x16, 0xef, 0x77, 0x49, 0x24, 0x1b, 0x68, 0x36, 0xec, 0x6c, 0xb3,
|
||||
0x01, 0xa1, 0xba, 0x8d, 0xe8, 0xb2, 0xa8, 0x9a, 0xff, 0x1f, 0x14, 0x5b, 0x98, 0xf1, 0x80, 0x07,
|
||||
0x34, 0x44, 0xf3, 0x12, 0x98, 0x04, 0x20, 0x02, 0x85, 0x6d, 0xd7, 0x65, 0x24, 0x12, 0x9d, 0x0a,
|
||||
0x6c, 0xf4, 0x09, 0x0d, 0x00, 0x1a, 0x98, 0x63, 0x87, 0x84, 0x9c, 0x30, 0xa4, 0x4b, 0x30, 0x11,
|
||||
0x81, 0xfb, 0x60, 0xf1, 0x10, 0x7b, 0x1e, 0x71, 0x55, 0x02, 0x89, 0x50, 0x5e, 0xde, 0xf5, 0x5e,
|
||||
0xea, 0x71, 0xcc, 0x14, 0x6d, 0x37, 0xe4, 0xac, 0x6f, 0xa7, 0x93, 0xe1, 0x7d, 0xa0, 0xef, 0x11,
|
||||
0x8e, 0xd1, 0x9c, 0x2c, 0xf2, 0x6f, 0xba, 0x88, 0xc0, 0xe2, 0x4c, 0x49, 0x83, 0x35, 0x50, 0xb4,
|
||||
0xf1, 0x11, 0x6f, 0x86, 0x2e, 0x39, 0x43, 0x05, 0xa9, 0xca, 0xb2, 0xa9, 0x7c, 0x34, 0x06, 0xea,
|
||||
0xf3, 0xe7, 0x83, 0x4a, 0xe6, 0x62, 0x50, 0xd1, 0xec, 0x09, 0xbb, 0x5c, 0x07, 0x2b, 0xb3, 0x5a,
|
||||
0x82, 0x4b, 0x20, 0x77, 0x4c, 0xfa, 0xf1, 0xe3, 0xdb, 0x62, 0x0b, 0x57, 0x40, 0xfe, 0x14, 0x77,
|
||||
0x7a, 0xa3, 0x07, 0x8d, 0x3f, 0x9e, 0x65, 0x9f, 0x6a, 0xe5, 0x27, 0xa0, 0x38, 0xee, 0xe8, 0x36,
|
||||
0x89, 0x6b, 0x5f, 0x0a, 0xa0, 0x94, 0xb0, 0x0c, 0xdc, 0x03, 0xfa, 0xab, 0x20, 0x74, 0x95, 0xe4,
|
||||
0xb5, 0xab, 0x41, 0xe5, 0xf1, 0x4d, 0x92, 0x63, 0x8f, 0x84, 0xdc, 0x8a, 0x38, 0xeb, 0x39, 0x3c,
|
||||
0x32, 0x55, 0x11, 0x51, 0xc0, 0x96, 0x65, 0xe0, 0x82, 0xf4, 0x4f, 0x7c, 0xaa, 0x70, 0x04, 0x9a,
|
||||
0x58, 0x57, 0xe9, 0x3b, 0x3a, 0x18, 0x02, 0xfd, 0x10, 0x7b, 0x11, 0xd2, 0xab, 0x39, 0xe1, 0x15,
|
||||
0xb1, 0x4f, 0xba, 0x21, 0x3f, 0xed, 0x86, 0xf7, 0xd7, 0xd5, 0x5e, 0x94, 0x42, 0x6d, 0xcc, 0x1e,
|
||||
0x85, 0x99, 0xa2, 0xd7, 0x75, 0x21, 0xc7, 0x75, 0xe9, 0x1f, 0x4d, 0x49, 0x5f, 0xfd, 0x45, 0xc5,
|
||||
0xb4, 0x03, 0x20, 0xd0, 0x5b, 0x94, 0x71, 0x29, 0x7e, 0xde, 0x96, 0x7b, 0x61, 0xda, 0x03, 0xea,
|
||||
0x1c, 0x13, 0xde, 0xc2, 0xdc, 0x47, 0xcb, 0xb1, 0x69, 0x27, 0x11, 0xb8, 0x09, 0x0a, 0x6f, 0x49,
|
||||
0xe0, 0xf9, 0x3c, 0x92, 0xa3, 0x50, 0xda, 0x82, 0x89, 0xc3, 0x14, 0x62, 0x8f, 0x28, 0x70, 0x13,
|
||||
0x2c, 0xef, 0x86, 0xb8, 0xdd, 0x21, 0x87, 0xd8, 0x7b, 0x73, 0x4a, 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0x00, 0x00, 0xff, 0xff, 0x3d, 0x3e, 0x64,
|
||||
0x61, 0x22, 0x07, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *CheckServiceNode) Marshal() (dAtA []byte, err error) {
|
||||
|
@ -359,6 +361,13 @@ func (m *Node) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
_ = 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 {
|
||||
|
@ -703,6 +712,10 @@ func (m *Node) Size() (n int) {
|
|||
}
|
||||
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
|
||||
}
|
||||
|
||||
|
@ -1388,6 +1401,38 @@ func (m *Node) Unmarshal(dAtA []byte) error {
|
|||
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:])
|
||||
|
|
|
@ -35,6 +35,7 @@ message Node {
|
|||
string ID = 1 [(gogoproto.casttype) = "github.com/hashicorp/consul/types.NodeID"];
|
||||
|
||||
string Node = 2;
|
||||
string Partition = 8;
|
||||
string Address = 3;
|
||||
string Datacenter = 4;
|
||||
map<string, string> TaggedAddresses = 5;
|
||||
|
|
|
@ -113,7 +113,12 @@ type SubscribeRequest struct {
|
|||
// default namespace will be used.
|
||||
//
|
||||
// Namespace is an enterprise-only feature.
|
||||
Namespace string `protobuf:"bytes,6,opt,name=Namespace,proto3" json:"Namespace,omitempty"`
|
||||
Namespace string `protobuf:"bytes,6,opt,name=Namespace,proto3" json:"Namespace,omitempty"`
|
||||
// Partition which contains the resources. If Partition is not specified the
|
||||
// default partition will be used.
|
||||
//
|
||||
// Partition is an enterprise-only feature.
|
||||
Partition string `protobuf:"bytes,7,opt,name=Partition,proto3" json:"Partition,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
|
@ -194,6 +199,13 @@ func (m *SubscribeRequest) GetNamespace() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
func (m *SubscribeRequest) GetPartition() string {
|
||||
if m != nil {
|
||||
return m.Partition
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Event describes a streaming update on a subscription. Events are used both to
|
||||
// describe the current "snapshot" of the result as well as ongoing mutations to
|
||||
// that snapshot.
|
||||
|
@ -540,41 +552,42 @@ func init() {
|
|||
func init() { proto.RegisterFile("proto/pbsubscribe/subscribe.proto", fileDescriptor_ab3eb8c810e315fb) }
|
||||
|
||||
var fileDescriptor_ab3eb8c810e315fb = []byte{
|
||||
// 536 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x53, 0x5f, 0x6f, 0xd2, 0x50,
|
||||
0x14, 0xef, 0x65, 0x83, 0xad, 0x07, 0xb7, 0xd4, 0x3b, 0x8c, 0x0d, 0x33, 0x0d, 0x12, 0xb3, 0xe0,
|
||||
0x12, 0xa9, 0xc1, 0x44, 0xdf, 0x34, 0xc2, 0x36, 0x31, 0x26, 0x60, 0xca, 0xf6, 0xa0, 0x6f, 0x97,
|
||||
0xf6, 0x48, 0x1b, 0xba, 0x7b, 0x6b, 0x7b, 0x19, 0xee, 0x5d, 0xbf, 0x83, 0x9f, 0xc4, 0xcf, 0xe0,
|
||||
0xa3, 0x1f, 0xc1, 0xe0, 0x17, 0x31, 0x5c, 0x4a, 0x29, 0xb0, 0xb7, 0x9e, 0xdf, 0x9f, 0x73, 0x4f,
|
||||
0xcf, 0x1f, 0x78, 0x1c, 0xc5, 0x42, 0x0a, 0x3b, 0x1a, 0x26, 0x93, 0x61, 0xe2, 0xc6, 0xc1, 0x10,
|
||||
0xed, 0xec, 0xab, 0xa9, 0x38, 0xaa, 0x67, 0x40, 0xb5, 0x9a, 0xa9, 0x31, 0xbe, 0x09, 0x5c, 0xb4,
|
||||
0xb9, 0xf0, 0x52, 0x59, 0xfd, 0x17, 0x01, 0x63, 0xb0, 0x54, 0x3a, 0xf8, 0x75, 0x82, 0x89, 0xa4,
|
||||
0x27, 0x50, 0xbc, 0x14, 0x51, 0xe0, 0x9a, 0xa4, 0x46, 0x1a, 0x87, 0x2d, 0xa3, 0xb9, 0x4a, 0xae,
|
||||
0x70, 0x67, 0x41, 0x53, 0x03, 0x76, 0x3e, 0xe0, 0xad, 0x59, 0xa8, 0x91, 0x86, 0xee, 0xcc, 0x3f,
|
||||
0x69, 0x65, 0xee, 0x1c, 0x23, 0x37, 0x77, 0x14, 0xb6, 0x08, 0xe6, 0xe8, 0x7b, 0xee, 0xe1, 0x37,
|
||||
0x73, 0xb7, 0x46, 0x1a, 0xbb, 0xce, 0x22, 0xa0, 0x16, 0xc0, 0x19, 0x93, 0xcc, 0x45, 0x2e, 0x31,
|
||||
0x36, 0x8b, 0xca, 0x90, 0x43, 0xe8, 0x23, 0xd0, 0x7b, 0xec, 0x1a, 0x93, 0x88, 0xb9, 0x68, 0x96,
|
||||
0x14, 0xbd, 0x02, 0xea, 0x3f, 0x0a, 0x50, 0x3c, 0xbf, 0x41, 0x2e, 0x57, 0xd9, 0x49, 0x3e, 0xfb,
|
||||
0x09, 0x1c, 0x9c, 0x73, 0xaf, 0xff, 0x65, 0xc0, 0x59, 0x94, 0xf8, 0x42, 0xaa, 0x2a, 0xf7, 0xbb,
|
||||
0x9a, 0xb3, 0x0e, 0xd3, 0x16, 0x1c, 0xf5, 0x70, 0xba, 0x0c, 0x2f, 0xc5, 0x85, 0x08, 0x43, 0x31,
|
||||
0x55, 0xf5, 0xcf, 0xd5, 0x77, 0x91, 0xf4, 0x15, 0x80, 0x7a, 0xba, 0xcd, 0xa4, 0xeb, 0xab, 0x9f,
|
||||
0x2a, 0xb7, 0x1e, 0xe4, 0x9a, 0xb4, 0x22, 0xbb, 0x9a, 0x93, 0x93, 0xd2, 0x0b, 0x38, 0x18, 0x2c,
|
||||
0x66, 0xd0, 0x45, 0x16, 0x4a, 0xdf, 0x04, 0xe5, 0xb5, 0x72, 0xde, 0x35, 0xfe, 0x2a, 0xf2, 0x98,
|
||||
0xc4, 0x79, 0xd1, 0x6b, 0x70, 0x5b, 0x87, 0xbd, 0x8f, 0xec, 0x36, 0x14, 0xcc, 0xab, 0xbf, 0xcc,
|
||||
0xd7, 0x42, 0x1b, 0x50, 0x52, 0x51, 0x62, 0x92, 0xda, 0x4e, 0xa3, 0xbc, 0x36, 0x3a, 0x45, 0x38,
|
||||
0x29, 0x5f, 0xff, 0x4e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,
|
||||
0x4f, 0x26, 0xa1, 0xbd, 0x75, 0xc0, 0xc3, 0x92, 0x82, 0x5e, 0xfc, 0x0f, 0x00, 0x00, 0xff, 0xff,
|
||||
0x8f, 0x56, 0x73, 0x78, 0xdc, 0x03, 0x00, 0x00,
|
||||
// 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, 0x28, 0x16, 0x52, 0xd8, 0xd1, 0x30, 0x99, 0x0c, 0x13, 0x37, 0x0e, 0x86,
|
||||
0x68, 0xe7, 0xa7, 0xa6, 0xe2, 0xa8, 0x9e, 0x03, 0xd5, 0x6a, 0xae, 0xc6, 0xf8, 0x36, 0x70, 0xd1,
|
||||
0xe6, 0xc2, 0xcb, 0x64, 0xf5, 0xdf, 0x04, 0x8c, 0xc1, 0x42, 0xe9, 0xe0, 0x97, 0x09, 0x26, 0x92,
|
||||
0x9e, 0xc0, 0xce, 0x95, 0x88, 0x02, 0xd7, 0x24, 0x35, 0xd2, 0x38, 0x6c, 0x19, 0xcd, 0xe5, 0xe5,
|
||||
0x0a, 0x77, 0xe6, 0x34, 0x35, 0x60, 0xeb, 0x03, 0xde, 0x99, 0xa5, 0x1a, 0x69, 0xe8, 0x4e, 0x7a,
|
||||
0xa4, 0x95, 0xd4, 0x39, 0x46, 0x6e, 0x6e, 0x29, 0x6c, 0x1e, 0xa4, 0xe8, 0x7b, 0xee, 0xe1, 0x57,
|
||||
0x73, 0xbb, 0x46, 0x1a, 0xdb, 0xce, 0x3c, 0xa0, 0x16, 0xc0, 0x19, 0x93, 0xcc, 0x45, 0x2e, 0x31,
|
||||
0x36, 0x77, 0x94, 0xa1, 0x80, 0xd0, 0x47, 0xa0, 0xf7, 0xd8, 0x0d, 0x26, 0x11, 0x73, 0xd1, 0xdc,
|
||||
0x55, 0xf4, 0x12, 0x48, 0xd9, 0x4b, 0x16, 0xcb, 0x40, 0x06, 0x82, 0x9b, 0x7b, 0x73, 0x36, 0x07,
|
||||
0xea, 0xdf, 0x4b, 0xb0, 0x73, 0x7e, 0x8b, 0x5c, 0x2e, 0x73, 0x93, 0x62, 0xee, 0x13, 0x38, 0x38,
|
||||
0xe7, 0x5e, 0xff, 0xf3, 0x80, 0xb3, 0x28, 0xf1, 0x85, 0x54, 0x7f, 0xd8, 0xef, 0x6a, 0xce, 0x2a,
|
||||
0x4c, 0x5b, 0x70, 0xd4, 0xc3, 0xe9, 0x22, 0xbc, 0x12, 0x17, 0x22, 0x0c, 0xc5, 0x54, 0xfd, 0x2e,
|
||||
0x55, 0xdf, 0x47, 0xd2, 0x57, 0x00, 0x2a, 0x75, 0x9b, 0x49, 0xd7, 0x57, 0x5f, 0x2e, 0xb7, 0x1e,
|
||||
0x14, 0x4a, 0xb8, 0x24, 0xbb, 0x9a, 0x53, 0x90, 0xd2, 0x0b, 0x38, 0x18, 0xcc, 0x3b, 0xd4, 0x45,
|
||||
0x16, 0x4a, 0xdf, 0x04, 0xe5, 0xb5, 0x0a, 0xde, 0x15, 0xfe, 0x3a, 0xf2, 0x98, 0xc4, 0xf4, 0xd1,
|
||||
0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
|
||||
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,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
|
@ -746,6 +759,13 @@ func (m *SubscribeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
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)
|
||||
|
@ -1024,6 +1044,10 @@ func (m *SubscribeRequest) Size() (n int) {
|
|||
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)
|
||||
}
|
||||
|
@ -1328,6 +1352,38 @@ func (m *SubscribeRequest) Unmarshal(dAtA []byte) error {
|
|||
}
|
||||
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:])
|
||||
|
|
|
@ -79,6 +79,12 @@ message SubscribeRequest {
|
|||
//
|
||||
// Namespace is an enterprise-only feature.
|
||||
string Namespace = 6;
|
||||
|
||||
// Partition which contains the resources. If Partition is not specified the
|
||||
// default partition will be used.
|
||||
//
|
||||
// Partition is an enterprise-only feature.
|
||||
string Partition = 7;
|
||||
}
|
||||
|
||||
// Event describes a streaming update on a subscription. Events are used both to
|
||||
|
|
Loading…
Reference in New Issue