From d05a2e7133348c8f930175b908691a4119e61b0a Mon Sep 17 00:00:00 2001 From: Kim Wittenburg Date: Mon, 14 Aug 2023 12:00:06 +0200 Subject: [PATCH] chore: Rename package Fixes #6 --- cmd/karman/migrate.go | 7 ++++--- cmd/karman/server.go | 6 +++--- go.mod | 2 +- internal/api/apierror/common.go | 5 +++-- internal/api/apierror/httperrors.go | 3 ++- internal/api/apierror/rfc7807.go | 5 +++-- internal/api/apierror/song.go | 2 +- internal/api/apierror/upload.go | 3 ++- internal/api/controller.go | 15 ++++++++------- internal/api/middleware/contenttype.go | 6 +++--- internal/api/middleware/contenttype_test.go | 9 +++++---- internal/api/middleware/paginate.go | 5 +++-- internal/api/middleware/paginate_test.go | 7 ++++--- internal/api/middleware/uuid.go | 7 ++++--- internal/api/middleware/uuid_test.go | 9 +++++---- internal/api/v1/controller.go | 10 +++++----- internal/api/v1/songs/controller.go | 10 +++++----- internal/api/v1/songs/controller_test.go | 10 +++++----- internal/api/v1/songs/crud.go | 10 +++++----- internal/api/v1/songs/crud_test.go | 6 +++--- internal/api/v1/songs/media.go | 10 +++++----- internal/api/v1/songs/media_test.go | 10 +++++----- internal/api/v1/songs/middleware.go | 8 ++++---- internal/api/v1/songs/middleware_test.go | 6 +++--- internal/api/v1/uploads/context.go | 9 +++++---- internal/api/v1/uploads/controller.go | 2 +- internal/api/v1/uploads/crud.go | 11 ++++++----- internal/api/v1/uploads/file_crud.go | 11 ++++++----- internal/entity/file.go | 5 +++-- internal/entity/model.go | 2 +- internal/entity/song.go | 2 +- internal/entity/upload.go | 2 +- internal/model/file.go | 2 +- internal/schema/list.go | 3 ++- internal/schema/song.go | 4 ++-- internal/schema/upload.go | 4 ++-- internal/service/media/fakeservice.go | 6 +++--- internal/service/media/filestore.go | 2 +- internal/service/media/filestore_test.go | 2 +- internal/service/media/service.go | 8 ++++---- internal/service/media/service_test.go | 4 ++-- internal/service/media/store.go | 2 +- internal/service/song/crud.go | 4 ++-- internal/service/song/crud_test.go | 4 ++-- internal/service/song/media.go | 6 +++--- internal/service/song/service.go | 2 +- internal/service/upload/impl.go | 2 +- internal/service/upload/service.go | 3 ++- internal/test/data.go | 6 +++--- internal/test/db.go | 2 +- internal/test/errors.go | 5 +++-- internal/test/tests.go | 2 +- migrations/20230720180143_add_file.go | 7 ++++--- migrations/20230720180400_add_song.go | 2 +- pkg/render/context.go | 3 ++- pkg/render/decode.go | 3 ++- pkg/render/encode.go | 3 ++- pkg/render/form/codec.go | 7 ++++--- pkg/render/html/codec.go | 3 ++- pkg/render/json/codec.go | 5 +++-- pkg/render/negotiate.go | 3 ++- pkg/render/raw/codec.go | 5 +++-- pkg/render/xml/codec.go | 5 +++-- 63 files changed, 181 insertions(+), 153 deletions(-) diff --git a/cmd/karman/migrate.go b/cmd/karman/migrate.go index de35343..563ec74 100644 --- a/cmd/karman/migrate.go +++ b/cmd/karman/migrate.go @@ -1,15 +1,16 @@ package main import ( + "log" + "github.com/pressly/goose/v3" "github.com/psanford/memfs" "github.com/spf13/cobra" "gorm.io/driver/sqlite" "gorm.io/gorm" - "log" - _ "github.com/Karaoke-Manager/karman/migrations" - gormdb "github.com/Karaoke-Manager/karman/migrations/db" + _ "github.com/Karaoke-Manager/server/migrations" + gormdb "github.com/Karaoke-Manager/server/migrations/db" ) func init() { diff --git a/cmd/karman/server.go b/cmd/karman/server.go index a161014..23ebed7 100644 --- a/cmd/karman/server.go +++ b/cmd/karman/server.go @@ -11,9 +11,9 @@ import ( "gorm.io/driver/sqlite" "gorm.io/gorm" - "github.com/Karaoke-Manager/karman/internal/api" - "github.com/Karaoke-Manager/karman/internal/service/media" - "github.com/Karaoke-Manager/karman/internal/service/song" + "github.com/Karaoke-Manager/server/internal/api" + "github.com/Karaoke-Manager/server/internal/service/media" + "github.com/Karaoke-Manager/server/internal/service/song" ) func init() { diff --git a/go.mod b/go.mod index c323986..04d708e 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/Karaoke-Manager/karman +module github.com/Karaoke-Manager/server go 1.21 diff --git a/internal/api/apierror/common.go b/internal/api/apierror/common.go index 9a01927..c4f323a 100644 --- a/internal/api/apierror/common.go +++ b/internal/api/apierror/common.go @@ -4,9 +4,10 @@ import ( "encoding/json" "errors" "fmt" - "github.com/Karaoke-Manager/karman/pkg/render" - "gorm.io/gorm" "net/http" + + "github.com/Karaoke-Manager/server/pkg/render" + "gorm.io/gorm" ) // ProblemTypeDomain is the base domain for all custom problem types. diff --git a/internal/api/apierror/httperrors.go b/internal/api/apierror/httperrors.go index 6d3cf2f..81ac92a 100644 --- a/internal/api/apierror/httperrors.go +++ b/internal/api/apierror/httperrors.go @@ -1,8 +1,9 @@ package apierror import ( - "github.com/Karaoke-Manager/karman/pkg/mediatype" "net/http" + + "github.com/Karaoke-Manager/server/pkg/mediatype" ) const ( diff --git a/internal/api/apierror/rfc7807.go b/internal/api/apierror/rfc7807.go index 1742586..8945582 100644 --- a/internal/api/apierror/rfc7807.go +++ b/internal/api/apierror/rfc7807.go @@ -2,9 +2,10 @@ package apierror import ( "encoding/json" - "github.com/Karaoke-Manager/karman/pkg/mediatype" - "github.com/Karaoke-Manager/karman/pkg/render" "net/http" + + "github.com/Karaoke-Manager/server/pkg/mediatype" + "github.com/Karaoke-Manager/server/pkg/render" ) // ProblemDetails implements [RFC 7807] "Problem Details for HTTP APIs". diff --git a/internal/api/apierror/song.go b/internal/api/apierror/song.go index 5b26363..b4a053c 100644 --- a/internal/api/apierror/song.go +++ b/internal/api/apierror/song.go @@ -6,7 +6,7 @@ import ( "codello.dev/ultrastar/txt" - "github.com/Karaoke-Manager/karman/internal/model" + "github.com/Karaoke-Manager/server/internal/model" ) const ( diff --git a/internal/api/apierror/upload.go b/internal/api/apierror/upload.go index c0adc68..d722e3e 100644 --- a/internal/api/apierror/upload.go +++ b/internal/api/apierror/upload.go @@ -2,8 +2,9 @@ package apierror import ( "fmt" - "github.com/Karaoke-Manager/karman/internal/entity" "net/http" + + "github.com/Karaoke-Manager/server/internal/entity" ) // These constants identify known problem types related to uploads. diff --git a/internal/api/controller.go b/internal/api/controller.go index 5533b6a..e73234f 100644 --- a/internal/api/controller.go +++ b/internal/api/controller.go @@ -1,16 +1,17 @@ package api import ( - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/Karaoke-Manager/karman/internal/service/media" - "github.com/Karaoke-Manager/karman/internal/service/song" - "github.com/Karaoke-Manager/karman/pkg/render" + "net/http" + + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/Karaoke-Manager/server/internal/service/media" + "github.com/Karaoke-Manager/server/internal/service/song" + "github.com/Karaoke-Manager/server/pkg/render" "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" - "net/http" - "github.com/Karaoke-Manager/karman/internal/api/v1" - "github.com/Karaoke-Manager/karman/internal/service/upload" + "github.com/Karaoke-Manager/server/internal/api/v1" + "github.com/Karaoke-Manager/server/internal/service/upload" ) // Controller is the main API controller. diff --git a/internal/api/middleware/contenttype.go b/internal/api/middleware/contenttype.go index 58e9b93..cb93767 100644 --- a/internal/api/middleware/contenttype.go +++ b/internal/api/middleware/contenttype.go @@ -3,9 +3,9 @@ package middleware import ( "net/http" - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/Karaoke-Manager/karman/pkg/mediatype" - "github.com/Karaoke-Manager/karman/pkg/render" + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/Karaoke-Manager/server/pkg/mediatype" + "github.com/Karaoke-Manager/server/pkg/render" ) // ContentTypeJSON is an instance of the RequireContentType middleware for the common application of JSON requests. diff --git a/internal/api/middleware/contenttype_test.go b/internal/api/middleware/contenttype_test.go index ec3fab1..ea5fa81 100644 --- a/internal/api/middleware/contenttype_test.go +++ b/internal/api/middleware/contenttype_test.go @@ -2,13 +2,14 @@ package middleware import ( "encoding/json" - "github.com/Karaoke-Manager/karman/internal/api/apierror" - _ "github.com/Karaoke-Manager/karman/pkg/render/json" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" "net/http" "net/http/httptest" "testing" + + "github.com/Karaoke-Manager/server/internal/api/apierror" + _ "github.com/Karaoke-Manager/server/pkg/render/json" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestRequireContentType(t *testing.T) { diff --git a/internal/api/middleware/paginate.go b/internal/api/middleware/paginate.go index d7071e1..fd05438 100644 --- a/internal/api/middleware/paginate.go +++ b/internal/api/middleware/paginate.go @@ -2,10 +2,11 @@ package middleware import ( "context" - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/Karaoke-Manager/karman/pkg/render" "net/http" "strconv" + + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/Karaoke-Manager/server/pkg/render" ) const ( diff --git a/internal/api/middleware/paginate_test.go b/internal/api/middleware/paginate_test.go index 6c0dc4f..126eb73 100644 --- a/internal/api/middleware/paginate_test.go +++ b/internal/api/middleware/paginate_test.go @@ -2,12 +2,13 @@ package middleware import ( "encoding/json" - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" "net/http" "net/http/httptest" "testing" + + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestPaginate(t *testing.T) { diff --git a/internal/api/middleware/uuid.go b/internal/api/middleware/uuid.go index 98c6287..635879a 100644 --- a/internal/api/middleware/uuid.go +++ b/internal/api/middleware/uuid.go @@ -2,11 +2,12 @@ package middleware import ( "context" - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/Karaoke-Manager/karman/pkg/render" + "net/http" + + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/Karaoke-Manager/server/pkg/render" "github.com/go-chi/chi/v5" "github.com/google/uuid" - "net/http" ) // UUID is a simple middleware that fetches a UUID value from a request parameter named param. diff --git a/internal/api/middleware/uuid_test.go b/internal/api/middleware/uuid_test.go index 13098ed..d794b91 100644 --- a/internal/api/middleware/uuid_test.go +++ b/internal/api/middleware/uuid_test.go @@ -3,14 +3,15 @@ package middleware import ( "context" "encoding/json" - "github.com/Karaoke-Manager/karman/internal/api/apierror" + "net/http" + "net/http/httptest" + "testing" + + "github.com/Karaoke-Manager/server/internal/api/apierror" "github.com/go-chi/chi/v5" "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "net/http" - "net/http/httptest" - "testing" ) func TestUUID(t *testing.T) { diff --git a/internal/api/v1/controller.go b/internal/api/v1/controller.go index e4e4bf0..5947e3c 100644 --- a/internal/api/v1/controller.go +++ b/internal/api/v1/controller.go @@ -3,11 +3,11 @@ package v1 import ( "github.com/go-chi/chi/v5" - "github.com/Karaoke-Manager/karman/internal/api/v1/songs" - "github.com/Karaoke-Manager/karman/internal/api/v1/uploads" - "github.com/Karaoke-Manager/karman/internal/service/media" - "github.com/Karaoke-Manager/karman/internal/service/song" - "github.com/Karaoke-Manager/karman/internal/service/upload" + "github.com/Karaoke-Manager/server/internal/api/v1/songs" + "github.com/Karaoke-Manager/server/internal/api/v1/uploads" + "github.com/Karaoke-Manager/server/internal/service/media" + "github.com/Karaoke-Manager/server/internal/service/song" + "github.com/Karaoke-Manager/server/internal/service/upload" ) // Controller implements the /v1 API namespace. diff --git a/internal/api/v1/songs/controller.go b/internal/api/v1/songs/controller.go index 362c8ae..cac83d6 100644 --- a/internal/api/v1/songs/controller.go +++ b/internal/api/v1/songs/controller.go @@ -3,11 +3,11 @@ package songs import ( "github.com/go-chi/chi/v5" - "github.com/Karaoke-Manager/karman/internal/api/middleware" - "github.com/Karaoke-Manager/karman/internal/service/media" - "github.com/Karaoke-Manager/karman/internal/service/song" - "github.com/Karaoke-Manager/karman/pkg/render" - _ "github.com/Karaoke-Manager/karman/pkg/render/json" + "github.com/Karaoke-Manager/server/internal/api/middleware" + "github.com/Karaoke-Manager/server/internal/service/media" + "github.com/Karaoke-Manager/server/internal/service/song" + "github.com/Karaoke-Manager/server/pkg/render" + _ "github.com/Karaoke-Manager/server/pkg/render/json" ) // Controller implements the /v1/songs endpoint. diff --git a/internal/api/v1/songs/controller_test.go b/internal/api/v1/songs/controller_test.go index 9fc486a..b2d9482 100644 --- a/internal/api/v1/songs/controller_test.go +++ b/internal/api/v1/songs/controller_test.go @@ -5,16 +5,16 @@ import ( "net/http/httptest" "testing" - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/Karaoke-Manager/karman/internal/model" + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/Karaoke-Manager/server/internal/model" "github.com/google/uuid" "github.com/go-chi/chi/v5" - "github.com/Karaoke-Manager/karman/internal/service/media" - "github.com/Karaoke-Manager/karman/internal/service/song" - "github.com/Karaoke-Manager/karman/internal/test" + "github.com/Karaoke-Manager/server/internal/service/media" + "github.com/Karaoke-Manager/server/internal/service/song" + "github.com/Karaoke-Manager/server/internal/test" ) // setup prepares a test instance of the songs.Controller. diff --git a/internal/api/v1/songs/crud.go b/internal/api/v1/songs/crud.go index a51ad9e..4deec75 100644 --- a/internal/api/v1/songs/crud.go +++ b/internal/api/v1/songs/crud.go @@ -7,11 +7,11 @@ import ( "codello.dev/ultrastar/txt" "gorm.io/gorm" - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/Karaoke-Manager/karman/internal/api/middleware" - "github.com/Karaoke-Manager/karman/internal/model" - "github.com/Karaoke-Manager/karman/internal/schema" - "github.com/Karaoke-Manager/karman/pkg/render" + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/Karaoke-Manager/server/internal/api/middleware" + "github.com/Karaoke-Manager/server/internal/model" + "github.com/Karaoke-Manager/server/internal/schema" + "github.com/Karaoke-Manager/server/pkg/render" ) // Create implements the POST /v1/songs endpoint. diff --git a/internal/api/v1/songs/crud_test.go b/internal/api/v1/songs/crud_test.go index 99b4e58..38ca07b 100644 --- a/internal/api/v1/songs/crud_test.go +++ b/internal/api/v1/songs/crud_test.go @@ -10,9 +10,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/Karaoke-Manager/karman/internal/schema" - "github.com/Karaoke-Manager/karman/internal/test" + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/Karaoke-Manager/server/internal/schema" + "github.com/Karaoke-Manager/server/internal/test" ) //go:generate go run ../../../../tools/gensong -output testdata/valid-song.txt diff --git a/internal/api/v1/songs/media.go b/internal/api/v1/songs/media.go index ffc610c..3454c67 100644 --- a/internal/api/v1/songs/media.go +++ b/internal/api/v1/songs/media.go @@ -5,14 +5,14 @@ import ( "net/http" "strconv" - "github.com/Karaoke-Manager/karman/internal/model" - "github.com/Karaoke-Manager/karman/pkg/mediatype" + "github.com/Karaoke-Manager/server/internal/model" + "github.com/Karaoke-Manager/server/pkg/mediatype" "codello.dev/ultrastar/txt" - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/Karaoke-Manager/karman/internal/schema" - "github.com/Karaoke-Manager/karman/pkg/render" + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/Karaoke-Manager/server/internal/schema" + "github.com/Karaoke-Manager/server/pkg/render" ) // GetTxt implements the GET /v1/songs/{uuid}/txt endpoint. diff --git a/internal/api/v1/songs/media_test.go b/internal/api/v1/songs/media_test.go index f838c35..0ecee22 100644 --- a/internal/api/v1/songs/media_test.go +++ b/internal/api/v1/songs/media_test.go @@ -11,11 +11,11 @@ import ( "github.com/stretchr/testify/assert" - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/Karaoke-Manager/karman/internal/model" - "github.com/Karaoke-Manager/karman/internal/schema" - "github.com/Karaoke-Manager/karman/internal/test" - "github.com/Karaoke-Manager/karman/pkg/mediatype" + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/Karaoke-Manager/server/internal/model" + "github.com/Karaoke-Manager/server/internal/schema" + "github.com/Karaoke-Manager/server/internal/test" + "github.com/Karaoke-Manager/server/pkg/mediatype" ) func TestController_GetTxt(t *testing.T) { diff --git a/internal/api/v1/songs/middleware.go b/internal/api/v1/songs/middleware.go index bcb422e..9b521b1 100644 --- a/internal/api/v1/songs/middleware.go +++ b/internal/api/v1/songs/middleware.go @@ -4,10 +4,10 @@ import ( "context" "net/http" - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/Karaoke-Manager/karman/internal/api/middleware" - "github.com/Karaoke-Manager/karman/internal/model" - "github.com/Karaoke-Manager/karman/pkg/render" + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/Karaoke-Manager/server/internal/api/middleware" + "github.com/Karaoke-Manager/server/internal/model" + "github.com/Karaoke-Manager/server/pkg/render" ) // contextKey is the type for context keys used in this package. diff --git a/internal/api/v1/songs/middleware_test.go b/internal/api/v1/songs/middleware_test.go index 77c23f0..fb20b2e 100644 --- a/internal/api/v1/songs/middleware_test.go +++ b/internal/api/v1/songs/middleware_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/Karaoke-Manager/karman/internal/api/middleware" - "github.com/Karaoke-Manager/karman/internal/test" + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/Karaoke-Manager/server/internal/api/middleware" + "github.com/Karaoke-Manager/server/internal/test" ) func TestController_FetchUpload(t *testing.T) { diff --git a/internal/api/v1/uploads/context.go b/internal/api/v1/uploads/context.go index efd5241..ff1bcc0 100644 --- a/internal/api/v1/uploads/context.go +++ b/internal/api/v1/uploads/context.go @@ -2,12 +2,13 @@ package uploads import ( "context" - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/Karaoke-Manager/karman/internal/entity" - "github.com/Karaoke-Manager/karman/pkg/render" - "github.com/go-chi/chi/v5" "io/fs" "net/http" + + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/Karaoke-Manager/server/internal/entity" + "github.com/Karaoke-Manager/server/pkg/render" + "github.com/go-chi/chi/v5" ) type contextKey int diff --git a/internal/api/v1/uploads/controller.go b/internal/api/v1/uploads/controller.go index e2ab5eb..6adc2d8 100644 --- a/internal/api/v1/uploads/controller.go +++ b/internal/api/v1/uploads/controller.go @@ -1,7 +1,7 @@ package uploads import ( - "github.com/Karaoke-Manager/karman/internal/service/upload" + "github.com/Karaoke-Manager/server/internal/service/upload" "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" ) diff --git a/internal/api/v1/uploads/crud.go b/internal/api/v1/uploads/crud.go index 44e4bff..756f7fe 100644 --- a/internal/api/v1/uploads/crud.go +++ b/internal/api/v1/uploads/crud.go @@ -1,12 +1,13 @@ package uploads import ( - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/Karaoke-Manager/karman/internal/api/middleware" - "github.com/Karaoke-Manager/karman/internal/schema" - "github.com/Karaoke-Manager/karman/pkg/render" - "github.com/go-chi/chi/v5" "net/http" + + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/Karaoke-Manager/server/internal/api/middleware" + "github.com/Karaoke-Manager/server/internal/schema" + "github.com/Karaoke-Manager/server/pkg/render" + "github.com/go-chi/chi/v5" ) func (c *Controller) Create(w http.ResponseWriter, r *http.Request) { diff --git a/internal/api/v1/uploads/file_crud.go b/internal/api/v1/uploads/file_crud.go index 67d0206..e5cd09c 100644 --- a/internal/api/v1/uploads/file_crud.go +++ b/internal/api/v1/uploads/file_crud.go @@ -2,13 +2,14 @@ package uploads import ( "errors" - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/Karaoke-Manager/karman/internal/entity" - uploadSvc "github.com/Karaoke-Manager/karman/internal/service/upload" - "github.com/Karaoke-Manager/karman/pkg/render" - "github.com/google/uuid" "io/fs" "net/http" + + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/Karaoke-Manager/server/internal/entity" + uploadSvc "github.com/Karaoke-Manager/server/internal/service/upload" + "github.com/Karaoke-Manager/server/pkg/render" + "github.com/google/uuid" ) func (c *Controller) handleFileError(w http.ResponseWriter, r *http.Request, upload entity.Upload, path string, err error) { diff --git a/internal/entity/file.go b/internal/entity/file.go index f777ad2..05b0eac 100644 --- a/internal/entity/file.go +++ b/internal/entity/file.go @@ -1,9 +1,10 @@ package entity import ( - "github.com/Karaoke-Manager/karman/internal/model" - "github.com/Karaoke-Manager/karman/pkg/mediatype" "time" + + "github.com/Karaoke-Manager/server/internal/model" + "github.com/Karaoke-Manager/server/pkg/mediatype" ) // File is a entity that represents a media file of a song. diff --git a/internal/entity/model.go b/internal/entity/model.go index 1deee16..ccb86f0 100644 --- a/internal/entity/model.go +++ b/internal/entity/model.go @@ -7,7 +7,7 @@ import ( "github.com/google/uuid" "gorm.io/gorm" - "github.com/Karaoke-Manager/karman/internal/model" + "github.com/Karaoke-Manager/server/internal/model" ) // Entity is the base type for most Karman models. diff --git a/internal/entity/song.go b/internal/entity/song.go index c2cf001..9cd8dc0 100644 --- a/internal/entity/song.go +++ b/internal/entity/song.go @@ -3,7 +3,7 @@ package entity import ( "time" - "github.com/Karaoke-Manager/karman/internal/model" + "github.com/Karaoke-Manager/server/internal/model" "codello.dev/ultrastar" ) diff --git a/internal/entity/upload.go b/internal/entity/upload.go index f3f2649..ae147cd 100644 --- a/internal/entity/upload.go +++ b/internal/entity/upload.go @@ -3,7 +3,7 @@ package entity import ( "gorm.io/gorm" - "github.com/Karaoke-Manager/karman/internal/model" + "github.com/Karaoke-Manager/server/internal/model" ) type UploadProcessingError struct { diff --git a/internal/model/file.go b/internal/model/file.go index 0469532..df60140 100644 --- a/internal/model/file.go +++ b/internal/model/file.go @@ -3,7 +3,7 @@ package model import ( "time" - "github.com/Karaoke-Manager/karman/pkg/mediatype" + "github.com/Karaoke-Manager/server/pkg/mediatype" ) // File represents a single media file that can be used by songs. diff --git a/internal/schema/list.go b/internal/schema/list.go index 11a517b..8ff046e 100644 --- a/internal/schema/list.go +++ b/internal/schema/list.go @@ -1,9 +1,10 @@ package schema import ( - "github.com/Karaoke-Manager/karman/pkg/render" "net/http" "strconv" + + "github.com/Karaoke-Manager/server/pkg/render" ) // List is a generic schema type for list responses. diff --git a/internal/schema/song.go b/internal/schema/song.go index 1a66158..530098b 100644 --- a/internal/schema/song.go +++ b/internal/schema/song.go @@ -5,8 +5,8 @@ import ( "net/http" "time" - "github.com/Karaoke-Manager/karman/internal/model" - "github.com/Karaoke-Manager/karman/pkg/mediatype" + "github.com/Karaoke-Manager/server/internal/model" + "github.com/Karaoke-Manager/server/pkg/mediatype" "codello.dev/ultrastar" "github.com/google/uuid" diff --git a/internal/schema/upload.go b/internal/schema/upload.go index 96b1b82..15ea299 100644 --- a/internal/schema/upload.go +++ b/internal/schema/upload.go @@ -1,8 +1,8 @@ package schema import ( - "github.com/Karaoke-Manager/karman/internal/entity" - "github.com/Karaoke-Manager/karman/pkg/render" + "github.com/Karaoke-Manager/server/internal/entity" + "github.com/Karaoke-Manager/server/pkg/render" ) type UploadStatus string diff --git a/internal/service/media/fakeservice.go b/internal/service/media/fakeservice.go index fb5d0cf..d52c47b 100644 --- a/internal/service/media/fakeservice.go +++ b/internal/service/media/fakeservice.go @@ -9,9 +9,9 @@ import ( "gorm.io/gorm" - "github.com/Karaoke-Manager/karman/internal/entity" - "github.com/Karaoke-Manager/karman/internal/model" - "github.com/Karaoke-Manager/karman/pkg/mediatype" + "github.com/Karaoke-Manager/server/internal/entity" + "github.com/Karaoke-Manager/server/internal/model" + "github.com/Karaoke-Manager/server/pkg/mediatype" ) // FakeService is a Service implementation that only uses dummy values for file contents. diff --git a/internal/service/media/filestore.go b/internal/service/media/filestore.go index 4d8367b..ea1ced6 100644 --- a/internal/service/media/filestore.go +++ b/internal/service/media/filestore.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - "github.com/Karaoke-Manager/karman/pkg/mediatype" + "github.com/Karaoke-Manager/server/pkg/mediatype" "github.com/google/uuid" ) diff --git a/internal/service/media/filestore_test.go b/internal/service/media/filestore_test.go index 4c29256..3a80c23 100644 --- a/internal/service/media/filestore_test.go +++ b/internal/service/media/filestore_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/Karaoke-Manager/karman/pkg/mediatype" + "github.com/Karaoke-Manager/server/pkg/mediatype" ) func fileStore(t *testing.T) (Store, string) { diff --git a/internal/service/media/service.go b/internal/service/media/service.go index e3e1126..d5a17ab 100644 --- a/internal/service/media/service.go +++ b/internal/service/media/service.go @@ -16,11 +16,11 @@ import ( "gorm.io/gorm" - "github.com/Karaoke-Manager/karman/internal/model" - "github.com/Karaoke-Manager/karman/pkg/mediatype" - "github.com/Karaoke-Manager/karman/pkg/streamio" + "github.com/Karaoke-Manager/server/internal/model" + "github.com/Karaoke-Manager/server/pkg/mediatype" + "github.com/Karaoke-Manager/server/pkg/streamio" - "github.com/Karaoke-Manager/karman/internal/entity" + "github.com/Karaoke-Manager/server/internal/entity" // AV Libraries. "github.com/abema/go-mp4" diff --git a/internal/service/media/service_test.go b/internal/service/media/service_test.go index 2e03535..997718c 100644 --- a/internal/service/media/service_test.go +++ b/internal/service/media/service_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/Karaoke-Manager/karman/internal/entity" - "github.com/Karaoke-Manager/karman/pkg/mediatype" + "github.com/Karaoke-Manager/server/internal/entity" + "github.com/Karaoke-Manager/server/pkg/mediatype" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/internal/service/media/store.go b/internal/service/media/store.go index 33aae03..f0bac42 100644 --- a/internal/service/media/store.go +++ b/internal/service/media/store.go @@ -6,7 +6,7 @@ import ( "github.com/google/uuid" - "github.com/Karaoke-Manager/karman/pkg/mediatype" + "github.com/Karaoke-Manager/server/pkg/mediatype" ) // Store is an interface to an underlying storage system used by Karman. diff --git a/internal/service/song/crud.go b/internal/service/song/crud.go index 196df63..904db62 100644 --- a/internal/service/song/crud.go +++ b/internal/service/song/crud.go @@ -5,8 +5,8 @@ import ( "github.com/google/uuid" - "github.com/Karaoke-Manager/karman/internal/entity" - "github.com/Karaoke-Manager/karman/internal/model" + "github.com/Karaoke-Manager/server/internal/entity" + "github.com/Karaoke-Manager/server/internal/model" ) // FindSongs fetches a page of songs from the database. diff --git a/internal/service/song/crud_test.go b/internal/service/song/crud_test.go index 3bad2a8..a89a4e4 100644 --- a/internal/service/song/crud_test.go +++ b/internal/service/song/crud_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/require" "gorm.io/gorm" - "github.com/Karaoke-Manager/karman/internal/model" - "github.com/Karaoke-Manager/karman/internal/test" + "github.com/Karaoke-Manager/server/internal/model" + "github.com/Karaoke-Manager/server/internal/test" ) func setupService(t *testing.T, withData bool) (s Service, data *test.Dataset) { diff --git a/internal/service/song/media.go b/internal/service/song/media.go index aa578be..da4ab19 100644 --- a/internal/service/song/media.go +++ b/internal/service/song/media.go @@ -5,9 +5,9 @@ import ( "fmt" "mime" - "github.com/Karaoke-Manager/karman/internal/entity" - "github.com/Karaoke-Manager/karman/internal/model" - "github.com/Karaoke-Manager/karman/pkg/mediatype" + "github.com/Karaoke-Manager/server/internal/entity" + "github.com/Karaoke-Manager/server/internal/model" + "github.com/Karaoke-Manager/server/pkg/mediatype" ) // ReplaceCover sets song.CoverFile to file and persists the change in the database. diff --git a/internal/service/song/service.go b/internal/service/song/service.go index c2d0ac4..f5226dc 100644 --- a/internal/service/song/service.go +++ b/internal/service/song/service.go @@ -3,7 +3,7 @@ package song import ( "context" - "github.com/Karaoke-Manager/karman/internal/model" + "github.com/Karaoke-Manager/server/internal/model" "github.com/google/uuid" "gorm.io/gorm" diff --git a/internal/service/upload/impl.go b/internal/service/upload/impl.go index f1da6e8..103a836 100644 --- a/internal/service/upload/impl.go +++ b/internal/service/upload/impl.go @@ -7,7 +7,7 @@ import ( "gorm.io/gorm" - "github.com/Karaoke-Manager/karman/internal/entity" + "github.com/Karaoke-Manager/server/internal/entity" ) type FS interface { diff --git a/internal/service/upload/service.go b/internal/service/upload/service.go index 69db9a7..cdd3f12 100644 --- a/internal/service/upload/service.go +++ b/internal/service/upload/service.go @@ -3,9 +3,10 @@ package upload import ( "context" "errors" - "github.com/Karaoke-Manager/karman/internal/entity" "io" "io/fs" + + "github.com/Karaoke-Manager/server/internal/entity" ) var ( diff --git a/internal/test/data.go b/internal/test/data.go index 5487be8..4b5d246 100644 --- a/internal/test/data.go +++ b/internal/test/data.go @@ -8,10 +8,10 @@ import ( "github.com/google/uuid" "gorm.io/gorm" - "github.com/Karaoke-Manager/karman/internal/model" - "github.com/Karaoke-Manager/karman/pkg/mediatype" + "github.com/Karaoke-Manager/server/internal/model" + "github.com/Karaoke-Manager/server/pkg/mediatype" - "github.com/Karaoke-Manager/karman/internal/entity" + "github.com/Karaoke-Manager/server/internal/entity" ) // A Dataset provides named values for the expected content of a testing database. diff --git a/internal/test/db.go b/internal/test/db.go index e0f9353..3805f7d 100644 --- a/internal/test/db.go +++ b/internal/test/db.go @@ -8,7 +8,7 @@ import ( "gorm.io/driver/sqlite" "gorm.io/gorm" - "github.com/Karaoke-Manager/karman/internal/entity" + "github.com/Karaoke-Manager/server/internal/entity" ) // NewDB creates a new database for testing purposes. diff --git a/internal/test/errors.go b/internal/test/errors.go index cf57a3f..f3e6d1b 100644 --- a/internal/test/errors.go +++ b/internal/test/errors.go @@ -2,12 +2,13 @@ package test import ( "encoding/json" - "github.com/Karaoke-Manager/karman/internal/api/apierror" - "github.com/stretchr/testify/assert" "net/http" "net/http/httptest" "reflect" "testing" + + "github.com/Karaoke-Manager/server/internal/api/apierror" + "github.com/stretchr/testify/assert" ) // AssertProblemDetails validates that resp encodes a problem details instance with the specified values. diff --git a/internal/test/tests.go b/internal/test/tests.go index 244f063..fe4f673 100644 --- a/internal/test/tests.go +++ b/internal/test/tests.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "testing" - "github.com/Karaoke-Manager/karman/internal/api/apierror" + "github.com/Karaoke-Manager/server/internal/api/apierror" ) // InvalidPagination returns a test that runs a request against h with invalid pagination request parameters diff --git a/migrations/20230720180143_add_file.go b/migrations/20230720180143_add_file.go index e8b4460..725273b 100644 --- a/migrations/20230720180143_add_file.go +++ b/migrations/20230720180143_add_file.go @@ -3,12 +3,13 @@ package migrations import ( "context" "database/sql" - "github.com/Karaoke-Manager/karman/migrations/db" + "runtime" + "time" + + "github.com/Karaoke-Manager/server/migrations/db" "github.com/google/uuid" "github.com/pressly/goose/v3" "gorm.io/gorm" - "runtime" - "time" ) // This migration adds the File entity. diff --git a/migrations/20230720180400_add_song.go b/migrations/20230720180400_add_song.go index 36c668c..9e6b04b 100644 --- a/migrations/20230720180400_add_song.go +++ b/migrations/20230720180400_add_song.go @@ -11,7 +11,7 @@ import ( "github.com/pressly/goose/v3" "gorm.io/gorm" - "github.com/Karaoke-Manager/karman/migrations/db" + "github.com/Karaoke-Manager/server/migrations/db" ) // This migration adds the Song entity. diff --git a/pkg/render/context.go b/pkg/render/context.go index 671f4c7..faef2e9 100644 --- a/pkg/render/context.go +++ b/pkg/render/context.go @@ -4,8 +4,9 @@ package render import ( "context" - "github.com/Karaoke-Manager/karman/pkg/mediatype" "net/http" + + "github.com/Karaoke-Manager/server/pkg/mediatype" ) // contextKey is a value for use with context.WithValue. It's used as diff --git a/pkg/render/decode.go b/pkg/render/decode.go index f761d7e..2d17297 100644 --- a/pkg/render/decode.go +++ b/pkg/render/decode.go @@ -3,10 +3,11 @@ package render import ( "errors" "fmt" - "github.com/Karaoke-Manager/karman/pkg/mediatype" "io" "net/http" "strings" + + "github.com/Karaoke-Manager/server/pkg/mediatype" ) // DecodeFunc is the signature of a decoding function that can be registered via [RegisterDecoder]. diff --git a/pkg/render/encode.go b/pkg/render/encode.go index 058c5c5..d2efb4a 100644 --- a/pkg/render/encode.go +++ b/pkg/render/encode.go @@ -2,9 +2,10 @@ package render import ( "fmt" - "github.com/Karaoke-Manager/karman/pkg/mediatype" "io" "net/http" + + "github.com/Karaoke-Manager/server/pkg/mediatype" ) // EncodeFunc is the signature of encoder functions that can be registered via [RegisterEncoder]. diff --git a/pkg/render/form/codec.go b/pkg/render/form/codec.go index 9caedaf..9e70177 100644 --- a/pkg/render/form/codec.go +++ b/pkg/render/form/codec.go @@ -3,10 +3,11 @@ package form import ( - "github.com/Karaoke-Manager/karman/pkg/mediatype" - "github.com/Karaoke-Manager/karman/pkg/render" - "github.com/ajg/form" "io" + + "github.com/Karaoke-Manager/server/pkg/mediatype" + "github.com/Karaoke-Manager/server/pkg/render" + "github.com/ajg/form" ) func init() { diff --git a/pkg/render/html/codec.go b/pkg/render/html/codec.go index eddf81e..8461289 100644 --- a/pkg/render/html/codec.go +++ b/pkg/render/html/codec.go @@ -4,9 +4,10 @@ package html import ( "fmt" - "github.com/Karaoke-Manager/karman/pkg/render" "io" "reflect" + + "github.com/Karaoke-Manager/server/pkg/render" ) func init() { diff --git a/pkg/render/json/codec.go b/pkg/render/json/codec.go index e8c7cde..2e82e6a 100644 --- a/pkg/render/json/codec.go +++ b/pkg/render/json/codec.go @@ -4,9 +4,10 @@ package json import ( "encoding/json" - "github.com/Karaoke-Manager/karman/pkg/mediatype" - "github.com/Karaoke-Manager/karman/pkg/render" "io" + + "github.com/Karaoke-Manager/server/pkg/mediatype" + "github.com/Karaoke-Manager/server/pkg/render" ) func init() { diff --git a/pkg/render/negotiate.go b/pkg/render/negotiate.go index 20fbdde..42b2b2b 100644 --- a/pkg/render/negotiate.go +++ b/pkg/render/negotiate.go @@ -2,10 +2,11 @@ package render import ( "context" - "github.com/Karaoke-Manager/karman/pkg/mediatype" "net/http" "sort" "strings" + + "github.com/Karaoke-Manager/server/pkg/mediatype" ) // NotAcceptableHandler returns a middleware that registers h as a handler for failed content type negotiation. diff --git a/pkg/render/raw/codec.go b/pkg/render/raw/codec.go index 9b82696..319a5ad 100644 --- a/pkg/render/raw/codec.go +++ b/pkg/render/raw/codec.go @@ -4,9 +4,10 @@ package raw import ( "fmt" - "github.com/Karaoke-Manager/karman/pkg/mediatype" - "github.com/Karaoke-Manager/karman/pkg/render" "io" + + "github.com/Karaoke-Manager/server/pkg/mediatype" + "github.com/Karaoke-Manager/server/pkg/render" ) func init() { diff --git a/pkg/render/xml/codec.go b/pkg/render/xml/codec.go index 8e788dc..f3879a3 100644 --- a/pkg/render/xml/codec.go +++ b/pkg/render/xml/codec.go @@ -6,9 +6,10 @@ import ( "bytes" "encoding/xml" "fmt" - "github.com/Karaoke-Manager/karman/pkg/mediatype" - "github.com/Karaoke-Manager/karman/pkg/render" "io" + + "github.com/Karaoke-Manager/server/pkg/mediatype" + "github.com/Karaoke-Manager/server/pkg/render" ) func init() {