diff --git a/.travis.yml b/.travis.yml index 557587c..adac7f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,12 +2,12 @@ language: go go: - tip install: - - go get -t dev.sum7.eu/genofire/golang-lib/... + - go get -t codeberg.org/genofire/golang-lib/... - go get github.com/mattn/goveralls - go get golang.org/x/tools/cmd/cover - go get github.com/client9/misspell/cmd/misspell script: - - cd $GOPATH/src/dev.sum7.eu/genofire/golang-lib + - cd $GOPATH/src/codeberg.org/genofire/golang-lib # - go install # Library does not need to build - ./contrib/ci/check-coverage travis-ci - ./contrib/ci/check-testfiles diff --git a/.woodpecker.yml b/.woodpecker.yml index 6b49af3..816ed50 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -19,7 +19,7 @@ pipeline: group: test commands: - go get -d -t ./... - - go test -ldflags "-X dev.sum7.eu/genofire/golang-lib/web.TestRunTLS=false -X dev.sum7.eu/genofire/golang-lib/web/webtest.DBConnection=postgres://root:root@database:26257/defaultdb?sslmode=disable -X dev.sum7.eu/genofire/golang-lib/database.DBConnection=postgres://root:root@database:26257/defaultdb?sslmode=disable" $(go list ./... | grep -v /vendor/) -v -failfast -p 1 -coverprofile .testCoverage.txt + - go test -ldflags "-X codeberg.org/genofire/golang-lib/web.TestRunTLS=false -X codeberg.org/genofire/golang-lib/web/webtest.DBConnection=postgres://root:root@database:26257/defaultdb?sslmode=disable -X codeberg.org/genofire/golang-lib/database.DBConnection=postgres://root:root@database:26257/defaultdb?sslmode=disable" $(go list ./... | grep -v /vendor/) -v -failfast -p 1 -coverprofile .testCoverage.txt - go tool cover -func=".testCoverage.txt" test-race: @@ -27,4 +27,4 @@ pipeline: group: test-race commands: - go get -d -t ./... - - go test -ldflags "-X dev.sum7.eu/genofire/golang-lib/web.TestRunTLS=false -X dev.sum7.eu/genofire/golang-lib/web/webtest.DBConnection=postgres://root:root@database:26257/defaultdb?sslmode=disable -X dev.sum7.eu/genofire/golang-lib/database.DBConnection=postgres://root:root@database:26257/defaultdb?sslmode=disable" $(go list ./... | grep -v /vendor/) -race + - go test -ldflags "-X codeberg.org/genofire/golang-lib/web.TestRunTLS=false -X codeberg.org/genofire/golang-lib/web/webtest.DBConnection=postgres://root:root@database:26257/defaultdb?sslmode=disable -X codeberg.org/genofire/golang-lib/database.DBConnection=postgres://root:root@database:26257/defaultdb?sslmode=disable" $(go list ./... | grep -v /vendor/) -race diff --git a/README.md b/README.md index e4959c6..55a906e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # golang-lib -[![DroneCI](https://ci.sum7.eu/api/badges/genofire/golang-lib/status.svg?branch=main)](https://ci.sum7.eu/genofire/golang-lib) -[![Go Report Card](https://goreportcard.com/badge/dev.sum7.eu/genofire/golang-lib)](https://goreportcard.com/report/dev.sum7.eu/genofire/golang-lib) -[![Go Reference](https://pkg.go.dev/badge/dev.sum7.eu/genofire/golang-lib.svg)](https://pkg.go.dev/dev.sum7.eu/genofire/golang-lib) +[![DroneCI](https://ci.codeberg.org/api/badges/genofire/golang-lib/status.svg?branch=main)](https://ci.codeberg.org/genofire/golang-lib) +[![Go Report Card](https://goreportcard.com/badge/codeberg.org/genofire/golang-lib)](https://goreportcard.com/report/codeberg.org/genofire/golang-lib) +[![Go Reference](https://pkg.go.dev/badge/codeberg.org/genofire/golang-lib.svg)](https://pkg.go.dev/codeberg.org/genofire/golang-lib) some packages collected for easy and often used functions diff --git a/database/external_test.go b/database/external_test.go index 83c39ee..b3a685d 100644 --- a/database/external_test.go +++ b/database/external_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "dev.sum7.eu/genofire/golang-lib/database" + "codeberg.org/genofire/golang-lib/database" "github.com/knadh/koanf" "github.com/knadh/koanf/parsers/toml" diff --git a/file/worker.go b/file/worker.go index 9b277f1..743694f 100644 --- a/file/worker.go +++ b/file/worker.go @@ -3,7 +3,7 @@ package file import ( "time" - "dev.sum7.eu/genofire/golang-lib/worker" + "codeberg.org/genofire/golang-lib/worker" ) // NewSaveJSONWorker Starts a worker, which save periodly data to json file diff --git a/go.mod b/go.mod index f3255f0..3720be9 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module dev.sum7.eu/genofire/golang-lib +module codeberg.org/genofire/golang-lib go 1.16 diff --git a/web/api/status/main.go b/web/api/status/main.go index 4a2daf6..90e7390 100644 --- a/web/api/status/main.go +++ b/web/api/status/main.go @@ -5,7 +5,7 @@ import ( "github.com/gin-gonic/gin" - "dev.sum7.eu/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/web" ) var ( diff --git a/web/api/status/main_test.go b/web/api/status/main_test.go index 2697edf..4ad69e1 100644 --- a/web/api/status/main_test.go +++ b/web/api/status/main_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "dev.sum7.eu/genofire/golang-lib/web/webtest" + "codeberg.org/genofire/golang-lib/web/webtest" ) func TestAPIStatus(t *testing.T) { diff --git a/web/auth/api_login.go b/web/auth/api_login.go index 26eb043..53d1612 100644 --- a/web/auth/api_login.go +++ b/web/auth/api_login.go @@ -8,7 +8,7 @@ import ( "github.com/gin-gonic/gin" "gorm.io/gorm" - "dev.sum7.eu/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/web" ) type login struct { diff --git a/web/auth/api_login_test.go b/web/auth/api_login_test.go index 8082d34..97b0fb4 100644 --- a/web/auth/api_login_test.go +++ b/web/auth/api_login_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "dev.sum7.eu/genofire/golang-lib/web" - "dev.sum7.eu/genofire/golang-lib/web/webtest" + "codeberg.org/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/web/webtest" ) func TestAPILogin(t *testing.T) { diff --git a/web/auth/api_my_delete.go b/web/auth/api_my_delete.go index a62c295..6b86749 100644 --- a/web/auth/api_my_delete.go +++ b/web/auth/api_my_delete.go @@ -3,7 +3,7 @@ package auth import ( "net/http" - "dev.sum7.eu/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/web" "github.com/gin-gonic/gin" ) diff --git a/web/auth/api_my_delete_test.go b/web/auth/api_my_delete_test.go index 0e15daf..69fea5e 100644 --- a/web/auth/api_my_delete_test.go +++ b/web/auth/api_my_delete_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "dev.sum7.eu/genofire/golang-lib/web" - "dev.sum7.eu/genofire/golang-lib/web/webtest" + "codeberg.org/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/web/webtest" ) func TestAPIDeleteMyProfil(t *testing.T) { diff --git a/web/auth/api_my_password.go b/web/auth/api_my_password.go index 1fb657b..64e7f7a 100644 --- a/web/auth/api_my_password.go +++ b/web/auth/api_my_password.go @@ -5,7 +5,7 @@ import ( "github.com/gin-gonic/gin" - "dev.sum7.eu/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/web" ) // @Summary Change Password diff --git a/web/auth/api_my_password_test.go b/web/auth/api_my_password_test.go index 6cb971f..d6fbfcf 100644 --- a/web/auth/api_my_password_test.go +++ b/web/auth/api_my_password_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "dev.sum7.eu/genofire/golang-lib/web" - "dev.sum7.eu/genofire/golang-lib/web/webtest" + "codeberg.org/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/web/webtest" ) func TestAPIPassword(t *testing.T) { diff --git a/web/auth/api_my_status.go b/web/auth/api_my_status.go index 67b5fd9..2f88f58 100644 --- a/web/auth/api_my_status.go +++ b/web/auth/api_my_status.go @@ -5,7 +5,7 @@ import ( "github.com/gin-gonic/gin" - "dev.sum7.eu/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/web" ) // @Summary Login status diff --git a/web/auth/api_my_status_test.go b/web/auth/api_my_status_test.go index 4b0fb10..fb0a9b1 100644 --- a/web/auth/api_my_status_test.go +++ b/web/auth/api_my_status_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "dev.sum7.eu/genofire/golang-lib/web" - "dev.sum7.eu/genofire/golang-lib/web/webtest" + "codeberg.org/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/web/webtest" ) func TestAPIMyStatus(t *testing.T) { diff --git a/web/auth/api_password_code.go b/web/auth/api_password_code.go index 058b642..ff0d1b8 100644 --- a/web/auth/api_password_code.go +++ b/web/auth/api_password_code.go @@ -8,7 +8,7 @@ import ( "github.com/google/uuid" "gorm.io/gorm" - "dev.sum7.eu/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/web" ) // PasswordWithForgetCode - JSON Request to set password without login diff --git a/web/auth/api_password_code_test.go b/web/auth/api_password_code_test.go index e567576..3ca671d 100644 --- a/web/auth/api_password_code_test.go +++ b/web/auth/api_password_code_test.go @@ -7,8 +7,8 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "dev.sum7.eu/genofire/golang-lib/web" - "dev.sum7.eu/genofire/golang-lib/web/webtest" + "codeberg.org/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/web/webtest" ) func TestAPIPasswordCode(t *testing.T) { diff --git a/web/auth/lib_user.go b/web/auth/lib_user.go index 1c6734e..c6206a4 100644 --- a/web/auth/lib_user.go +++ b/web/auth/lib_user.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "gorm.io/gorm" - "dev.sum7.eu/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/web" ) // IsLoginWithUserID get UserID of session in golang-gin diff --git a/web/auth/main.go b/web/auth/main.go index f4b6a32..08083cb 100644 --- a/web/auth/main.go +++ b/web/auth/main.go @@ -1,7 +1,7 @@ package auth import ( - "dev.sum7.eu/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/web" "github.com/gin-gonic/gin" ) diff --git a/web/auth/middleware.go b/web/auth/middleware.go index 046e389..580089d 100644 --- a/web/auth/middleware.go +++ b/web/auth/middleware.go @@ -6,7 +6,7 @@ import ( "github.com/gin-gonic/gin" "github.com/google/uuid" - "dev.sum7.eu/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/web" ) // MiddlewareLogin if user id in session for golang-gin diff --git a/web/auth/models_test.go b/web/auth/models_test.go index 167d5fb..b90ef10 100644 --- a/web/auth/models_test.go +++ b/web/auth/models_test.go @@ -8,7 +8,7 @@ import ( "golang.org/x/crypto/bcrypt" "gorm.io/gorm" - "dev.sum7.eu/genofire/golang-lib/database" + "codeberg.org/genofire/golang-lib/database" "github.com/stretchr/testify/assert" ) diff --git a/web/file/createfs.go b/web/file/createfs.go index 8909612..3017cb9 100644 --- a/web/file/createfs.go +++ b/web/file/createfs.go @@ -1,8 +1,8 @@ package file import ( - "dev.sum7.eu/genofire/golang-lib/web/file/fs" - "dev.sum7.eu/genofire/golang-lib/web/file/s3" + "codeberg.org/genofire/golang-lib/web/file/fs" + "codeberg.org/genofire/golang-lib/web/file/s3" ) // fsType represents a type of file store. diff --git a/web/file/createfs_test.go b/web/file/createfs_test.go index 67be9af..97f99ac 100644 --- a/web/file/createfs_test.go +++ b/web/file/createfs_test.go @@ -3,8 +3,8 @@ package file_test import ( "testing" - fsfile "dev.sum7.eu/genofire/golang-lib/file" - "dev.sum7.eu/genofire/golang-lib/web/file" + fsfile "codeberg.org/genofire/golang-lib/file" + "codeberg.org/genofire/golang-lib/web/file" "github.com/stretchr/testify/assert" ) diff --git a/web/file/fs/fs_test.go b/web/file/fs/fs_test.go index 6c760ea..118524f 100644 --- a/web/file/fs/fs_test.go +++ b/web/file/fs/fs_test.go @@ -9,8 +9,8 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "dev.sum7.eu/genofire/golang-lib/web/file" - "dev.sum7.eu/genofire/golang-lib/web/file/fs" + "codeberg.org/genofire/golang-lib/web/file" + "codeberg.org/genofire/golang-lib/web/file/fs" ) func TestOpenStat(t *testing.T) { diff --git a/web/file/fs_test.go b/web/file/fs_test.go index 0f9c1d1..2f9e4ff 100644 --- a/web/file/fs_test.go +++ b/web/file/fs_test.go @@ -15,7 +15,7 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "dev.sum7.eu/genofire/golang-lib/web/file" + "codeberg.org/genofire/golang-lib/web/file" ) type TestFS struct { diff --git a/web/file/s3/fs_test.go b/web/file/s3/fs_test.go index cb4ea04..3cdfbaf 100644 --- a/web/file/s3/fs_test.go +++ b/web/file/s3/fs_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/assert" - "dev.sum7.eu/genofire/golang-lib/web/file" - "dev.sum7.eu/genofire/golang-lib/web/file/s3" + "codeberg.org/genofire/golang-lib/web/file" + "codeberg.org/genofire/golang-lib/web/file/s3" ) // TODO: actually test, either using little dummies or using sth like play.min.io diff --git a/web/main.go b/web/main.go index 5b632c8..cd34e77 100644 --- a/web/main.go +++ b/web/main.go @@ -20,7 +20,7 @@ import ( "golang.org/x/crypto/acme/autocert" // internal - "dev.sum7.eu/genofire/golang-lib/mailer" + "codeberg.org/genofire/golang-lib/mailer" "gorm.io/gorm" ) diff --git a/web/metrics/main.go b/web/metrics/main.go index 0cbcbc3..f753977 100644 --- a/web/metrics/main.go +++ b/web/metrics/main.go @@ -14,7 +14,7 @@ import ( // db metrics gormPrometheus "gorm.io/plugin/prometheus" - "dev.sum7.eu/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/web" ) var ( diff --git a/web/metrics/main_test.go b/web/metrics/main_test.go index 6390422..b43f94b 100644 --- a/web/metrics/main_test.go +++ b/web/metrics/main_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "dev.sum7.eu/genofire/golang-lib/web/webtest" + "codeberg.org/genofire/golang-lib/web/webtest" ) func TestMetricsLoaded(t *testing.T) { diff --git a/web/webtest/main.go b/web/webtest/main.go index 11a3739..086cb33 100644 --- a/web/webtest/main.go +++ b/web/webtest/main.go @@ -12,9 +12,9 @@ import ( "github.com/gin-gonic/gin" "go.uber.org/zap" - "dev.sum7.eu/genofire/golang-lib/database" - "dev.sum7.eu/genofire/golang-lib/mailer" - "dev.sum7.eu/genofire/golang-lib/web" + "codeberg.org/genofire/golang-lib/database" + "codeberg.org/genofire/golang-lib/mailer" + "codeberg.org/genofire/golang-lib/web" ) var (