diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1b7fb31..6fbfbe0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,8 +24,8 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - - run: go test ./storage ./server ./internal/tools -v - - run: go test ./storage -bench=. + - run: go test ./internal/storage ./server ./internal/tools -v + - run: go test ./internal/storage -bench=. # build the assets - uses: actions/setup-node@v3 diff --git a/cmd/root.go b/cmd/root.go index 90c4768..2345b67 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -9,9 +9,9 @@ import ( "github.com/axllent/mailpit/config" "github.com/axllent/mailpit/internal/logger" + "github.com/axllent/mailpit/internal/storage" "github.com/axllent/mailpit/server" "github.com/axllent/mailpit/server/smtpd" - "github.com/axllent/mailpit/storage" "github.com/spf13/cobra" ) @@ -142,7 +142,7 @@ func init() { // Load settings from environment func initConfigFromEnv() { - // defaults from envars if provided + // inherit from environment if provided if len(os.Getenv("MP_DATA_FILE")) > 0 { config.DataFile = os.Getenv("MP_DATA_FILE") } diff --git a/internal/linkcheck/main.go b/internal/linkcheck/main.go index c052608..d00c632 100644 --- a/internal/linkcheck/main.go +++ b/internal/linkcheck/main.go @@ -6,8 +6,8 @@ import ( "strings" "github.com/PuerkitoBio/goquery" + "github.com/axllent/mailpit/internal/storage" "github.com/axllent/mailpit/internal/tools" - "github.com/axllent/mailpit/storage" ) var linkRe = regexp.MustCompile(`(?m)\b(http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:'!\/~+#-]*[\w@?^=%&\/~+#-])`) diff --git a/server/apiv1/api.go b/server/apiv1/api.go index 5c8c6a1..c1f64a7 100644 --- a/server/apiv1/api.go +++ b/server/apiv1/api.go @@ -14,9 +14,9 @@ import ( "github.com/axllent/mailpit/internal/htmlcheck" "github.com/axllent/mailpit/internal/linkcheck" "github.com/axllent/mailpit/internal/logger" + "github.com/axllent/mailpit/internal/storage" "github.com/axllent/mailpit/internal/tools" "github.com/axllent/mailpit/server/smtpd" - "github.com/axllent/mailpit/storage" "github.com/gorilla/mux" uuid "github.com/satori/go.uuid" ) diff --git a/server/apiv1/info.go b/server/apiv1/info.go index 7d07275..d0dd123 100644 --- a/server/apiv1/info.go +++ b/server/apiv1/info.go @@ -7,8 +7,8 @@ import ( "runtime" "github.com/axllent/mailpit/config" + "github.com/axllent/mailpit/internal/storage" "github.com/axllent/mailpit/internal/updater" - "github.com/axllent/mailpit/storage" ) // Response includes the current and latest Mailpit version, database info, and memory usage diff --git a/server/apiv1/structs.go b/server/apiv1/structs.go index 38090bd..318ef69 100644 --- a/server/apiv1/structs.go +++ b/server/apiv1/structs.go @@ -3,7 +3,7 @@ package apiv1 import ( "github.com/axllent/mailpit/internal/htmlcheck" "github.com/axllent/mailpit/internal/linkcheck" - "github.com/axllent/mailpit/storage" + "github.com/axllent/mailpit/internal/storage" ) // MessagesSummary is a summary of a list of messages diff --git a/server/apiv1/thumbnails.go b/server/apiv1/thumbnails.go index 4d1d593..8eb8728 100644 --- a/server/apiv1/thumbnails.go +++ b/server/apiv1/thumbnails.go @@ -11,7 +11,7 @@ import ( "strings" "github.com/axllent/mailpit/internal/logger" - "github.com/axllent/mailpit/storage" + "github.com/axllent/mailpit/internal/storage" "github.com/disintegration/imaging" "github.com/gorilla/mux" "github.com/jhillyerd/enmime" diff --git a/server/server.go b/server/server.go index e128813..7beb4c5 100644 --- a/server/server.go +++ b/server/server.go @@ -16,10 +16,10 @@ import ( "github.com/axllent/mailpit/config" "github.com/axllent/mailpit/internal/logger" + "github.com/axllent/mailpit/internal/storage" "github.com/axllent/mailpit/server/apiv1" "github.com/axllent/mailpit/server/handlers" "github.com/axllent/mailpit/server/websockets" - "github.com/axllent/mailpit/storage" "github.com/gorilla/mux" ) diff --git a/server/server_test.go b/server/server_test.go index 5b45cfd..495a840 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -13,8 +13,8 @@ import ( "github.com/axllent/mailpit/config" "github.com/axllent/mailpit/internal/logger" + "github.com/axllent/mailpit/internal/storage" "github.com/axllent/mailpit/server/apiv1" - "github.com/axllent/mailpit/storage" "github.com/jhillyerd/enmime" ) diff --git a/server/smtpd/smtpd.go b/server/smtpd/smtpd.go index 20dfaa4..482cb32 100644 --- a/server/smtpd/smtpd.go +++ b/server/smtpd/smtpd.go @@ -11,7 +11,7 @@ import ( "github.com/axllent/mailpit/config" "github.com/axllent/mailpit/internal/logger" - "github.com/axllent/mailpit/storage" + "github.com/axllent/mailpit/internal/storage" "github.com/mhale/smtpd" uuid "github.com/satori/go.uuid" ) diff --git a/server/ui/api/v1/swagger.json b/server/ui/api/v1/swagger.json index e9a1406..825bde4 100644 --- a/server/ui/api/v1/swagger.json +++ b/server/ui/api/v1/swagger.json @@ -732,7 +732,7 @@ "format": "int64" } }, - "x-go-package": "github.com/axllent/mailpit/storage" + "x-go-package": "github.com/axllent/mailpit/internal/storage" }, "DeleteRequest": { "description": "Delete request", @@ -1058,7 +1058,7 @@ } } }, - "x-go-package": "github.com/axllent/mailpit/storage" + "x-go-package": "github.com/axllent/mailpit/internal/storage" }, "MessageHeaders": { "description": "Message headers", @@ -1139,7 +1139,7 @@ } } }, - "x-go-package": "github.com/axllent/mailpit/storage" + "x-go-package": "github.com/axllent/mailpit/internal/storage" }, "MessagesSummary": { "description": "MessagesSummary is a summary of a list of messages", @@ -1335,4 +1335,4 @@ } } } -} +} \ No newline at end of file