diff --git a/agent/acl_test.go b/agent/acl_test.go index 58f0f76d14..dba1bc9b0a 100644 --- a/agent/acl_test.go +++ b/agent/acl_test.go @@ -47,7 +47,7 @@ func TestACL_Version8(t *testing.T) { defer a.Shutdown() m := MockServer{} - if err := a.RegisterEndpoint("ACL", &m); err != nil { + if err := a.registerEndpoint("ACL", &m); err != nil { t.Fatalf("err: %v", err) } @@ -70,7 +70,7 @@ func TestACL_Disabled(t *testing.T) { defer a.Shutdown() m := MockServer{} - if err := a.RegisterEndpoint("ACL", &m); err != nil { + if err := a.registerEndpoint("ACL", &m); err != nil { t.Fatalf("err: %v", err) } @@ -123,7 +123,7 @@ func TestACL_Special_IDs(t *testing.T) { defer a.Shutdown() m := MockServer{} - if err := a.RegisterEndpoint("ACL", &m); err != nil { + if err := a.registerEndpoint("ACL", &m); err != nil { t.Fatalf("err: %v", err) } @@ -176,7 +176,7 @@ func TestACL_Down_Deny(t *testing.T) { defer a.Shutdown() m := MockServer{} - if err := a.RegisterEndpoint("ACL", &m); err != nil { + if err := a.registerEndpoint("ACL", &m); err != nil { t.Fatalf("err: %v", err) } @@ -206,7 +206,7 @@ func TestACL_Down_Allow(t *testing.T) { defer a.Shutdown() m := MockServer{} - if err := a.RegisterEndpoint("ACL", &m); err != nil { + if err := a.registerEndpoint("ACL", &m); err != nil { t.Fatalf("err: %v", err) } @@ -236,7 +236,7 @@ func TestACL_Down_Extend(t *testing.T) { defer a.Shutdown() m := MockServer{} - if err := a.RegisterEndpoint("ACL", &m); err != nil { + if err := a.registerEndpoint("ACL", &m); err != nil { t.Fatalf("err: %v", err) } @@ -313,7 +313,7 @@ func TestACL_Cache(t *testing.T) { defer a.Shutdown() m := MockServer{} - if err := a.RegisterEndpoint("ACL", &m); err != nil { + if err := a.registerEndpoint("ACL", &m); err != nil { t.Fatalf("err: %v", err) } @@ -495,7 +495,7 @@ func TestACL_vetServiceRegister(t *testing.T) { defer a.Shutdown() m := MockServer{catalogPolicy} - if err := a.RegisterEndpoint("ACL", &m); err != nil { + if err := a.registerEndpoint("ACL", &m); err != nil { t.Fatalf("err: %v", err) } @@ -541,7 +541,7 @@ func TestACL_vetServiceUpdate(t *testing.T) { defer a.Shutdown() m := MockServer{catalogPolicy} - if err := a.RegisterEndpoint("ACL", &m); err != nil { + if err := a.registerEndpoint("ACL", &m); err != nil { t.Fatalf("err: %v", err) } @@ -577,7 +577,7 @@ func TestACL_vetCheckRegister(t *testing.T) { defer a.Shutdown() m := MockServer{catalogPolicy} - if err := a.RegisterEndpoint("ACL", &m); err != nil { + if err := a.registerEndpoint("ACL", &m); err != nil { t.Fatalf("err: %v", err) } @@ -660,7 +660,7 @@ func TestACL_vetCheckUpdate(t *testing.T) { defer a.Shutdown() m := MockServer{catalogPolicy} - if err := a.RegisterEndpoint("ACL", &m); err != nil { + if err := a.registerEndpoint("ACL", &m); err != nil { t.Fatalf("err: %v", err) } @@ -716,7 +716,7 @@ func TestACL_filterMembers(t *testing.T) { defer a.Shutdown() m := MockServer{catalogPolicy} - if err := a.RegisterEndpoint("ACL", &m); err != nil { + if err := a.registerEndpoint("ACL", &m); err != nil { t.Fatalf("err: %v", err) } @@ -752,7 +752,7 @@ func TestACL_filterServices(t *testing.T) { defer a.Shutdown() m := MockServer{catalogPolicy} - if err := a.RegisterEndpoint("ACL", &m); err != nil { + if err := a.registerEndpoint("ACL", &m); err != nil { t.Fatalf("err: %v", err) } @@ -783,7 +783,7 @@ func TestACL_filterChecks(t *testing.T) { defer a.Shutdown() m := MockServer{catalogPolicy} - if err := a.RegisterEndpoint("ACL", &m); err != nil { + if err := a.registerEndpoint("ACL", &m); err != nil { t.Fatalf("err: %v", err) } diff --git a/agent/agent.go b/agent/agent.go index 6cef976957..94c9b6578a 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -1067,11 +1067,11 @@ LOAD: return nil } -// RegisterEndpoint registers a handler for the consul RPC server +// registerEndpoint registers a handler for the consul RPC server // under a unique name while making it accessible under the provided // name. This allows overwriting handlers for the golang net/rpc // service which does not allow this. -func (a *Agent) RegisterEndpoint(name string, handler interface{}) error { +func (a *Agent) registerEndpoint(name string, handler interface{}) error { srv, ok := a.delegate.(*consul.Server) if !ok { panic("agent must be a server") diff --git a/agent/dns_test.go b/agent/dns_test.go index 2a0bd93027..ee53a58c5a 100644 --- a/agent/dns_test.go +++ b/agent/dns_test.go @@ -3932,7 +3932,7 @@ func TestDNS_PreparedQuery_AllowStale(t *testing.T) { defer a.Shutdown() m := MockPreparedQuery{} - if err := a.RegisterEndpoint("PreparedQuery", &m); err != nil { + if err := a.registerEndpoint("PreparedQuery", &m); err != nil { t.Fatalf("err: %v", err) } @@ -4013,7 +4013,7 @@ func TestDNS_PreparedQuery_AgentSource(t *testing.T) { defer a.Shutdown() m := MockPreparedQuery{} - if err := a.RegisterEndpoint("PreparedQuery", &m); err != nil { + if err := a.registerEndpoint("PreparedQuery", &m); err != nil { t.Fatalf("err: %v", err) } diff --git a/agent/prepared_query_endpoint_test.go b/agent/prepared_query_endpoint_test.go index 171599fa0e..01a061fd36 100644 --- a/agent/prepared_query_endpoint_test.go +++ b/agent/prepared_query_endpoint_test.go @@ -74,7 +74,7 @@ func TestPreparedQuery_Create(t *testing.T) { defer a.Shutdown() m := MockPreparedQuery{} - if err := a.RegisterEndpoint("PreparedQuery", &m); err != nil { + if err := a.registerEndpoint("PreparedQuery", &m); err != nil { t.Fatalf("err: %v", err) } @@ -159,7 +159,7 @@ func TestPreparedQuery_List(t *testing.T) { defer a.Shutdown() m := MockPreparedQuery{} - if err := a.RegisterEndpoint("PreparedQuery", &m); err != nil { + if err := a.registerEndpoint("PreparedQuery", &m); err != nil { t.Fatalf("err: %v", err) } @@ -192,7 +192,7 @@ func TestPreparedQuery_List(t *testing.T) { defer a.Shutdown() m := MockPreparedQuery{} - if err := a.RegisterEndpoint("PreparedQuery", &m); err != nil { + if err := a.registerEndpoint("PreparedQuery", &m); err != nil { t.Fatalf("err: %v", err) } @@ -242,7 +242,7 @@ func TestPreparedQuery_Execute(t *testing.T) { defer a.Shutdown() m := MockPreparedQuery{} - if err := a.RegisterEndpoint("PreparedQuery", &m); err != nil { + if err := a.registerEndpoint("PreparedQuery", &m); err != nil { t.Fatalf("err: %v", err) } @@ -275,7 +275,7 @@ func TestPreparedQuery_Execute(t *testing.T) { defer a.Shutdown() m := MockPreparedQuery{} - if err := a.RegisterEndpoint("PreparedQuery", &m); err != nil { + if err := a.registerEndpoint("PreparedQuery", &m); err != nil { t.Fatalf("err: %v", err) } @@ -331,7 +331,7 @@ func TestPreparedQuery_Execute(t *testing.T) { defer a.Shutdown() m := MockPreparedQuery{} - if err := a.RegisterEndpoint("PreparedQuery", &m); err != nil { + if err := a.registerEndpoint("PreparedQuery", &m); err != nil { t.Fatalf("err: %v", err) } @@ -365,7 +365,7 @@ func TestPreparedQuery_Execute(t *testing.T) { defer a.Shutdown() m := MockPreparedQuery{} - if err := a.RegisterEndpoint("PreparedQuery", &m); err != nil { + if err := a.registerEndpoint("PreparedQuery", &m); err != nil { t.Fatalf("err: %v", err) } @@ -415,7 +415,7 @@ func TestPreparedQuery_Execute(t *testing.T) { defer a.Shutdown() m := MockPreparedQuery{} - if err := a.RegisterEndpoint("PreparedQuery", &m); err != nil { + if err := a.registerEndpoint("PreparedQuery", &m); err != nil { t.Fatalf("err: %v", err) } @@ -479,7 +479,7 @@ func TestPreparedQuery_Explain(t *testing.T) { defer a.Shutdown() m := MockPreparedQuery{} - if err := a.RegisterEndpoint("PreparedQuery", &m); err != nil { + if err := a.registerEndpoint("PreparedQuery", &m); err != nil { t.Fatalf("err: %v", err) } @@ -552,7 +552,7 @@ func TestPreparedQuery_Get(t *testing.T) { defer a.Shutdown() m := MockPreparedQuery{} - if err := a.RegisterEndpoint("PreparedQuery", &m); err != nil { + if err := a.registerEndpoint("PreparedQuery", &m); err != nil { t.Fatalf("err: %v", err) } @@ -617,7 +617,7 @@ func TestPreparedQuery_Update(t *testing.T) { defer a.Shutdown() m := MockPreparedQuery{} - if err := a.RegisterEndpoint("PreparedQuery", &m); err != nil { + if err := a.registerEndpoint("PreparedQuery", &m); err != nil { t.Fatalf("err: %v", err) } @@ -695,7 +695,7 @@ func TestPreparedQuery_Delete(t *testing.T) { defer a.Shutdown() m := MockPreparedQuery{} - if err := a.RegisterEndpoint("PreparedQuery", &m); err != nil { + if err := a.registerEndpoint("PreparedQuery", &m); err != nil { t.Fatalf("err: %v", err) }