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:
commit
6a729425cb
14
Makefile
14
Makefile
@ -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
|
docker start postgres || docker run --name postgres -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d postgres:15-alpine
|
||||||
|
|
||||||
migratenew:
|
migratenew:
|
||||||
migrate create -ext sql -dir db/migration -seq init_schema
|
migrate create -ext sql -dir bff/db/migration -seq init_schema
|
||||||
|
|
||||||
migrateup:
|
migrateup:
|
||||||
migrate -path db/migration -database $(DB_URL) -verbose up
|
migrate -path bff/db/migration -database $(DB_URL) -verbose up
|
||||||
|
|
||||||
migratedown:
|
migratedown:
|
||||||
migrate -path db/migration -database $(DB_URL) -verbose down
|
migrate -path bff/db/migration -database $(DB_URL) -verbose down
|
||||||
|
|
||||||
createdb:
|
createdb:
|
||||||
docker exec -it postgres createdb --username=root --owner=root df
|
docker exec -it postgres createdb --username=root --owner=root df
|
||||||
@ -32,15 +32,15 @@ sqlcinit:
|
|||||||
sqlc init
|
sqlc init
|
||||||
|
|
||||||
test:
|
test:
|
||||||
go test -v -cover -short -count=1 ./...
|
cd bff && go test -v -cover -short -count=1 ./... && cd ..
|
||||||
|
|
||||||
coverage:
|
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:
|
server:
|
||||||
go run main.go
|
cd bff && go run main.go && cd ..
|
||||||
|
|
||||||
mock:
|
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
|
.PHONY: postgres migratenew createdb dropdb migrateup migratedown sqlc sqlcinit test server, initialize
|
||||||
|
@ -8,8 +8,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
db "github.com/itsscb/df/db/sqlc"
|
db "github.com/itsscb/df/bff/db/sqlc"
|
||||||
"github.com/itsscb/df/token"
|
"github.com/itsscb/df/bff/token"
|
||||||
"golang.org/x/exp/slog"
|
"golang.org/x/exp/slog"
|
||||||
)
|
)
|
||||||
|
|
@ -12,10 +12,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
mockdb "github.com/itsscb/df/db/mock"
|
mockdb "github.com/itsscb/df/bff/db/mock"
|
||||||
db "github.com/itsscb/df/db/sqlc"
|
db "github.com/itsscb/df/bff/db/sqlc"
|
||||||
"github.com/itsscb/df/token"
|
"github.com/itsscb/df/bff/token"
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"go.uber.org/mock/gomock"
|
"go.uber.org/mock/gomock"
|
||||||
)
|
)
|
@ -6,7 +6,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
var config util.Config
|
var config util.Config
|
@ -7,7 +7,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/itsscb/df/token"
|
"github.com/itsscb/df/bff/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
@ -8,8 +8,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
mockdb "github.com/itsscb/df/db/mock"
|
mockdb "github.com/itsscb/df/bff/db/mock"
|
||||||
"github.com/itsscb/df/token"
|
"github.com/itsscb/df/bff/token"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"go.uber.org/mock/gomock"
|
"go.uber.org/mock/gomock"
|
||||||
)
|
)
|
@ -6,9 +6,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
db "github.com/itsscb/df/db/sqlc"
|
db "github.com/itsscb/df/bff/db/sqlc"
|
||||||
"github.com/itsscb/df/token"
|
"github.com/itsscb/df/bff/token"
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Server serves HTTP requests for df service
|
// Server serves HTTP requests for df service
|
@ -8,8 +8,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
db "github.com/itsscb/df/db/sqlc"
|
db "github.com/itsscb/df/bff/db/sqlc"
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type loginAccountRequest struct {
|
type loginAccountRequest struct {
|
@ -1,9 +1,9 @@
|
|||||||
// Code generated by MockGen. DO NOT EDIT.
|
// 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:
|
// 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 is a generated GoMock package.
|
||||||
package mockdb
|
package mockdb
|
||||||
@ -13,7 +13,7 @@ import (
|
|||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
|
|
||||||
uuid "github.com/google/uuid"
|
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"
|
gomock "go.uber.org/mock/gomock"
|
||||||
)
|
)
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
_ "github.com/lib/pq"
|
_ "github.com/lib/pq"
|
||||||
)
|
)
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
|||||||
"database/sql"
|
"database/sql"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CreateAccountTxParams struct {
|
type CreateAccountTxParams struct {
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type UpdateAccountTxParams struct {
|
type UpdateAccountTxParams struct {
|
@ -4,14 +4,14 @@ import (
|
|||||||
"database/sql"
|
"database/sql"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/itsscb/df/api"
|
"github.com/itsscb/df/bff/api"
|
||||||
db "github.com/itsscb/df/db/sqlc"
|
db "github.com/itsscb/df/bff/db/sqlc"
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
_ "github.com/lib/pq"
|
_ "github.com/lib/pq"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
config, err := util.LoadConfig(".")
|
config, err := util.LoadConfig("./..")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("cannot load config:", err)
|
log.Fatal("cannot load config:", err)
|
||||||
}
|
}
|
@ -4,7 +4,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/itsscb/df/util"
|
"github.com/itsscb/df/bff/util"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user