Minor structs cleanup
This commit is contained in:
parent
000dbedc06
commit
490abc75a6
|
@ -334,7 +334,7 @@ func TestCatalogNodeServices(t *testing.T) {
|
|||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
|
||||
if out.Address != "127.0.0.1" {
|
||||
if out.Node.Address != "127.0.0.1" {
|
||||
t.Fatalf("bad: %v", out)
|
||||
}
|
||||
if len(out.Services) != 2 {
|
||||
|
|
|
@ -279,7 +279,7 @@ func (s *StateStore) parseNodeServices(tx *MDBTxn, name string) *structs.NodeSer
|
|||
|
||||
// Set the address
|
||||
node := res[0].(*structs.Node)
|
||||
ns.Address = node.Address
|
||||
ns.Node = *node
|
||||
|
||||
// Get the services
|
||||
res, err = s.serviceTable.GetTxn(tx, "id", name)
|
||||
|
|
|
@ -47,6 +47,26 @@ type DeregisterRequest struct {
|
|||
CheckID string
|
||||
}
|
||||
|
||||
// ServiceSpecificRequest is used to query about a specific node
|
||||
type ServiceSpecificRequest struct {
|
||||
Datacenter string
|
||||
ServiceName string
|
||||
ServiceTag string
|
||||
TagFilter bool // Controls tag filtering
|
||||
}
|
||||
|
||||
// NodeSpecificRequest is used to request the information about a single node
|
||||
type NodeSpecificRequest struct {
|
||||
Datacenter string
|
||||
Node string
|
||||
}
|
||||
|
||||
// ChecksInStateRequest is used to query for nodes in a state
|
||||
type ChecksInStateRequest struct {
|
||||
Datacenter string
|
||||
State string
|
||||
}
|
||||
|
||||
// Used to return information about a node
|
||||
type Node struct {
|
||||
Node string
|
||||
|
@ -58,14 +78,6 @@ type Nodes []Node
|
|||
// Maps service name to available tags
|
||||
type Services map[string][]string
|
||||
|
||||
// ServiceSpecificRequest is used to query about a specific node
|
||||
type ServiceSpecificRequest struct {
|
||||
Datacenter string
|
||||
ServiceName string
|
||||
ServiceTag string
|
||||
TagFilter bool // Controls tag filtering
|
||||
}
|
||||
|
||||
// ServiceNode represents a node that is part of a service
|
||||
type ServiceNode struct {
|
||||
Node string
|
||||
|
@ -77,12 +89,6 @@ type ServiceNode struct {
|
|||
}
|
||||
type ServiceNodes []ServiceNode
|
||||
|
||||
// NodeSpecificRequest is used to request the information about a single node
|
||||
type NodeSpecificRequest struct {
|
||||
Datacenter string
|
||||
Node string
|
||||
}
|
||||
|
||||
// NodeService is a service provided by a node
|
||||
type NodeService struct {
|
||||
ID string
|
||||
|
@ -91,7 +97,7 @@ type NodeService struct {
|
|||
Port int
|
||||
}
|
||||
type NodeServices struct {
|
||||
Address string
|
||||
Node Node
|
||||
Services map[string]*NodeService
|
||||
}
|
||||
|
||||
|
@ -107,10 +113,12 @@ type HealthCheck struct {
|
|||
}
|
||||
type HealthChecks []*HealthCheck
|
||||
|
||||
// ChecksInStateRequest is used to query for nodes in a state
|
||||
type ChecksInStateRequest struct {
|
||||
Datacenter string
|
||||
State string
|
||||
// NodeServiceStatus is used to provide the node, it's service
|
||||
// definition, as well as a HealthCheck that is associated
|
||||
type NodeServiceStatus struct {
|
||||
Node Node
|
||||
Service NodeService
|
||||
Check HealthCheck
|
||||
}
|
||||
|
||||
// Decode is used to decode a MsgPack encoded object
|
||||
|
|
Loading…
Reference in New Issue