Merge pull request #59 from itsscb/itsscb/issue_Move-backend-files-into-subfolder-bff-58

Move backend files into subfolder bff
This commit is contained in:
itsscb 2023-10-02 10:06:37 +02:00 committed by GitHub
commit 6a729425cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
63 changed files with 41 additions and 41 deletions

View File

@ -11,13 +11,13 @@ postgres:
docker start postgres || docker run --name postgres -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d postgres:15-alpine
migratenew:
migrate create -ext sql -dir db/migration -seq init_schema
migrate create -ext sql -dir bff/db/migration -seq init_schema
migrateup:
migrate -path db/migration -database $(DB_URL) -verbose up
migrate -path bff/db/migration -database $(DB_URL) -verbose up
migratedown:
migrate -path db/migration -database $(DB_URL) -verbose down
migrate -path bff/db/migration -database $(DB_URL) -verbose down
createdb:
docker exec -it postgres createdb --username=root --owner=root df
@ -32,15 +32,15 @@ sqlcinit:
sqlc init
test:
go test -v -cover -short -count=1 ./...
cd bff && go test -v -cover -short -count=1 ./... && cd ..
coverage:
go test -coverprofile=coverage.out ./... && go tool cover -html=coverage.out
cd bff && go test -coverprofile=coverage.out ./... && go tool cover -html=coverage.out && cd ..
server:
go run main.go
cd bff && go run main.go && cd ..
mock:
mockgen -package mockdb -destination db/mock/store.go github.com/itsscb/df/db/sqlc Store
mockgen -package mockdb -destination db/mock/store.go github.com/itsscb/df/bff/db/sqlc Store
.PHONY: postgres migratenew createdb dropdb migrateup migratedown sqlc sqlcinit test server, initialize

View File

@ -8,8 +8,8 @@ import (
"time"
"github.com/gin-gonic/gin"
db "github.com/itsscb/df/db/sqlc"
"github.com/itsscb/df/token"
db "github.com/itsscb/df/bff/db/sqlc"
"github.com/itsscb/df/bff/token"
"golang.org/x/exp/slog"
)

View File

@ -12,10 +12,10 @@ import (
"time"
"github.com/gin-gonic/gin"
mockdb "github.com/itsscb/df/db/mock"
db "github.com/itsscb/df/db/sqlc"
"github.com/itsscb/df/token"
"github.com/itsscb/df/util"
mockdb "github.com/itsscb/df/bff/db/mock"
db "github.com/itsscb/df/bff/db/sqlc"
"github.com/itsscb/df/bff/token"
"github.com/itsscb/df/bff/util"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
)

View File

@ -6,7 +6,7 @@ import (
"time"
"github.com/gin-gonic/gin"
"github.com/itsscb/df/util"
"github.com/itsscb/df/bff/util"
)
var config util.Config

View File

@ -7,7 +7,7 @@ import (
"strings"
"github.com/gin-gonic/gin"
"github.com/itsscb/df/token"
"github.com/itsscb/df/bff/token"
)
const (

View File

@ -8,8 +8,8 @@ import (
"time"
"github.com/gin-gonic/gin"
mockdb "github.com/itsscb/df/db/mock"
"github.com/itsscb/df/token"
mockdb "github.com/itsscb/df/bff/db/mock"
"github.com/itsscb/df/bff/token"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
)

View File

@ -6,9 +6,9 @@ import (
"os"
"github.com/gin-gonic/gin"
db "github.com/itsscb/df/db/sqlc"
"github.com/itsscb/df/token"
"github.com/itsscb/df/util"
db "github.com/itsscb/df/bff/db/sqlc"
"github.com/itsscb/df/bff/token"
"github.com/itsscb/df/bff/util"
)
// Server serves HTTP requests for df service

View File

@ -8,8 +8,8 @@ import (
"github.com/gin-gonic/gin"
"github.com/google/uuid"
db "github.com/itsscb/df/db/sqlc"
"github.com/itsscb/df/util"
db "github.com/itsscb/df/bff/db/sqlc"
"github.com/itsscb/df/bff/util"
)
type loginAccountRequest struct {

View File

@ -1,9 +1,9 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/itsscb/df/db/sqlc (interfaces: Store)
// Source: github.com/itsscb/df/bff/db/sqlc (interfaces: Store)
//
// Generated by this command:
//
// mockgen -package mockdb -destination db/mock/store.go github.com/itsscb/df/db/sqlc Store
// mockgen -package mockdb -destination db/mock/store.go github.com/itsscb/df/bff/db/sqlc Store
//
// Package mockdb is a generated GoMock package.
package mockdb
@ -13,7 +13,7 @@ import (
reflect "reflect"
uuid "github.com/google/uuid"
db "github.com/itsscb/df/db/sqlc"
db "github.com/itsscb/df/bff/db/sqlc"
gomock "go.uber.org/mock/gomock"
)

View File

@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/itsscb/df/util"
"github.com/itsscb/df/bff/util"
"github.com/stretchr/testify/require"
)

View File

@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/itsscb/df/util"
"github.com/itsscb/df/bff/util"
"github.com/stretchr/testify/require"
)

View File

@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/itsscb/df/util"
"github.com/itsscb/df/bff/util"
"github.com/stretchr/testify/require"
)

View File

@ -6,7 +6,7 @@ import (
"os"
"testing"
"github.com/itsscb/df/util"
"github.com/itsscb/df/bff/util"
_ "github.com/lib/pq"
)

View File

@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/itsscb/df/util"
"github.com/itsscb/df/bff/util"
"github.com/stretchr/testify/require"
)

View File

@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/itsscb/df/util"
"github.com/itsscb/df/bff/util"
"github.com/stretchr/testify/require"
)

View File

@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/itsscb/df/util"
"github.com/itsscb/df/bff/util"
"github.com/stretchr/testify/require"
)

View File

@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/itsscb/df/util"
"github.com/itsscb/df/bff/util"
"github.com/stretchr/testify/require"
)

View File

@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/itsscb/df/util"
"github.com/itsscb/df/bff/util"
"github.com/stretchr/testify/require"
)

View File

@ -5,7 +5,7 @@ import (
"database/sql"
"time"
"github.com/itsscb/df/util"
"github.com/itsscb/df/bff/util"
)
type CreateAccountTxParams struct {

View File

@ -4,7 +4,7 @@ import (
"context"
"database/sql"
"github.com/itsscb/df/util"
"github.com/itsscb/df/bff/util"
)
type UpdateAccountTxParams struct {

View File

View File

View File

@ -4,14 +4,14 @@ import (
"database/sql"
"log"
"github.com/itsscb/df/api"
db "github.com/itsscb/df/db/sqlc"
"github.com/itsscb/df/util"
"github.com/itsscb/df/bff/api"
db "github.com/itsscb/df/bff/db/sqlc"
"github.com/itsscb/df/bff/util"
_ "github.com/lib/pq"
)
func main() {
config, err := util.LoadConfig(".")
config, err := util.LoadConfig("./..")
if err != nil {
log.Fatal("cannot load config:", err)
}

View File

@ -4,7 +4,7 @@ import (
"testing"
"time"
"github.com/itsscb/df/util"
"github.com/itsscb/df/bff/util"
"github.com/stretchr/testify/require"
)