consul: Rename Misc RPC to Internal

This commit is contained in:
Armon Dadgar 2014-04-28 14:44:36 -07:00 committed by Jack Pearkes
parent 89714a6dae
commit d045335ca0
3 changed files with 18 additions and 18 deletions

View File

@ -4,17 +4,17 @@ import (
"github.com/hashicorp/consul/consul/structs"
)
// Misc endpoint is used to query the miscellaneous info that
// Internal endpoint is used to query the miscellaneous info that
// does not necessarily fit into the other systems. It is also
// used to hold undocumented APIs that users should not rely on.
type Misc struct {
type Internal struct {
srv *Server
}
// ChecksInState is used to get all the checks in a given state
func (m *Misc) NodeInfo(args *structs.NodeSpecificRequest,
func (m *Internal) NodeInfo(args *structs.NodeSpecificRequest,
reply *structs.IndexedNodeDump) error {
if done, err := m.srv.forward("Misc.NodeInfo", args, args, reply); done {
if done, err := m.srv.forward("Internal.NodeInfo", args, args, reply); done {
return err
}
@ -30,9 +30,9 @@ func (m *Misc) NodeInfo(args *structs.NodeSpecificRequest,
}
// ChecksInState is used to get all the checks in a given state
func (m *Misc) NodeDump(args *structs.DCSpecificRequest,
func (m *Internal) NodeDump(args *structs.DCSpecificRequest,
reply *structs.IndexedNodeDump) error {
if done, err := m.srv.forward("Misc.NodeDump", args, args, reply); done {
if done, err := m.srv.forward("Internal.NodeDump", args, args, reply); done {
return err
}

View File

@ -7,7 +7,7 @@ import (
"time"
)
func TestMisc_NodeInfo(t *testing.T) {
func TestInternal_NodeInfo(t *testing.T) {
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -42,7 +42,7 @@ func TestMisc_NodeInfo(t *testing.T) {
Datacenter: "dc1",
Node: "foo",
}
if err := client.Call("Misc.NodeInfo", &req, &out2); err != nil {
if err := client.Call("Internal.NodeInfo", &req, &out2); err != nil {
t.Fatalf("err: %v", err)
}
@ -61,7 +61,7 @@ func TestMisc_NodeInfo(t *testing.T) {
}
}
func TestMisc_NodeDump(t *testing.T) {
func TestInternal_NodeDump(t *testing.T) {
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -114,7 +114,7 @@ func TestMisc_NodeDump(t *testing.T) {
req := structs.DCSpecificRequest{
Datacenter: "dc1",
}
if err := client.Call("Misc.NodeDump", &req, &out2); err != nil {
if err := client.Call("Internal.NodeDump", &req, &out2); err != nil {
t.Fatalf("err: %v", err)
}

View File

@ -112,7 +112,7 @@ type endpoints struct {
Raft *Raft
Status *Status
KVS *KVS
Misc *Misc
Internal *Internal
}
// NewServer is used to construct a new Consul server from the
@ -312,7 +312,7 @@ func (s *Server) setupRPC(tlsConfig *tls.Config) error {
s.endpoints.Catalog = &Catalog{s}
s.endpoints.Health = &Health{s}
s.endpoints.KVS = &KVS{s}
s.endpoints.Misc = &Misc{s}
s.endpoints.Internal = &Internal{s}
// Register the handlers
s.rpcServer.Register(s.endpoints.Status)
@ -320,7 +320,7 @@ func (s *Server) setupRPC(tlsConfig *tls.Config) error {
s.rpcServer.Register(s.endpoints.Catalog)
s.rpcServer.Register(s.endpoints.Health)
s.rpcServer.Register(s.endpoints.KVS)
s.rpcServer.Register(s.endpoints.Misc)
s.rpcServer.Register(s.endpoints.Internal)
list, err := net.ListenTCP("tcp", s.config.RPCAddr)
if err != nil {