diff --git a/cmd/cache_serve.go b/cmd/cache_serve.go index 8324fc68e..f54a4e918 100644 --- a/cmd/cache_serve.go +++ b/cmd/cache_serve.go @@ -37,7 +37,7 @@ import ( "github.com/pelicanplatform/pelican/daemon" "github.com/pelicanplatform/pelican/director" "github.com/pelicanplatform/pelican/metrics" - nsregistry "github.com/pelicanplatform/pelican/namespace-registry" + nsregistry "github.com/pelicanplatform/pelican/namespace_registry" "github.com/pelicanplatform/pelican/param" "github.com/pelicanplatform/pelican/utils" "github.com/pelicanplatform/pelican/xrootd" diff --git a/cmd/namespace_client.go b/cmd/namespace_client.go index 7357a58a7..ee7ae2ac3 100644 --- a/cmd/namespace_client.go +++ b/cmd/namespace_client.go @@ -24,7 +24,7 @@ import ( "github.com/lestrrat-go/jwx/v2/jwk" "github.com/pelicanplatform/pelican/config" - nsregistry "github.com/pelicanplatform/pelican/namespace-registry" + nsregistry "github.com/pelicanplatform/pelican/namespace_registry" "github.com/pelicanplatform/pelican/param" "github.com/pkg/errors" log "github.com/sirupsen/logrus" diff --git a/cmd/namespace_registry_serve.go b/cmd/namespace_registry_serve.go index 18857ea1a..8f04af30c 100644 --- a/cmd/namespace_registry_serve.go +++ b/cmd/namespace_registry_serve.go @@ -25,7 +25,7 @@ import ( "github.com/pkg/errors" - nsregistry "github.com/pelicanplatform/pelican/namespace-registry" + nsregistry "github.com/pelicanplatform/pelican/namespace_registry" "github.com/pelicanplatform/pelican/web_ui" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" diff --git a/namespace-registry/client_commands.go b/namespace_registry/client_commands.go similarity index 100% rename from namespace-registry/client_commands.go rename to namespace_registry/client_commands.go diff --git a/cmd/namespace_registry_test.go b/namespace_registry/client_commands_test.go similarity index 85% rename from cmd/namespace_registry_test.go rename to namespace_registry/client_commands_test.go index b733551b0..2566f319c 100644 --- a/cmd/namespace_registry_test.go +++ b/namespace_registry/client_commands_test.go @@ -16,7 +16,7 @@ * ***************************************************************/ -package main +package nsregistry import ( "net/http/httptest" @@ -26,7 +26,6 @@ import ( "github.com/gin-gonic/gin" "github.com/pelicanplatform/pelican/config" - nsregistry "github.com/pelicanplatform/pelican/namespace-registry" "github.com/spf13/viper" "github.com/stretchr/testify/assert" @@ -44,9 +43,9 @@ func TestServeNamespaceRegistry(t *testing.T) { err := config.InitServer() require.NoError(t, err) - err = nsregistry.InitializeDB() + err = InitializeDB() require.NoError(t, err) - defer nsregistry.ShutdownDB() + defer ShutdownDB() gin.SetMode(gin.TestMode) engine := gin.Default() @@ -57,7 +56,7 @@ func TestServeNamespaceRegistry(t *testing.T) { require.NoError(t, err) //Configure registry - nsregistry.RegisterNamespaceRegistry(engine.Group("/")) + RegisterNamespaceRegistry(engine.Group("/")) //Set up a server to use for testing svr := httptest.NewServer(engine) @@ -68,7 +67,7 @@ func TestServeNamespaceRegistry(t *testing.T) { viper.Set("Origin.NamespacePrefix", "/test") //Test functionality of registering a namespace (without identity) - err = nsregistry.NamespaceRegister(privKey, svr.URL+"/api/v1.0/registry", "", "/test") + err = NamespaceRegister(privKey, svr.URL+"/api/v1.0/registry", "", "/test") require.NoError(t, err) //Test we can list the namespace without an error @@ -80,7 +79,7 @@ func TestServeNamespaceRegistry(t *testing.T) { os.Stdout = w //List the namespaces - err = nsregistry.NamespaceList(svr.URL + "/api/v1.0/registry") + err = NamespaceList(svr.URL + "/api/v1.0/registry") require.NoError(t, err) w.Close() os.Stdout = oldStdout @@ -99,7 +98,7 @@ func TestServeNamespaceRegistry(t *testing.T) { r, w, _ := os.Pipe() os.Stdout = w - err = nsregistry.NamespaceGet(svr.URL + "/api/v1.0/registry") + err = NamespaceGet(svr.URL + "/api/v1.0/registry") require.NoError(t, err) w.Close() os.Stdout = oldStdout @@ -112,13 +111,13 @@ func TestServeNamespaceRegistry(t *testing.T) { t.Run("Test namespace delete", func(t *testing.T) { //Test functionality of namespace delete - err = nsregistry.NamespaceDelete(svr.URL+"/api/v1.0/registry/test", "/test") + err = NamespaceDelete(svr.URL+"/api/v1.0/registry/test", "/test") require.NoError(t, err) var stdoutCapture string oldStdout := os.Stdout r, w, _ := os.Pipe() os.Stdout = w - err = nsregistry.NamespaceGet(svr.URL + "/api/v1.0/registry") + err = NamespaceGet(svr.URL + "/api/v1.0/registry") require.NoError(t, err) w.Close() os.Stdout = oldStdout diff --git a/namespace-registry/registry.go b/namespace_registry/registry.go similarity index 100% rename from namespace-registry/registry.go rename to namespace_registry/registry.go diff --git a/namespace-registry/registry-db.go b/namespace_registry/registry_db.go similarity index 100% rename from namespace-registry/registry-db.go rename to namespace_registry/registry_db.go diff --git a/origin_ui/register_origin.go b/origin_ui/register_origin.go index e9349fe27..6481672dc 100644 --- a/origin_ui/register_origin.go +++ b/origin_ui/register_origin.go @@ -28,7 +28,7 @@ import ( "github.com/lestrrat-go/jwx/v2/jwk" "github.com/pelicanplatform/pelican/config" "github.com/pelicanplatform/pelican/metrics" - nsregistry "github.com/pelicanplatform/pelican/namespace-registry" + nsregistry "github.com/pelicanplatform/pelican/namespace_registry" "github.com/pelicanplatform/pelican/param" "github.com/pkg/errors" log "github.com/sirupsen/logrus" diff --git a/origin_ui/register_origin_test.go b/origin_ui/register_origin_test.go index bc8f6575d..19e7ed5f9 100644 --- a/origin_ui/register_origin_test.go +++ b/origin_ui/register_origin_test.go @@ -32,7 +32,7 @@ import ( "github.com/gin-gonic/gin" "github.com/lestrrat-go/jwx/v2/jwk" "github.com/pelicanplatform/pelican/config" - nsregistry "github.com/pelicanplatform/pelican/namespace-registry" + nsregistry "github.com/pelicanplatform/pelican/namespace_registry" "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require"