[server][core] move db and storage into core

This commit is contained in:
Abhishek Shroff
2024-10-19 18:33:55 +05:30
parent 2c1b907966
commit 4a40fffc20
32 changed files with 18 additions and 18 deletions

View File

@@ -6,8 +6,8 @@ import (
"os"
"github.com/shroff/phylum/server/internal/core/app"
"github.com/shroff/phylum/server/internal/db"
"github.com/shroff/phylum/server/internal/storage"
"github.com/shroff/phylum/server/internal/core/db"
"github.com/shroff/phylum/server/internal/core/storage"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)

View File

@@ -7,7 +7,7 @@ import (
"os"
"strings"
"github.com/shroff/phylum/server/internal/storage"
"github.com/shroff/phylum/server/internal/core/storage"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

View File

@@ -7,7 +7,7 @@ import (
"github.com/shroff/phylum/server/internal/command/appcmd"
"github.com/shroff/phylum/server/internal/command/fs"
"github.com/shroff/phylum/server/internal/db"
"github.com/shroff/phylum/server/internal/core/db"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"

View File

@@ -6,9 +6,9 @@ import (
"os"
"github.com/shroff/phylum/server/internal/core/app"
"github.com/shroff/phylum/server/internal/core/db"
"github.com/shroff/phylum/server/internal/core/fs"
"github.com/shroff/phylum/server/internal/db"
"github.com/shroff/phylum/server/internal/storage"
"github.com/shroff/phylum/server/internal/core/storage"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)

View File

@@ -6,7 +6,7 @@ import (
"os"
"strconv"
"github.com/shroff/phylum/server/internal/db"
"github.com/shroff/phylum/server/internal/core/db"
"github.com/spf13/cobra"
)

View File

@@ -6,9 +6,9 @@ import (
"time"
"github.com/google/uuid"
"github.com/shroff/phylum/server/internal/core/db"
"github.com/shroff/phylum/server/internal/core/fs"
"github.com/shroff/phylum/server/internal/db"
"github.com/shroff/phylum/server/internal/storage"
"github.com/shroff/phylum/server/internal/core/storage"
)
const defaultUserUsername = "phylum"

View File

@@ -8,8 +8,8 @@ import (
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgtype"
"github.com/shroff/phylum/server/internal/core/db"
"github.com/shroff/phylum/server/internal/core/errors"
"github.com/shroff/phylum/server/internal/db"
"golang.org/x/exp/rand"
)

View File

@@ -6,9 +6,9 @@ import (
"github.com/google/uuid"
"github.com/jackc/pgx/v5"
"github.com/shroff/phylum/server/internal/core/db"
"github.com/shroff/phylum/server/internal/core/errors"
"github.com/shroff/phylum/server/internal/core/fs"
"github.com/shroff/phylum/server/internal/db"
)
var ErrUserNotFound = errors.NewError(http.StatusNotFound, "user_not_found", "no such user")

View File

@@ -7,7 +7,7 @@ import (
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgxpool"
"github.com/shroff/phylum/server/internal/db/migrations"
"github.com/shroff/phylum/server/internal/core/db/migrations"
"github.com/sirupsen/logrus"
)

View File

@@ -4,7 +4,7 @@ import (
"context"
"fmt"
"github.com/shroff/phylum/server/internal/db/migrations"
"github.com/shroff/phylum/server/internal/core/db/migrations"
"github.com/sirupsen/logrus"
)

View File

@@ -11,8 +11,8 @@ import (
"github.com/google/uuid"
"github.com/jackc/pgx/v5"
"github.com/shroff/phylum/server/internal/db"
"github.com/shroff/phylum/server/internal/storage"
"github.com/shroff/phylum/server/internal/core/db"
"github.com/shroff/phylum/server/internal/core/storage"
"github.com/sirupsen/logrus"
)

View File

@@ -8,7 +8,7 @@ import (
"io"
"github.com/google/uuid"
"github.com/shroff/phylum/server/internal/db"
"github.com/shroff/phylum/server/internal/core/db"
)
type Storage interface {

View File

@@ -2,11 +2,11 @@ version: "2"
sql:
- engine: "postgresql"
queries: "sql/queries"
schema: "internal/db/migrations/data"
schema: "internal/core/db/migrations/data"
gen:
go:
package: "db"
out: "internal/db"
out: "internal/core/db"
sql_package: "pgx/v5"
overrides:
- db_type: "uuid"