fix: migrate to codeberg

This commit is contained in:
genofire 2023-10-23 21:40:10 +02:00
parent 9fe244fa48
commit 07a20220be
31 changed files with 46 additions and 46 deletions

View File

@ -2,12 +2,12 @@ language: go
go: go:
- tip - tip
install: 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 github.com/mattn/goveralls
- go get golang.org/x/tools/cmd/cover - go get golang.org/x/tools/cmd/cover
- go get github.com/client9/misspell/cmd/misspell - go get github.com/client9/misspell/cmd/misspell
script: 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 # - go install # Library does not need to build
- ./contrib/ci/check-coverage travis-ci - ./contrib/ci/check-coverage travis-ci
- ./contrib/ci/check-testfiles - ./contrib/ci/check-testfiles

View File

@ -19,7 +19,7 @@ pipeline:
group: test group: test
commands: commands:
- go get -d -t ./... - 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" - go tool cover -func=".testCoverage.txt"
test-race: test-race:
@ -27,4 +27,4 @@ pipeline:
group: test-race group: test-race
commands: commands:
- go get -d -t ./... - 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

View File

@ -1,7 +1,7 @@
# golang-lib # golang-lib
[![DroneCI](https://ci.sum7.eu/api/badges/genofire/golang-lib/status.svg?branch=main)](https://ci.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/dev.sum7.eu/genofire/golang-lib)](https://goreportcard.com/report/dev.sum7.eu/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/dev.sum7.eu/genofire/golang-lib.svg)](https://pkg.go.dev/dev.sum7.eu/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 some packages collected for easy and often used functions

View File

@ -4,7 +4,7 @@ import (
"testing" "testing"
"github.com/stretchr/testify/assert" "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"
"github.com/knadh/koanf/parsers/toml" "github.com/knadh/koanf/parsers/toml"

View File

@ -3,7 +3,7 @@ package file
import ( import (
"time" "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 // NewSaveJSONWorker Starts a worker, which save periodly data to json file

2
go.mod
View File

@ -1,4 +1,4 @@
module dev.sum7.eu/genofire/golang-lib module codeberg.org/genofire/golang-lib
go 1.16 go 1.16

View File

@ -5,7 +5,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"dev.sum7.eu/genofire/golang-lib/web" "codeberg.org/genofire/golang-lib/web"
) )
var ( var (

View File

@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert" "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) { func TestAPIStatus(t *testing.T) {

View File

@ -8,7 +8,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"gorm.io/gorm" "gorm.io/gorm"
"dev.sum7.eu/genofire/golang-lib/web" "codeberg.org/genofire/golang-lib/web"
) )
type login struct { type login struct {

View File

@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"dev.sum7.eu/genofire/golang-lib/web" "codeberg.org/genofire/golang-lib/web"
"dev.sum7.eu/genofire/golang-lib/web/webtest" "codeberg.org/genofire/golang-lib/web/webtest"
) )
func TestAPILogin(t *testing.T) { func TestAPILogin(t *testing.T) {

View File

@ -3,7 +3,7 @@ package auth
import ( import (
"net/http" "net/http"
"dev.sum7.eu/genofire/golang-lib/web" "codeberg.org/genofire/golang-lib/web"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

View File

@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"dev.sum7.eu/genofire/golang-lib/web" "codeberg.org/genofire/golang-lib/web"
"dev.sum7.eu/genofire/golang-lib/web/webtest" "codeberg.org/genofire/golang-lib/web/webtest"
) )
func TestAPIDeleteMyProfil(t *testing.T) { func TestAPIDeleteMyProfil(t *testing.T) {

View File

@ -5,7 +5,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"dev.sum7.eu/genofire/golang-lib/web" "codeberg.org/genofire/golang-lib/web"
) )
// @Summary Change Password // @Summary Change Password

View File

@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"dev.sum7.eu/genofire/golang-lib/web" "codeberg.org/genofire/golang-lib/web"
"dev.sum7.eu/genofire/golang-lib/web/webtest" "codeberg.org/genofire/golang-lib/web/webtest"
) )
func TestAPIPassword(t *testing.T) { func TestAPIPassword(t *testing.T) {

View File

@ -5,7 +5,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"dev.sum7.eu/genofire/golang-lib/web" "codeberg.org/genofire/golang-lib/web"
) )
// @Summary Login status // @Summary Login status

View File

@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"dev.sum7.eu/genofire/golang-lib/web" "codeberg.org/genofire/golang-lib/web"
"dev.sum7.eu/genofire/golang-lib/web/webtest" "codeberg.org/genofire/golang-lib/web/webtest"
) )
func TestAPIMyStatus(t *testing.T) { func TestAPIMyStatus(t *testing.T) {

View File

@ -8,7 +8,7 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
"gorm.io/gorm" "gorm.io/gorm"
"dev.sum7.eu/genofire/golang-lib/web" "codeberg.org/genofire/golang-lib/web"
) )
// PasswordWithForgetCode - JSON Request to set password without login // PasswordWithForgetCode - JSON Request to set password without login

View File

@ -7,8 +7,8 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"dev.sum7.eu/genofire/golang-lib/web" "codeberg.org/genofire/golang-lib/web"
"dev.sum7.eu/genofire/golang-lib/web/webtest" "codeberg.org/genofire/golang-lib/web/webtest"
) )
func TestAPIPasswordCode(t *testing.T) { func TestAPIPasswordCode(t *testing.T) {

View File

@ -9,7 +9,7 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
"gorm.io/gorm" "gorm.io/gorm"
"dev.sum7.eu/genofire/golang-lib/web" "codeberg.org/genofire/golang-lib/web"
) )
// IsLoginWithUserID get UserID of session in golang-gin // IsLoginWithUserID get UserID of session in golang-gin

View File

@ -1,7 +1,7 @@
package auth package auth
import ( import (
"dev.sum7.eu/genofire/golang-lib/web" "codeberg.org/genofire/golang-lib/web"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

View File

@ -6,7 +6,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/google/uuid" "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 // MiddlewareLogin if user id in session for golang-gin

View File

@ -8,7 +8,7 @@ import (
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
"gorm.io/gorm" "gorm.io/gorm"
"dev.sum7.eu/genofire/golang-lib/database" "codeberg.org/genofire/golang-lib/database"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -1,8 +1,8 @@
package file package file
import ( import (
"dev.sum7.eu/genofire/golang-lib/web/file/fs" "codeberg.org/genofire/golang-lib/web/file/fs"
"dev.sum7.eu/genofire/golang-lib/web/file/s3" "codeberg.org/genofire/golang-lib/web/file/s3"
) )
// fsType represents a type of file store. // fsType represents a type of file store.

View File

@ -3,8 +3,8 @@ package file_test
import ( import (
"testing" "testing"
fsfile "dev.sum7.eu/genofire/golang-lib/file" fsfile "codeberg.org/genofire/golang-lib/file"
"dev.sum7.eu/genofire/golang-lib/web/file" "codeberg.org/genofire/golang-lib/web/file"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -9,8 +9,8 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"dev.sum7.eu/genofire/golang-lib/web/file" "codeberg.org/genofire/golang-lib/web/file"
"dev.sum7.eu/genofire/golang-lib/web/file/fs" "codeberg.org/genofire/golang-lib/web/file/fs"
) )
func TestOpenStat(t *testing.T) { func TestOpenStat(t *testing.T) {

View File

@ -15,7 +15,7 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"dev.sum7.eu/genofire/golang-lib/web/file" "codeberg.org/genofire/golang-lib/web/file"
) )
type TestFS struct { type TestFS struct {

View File

@ -5,8 +5,8 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"dev.sum7.eu/genofire/golang-lib/web/file" "codeberg.org/genofire/golang-lib/web/file"
"dev.sum7.eu/genofire/golang-lib/web/file/s3" "codeberg.org/genofire/golang-lib/web/file/s3"
) )
// TODO: actually test, either using little dummies or using sth like play.min.io // TODO: actually test, either using little dummies or using sth like play.min.io

View File

@ -20,7 +20,7 @@ import (
"golang.org/x/crypto/acme/autocert" "golang.org/x/crypto/acme/autocert"
// internal // internal
"dev.sum7.eu/genofire/golang-lib/mailer" "codeberg.org/genofire/golang-lib/mailer"
"gorm.io/gorm" "gorm.io/gorm"
) )

View File

@ -14,7 +14,7 @@ import (
// db metrics // db metrics
gormPrometheus "gorm.io/plugin/prometheus" gormPrometheus "gorm.io/plugin/prometheus"
"dev.sum7.eu/genofire/golang-lib/web" "codeberg.org/genofire/golang-lib/web"
) )
var ( var (

View File

@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert" "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) { func TestMetricsLoaded(t *testing.T) {

View File

@ -12,9 +12,9 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"go.uber.org/zap" "go.uber.org/zap"
"dev.sum7.eu/genofire/golang-lib/database" "codeberg.org/genofire/golang-lib/database"
"dev.sum7.eu/genofire/golang-lib/mailer" "codeberg.org/genofire/golang-lib/mailer"
"dev.sum7.eu/genofire/golang-lib/web" "codeberg.org/genofire/golang-lib/web"
) )
var ( var (