Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove json db #91

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 0 additions & 170 deletions cmd/convert/main.go

This file was deleted.

26 changes: 1 addition & 25 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"google.golang.org/grpc/credentials/insecure"

"github.com/quixsi/core/internal/db"
"github.com/quixsi/core/internal/db/jsondb"
"github.com/quixsi/core/internal/db/kvdb"
"github.com/quixsi/core/internal/server"
)
Expand All @@ -31,7 +30,7 @@ func main() {
var (
serviceName = flag.String("service-name", "party-invite", "otel service name")
addr = flag.String("addr", "0.0.0.0:8080", "default server address")
dbStr = flag.String("db", "json://testdata", "database connection string")
dbStr = flag.String("db", "kvdb://testdata/test.db", "database connection string")
otlpAddr = flag.String("otlp-grpc", "", "default otlp/gRPC address, by default disabled. Example value: localhost:4317")
logLevelArg = flag.String("log-level", "INFO", "log level")
staticDir = flag.String("static-dir", "", "path to static directory")
Expand Down Expand Up @@ -100,29 +99,6 @@ func main() {
}

switch u.Scheme {
case "json":
base := u.Host + u.Path
logger.Info("jsondb storage folder", "path", base)
guestsStore, err = jsondb.NewGuestStore(base + "/guests.json")
if err != nil {
logger.Error("could not initialize guest store", "error", err)
os.Exit(1)
}
translationStore, err = jsondb.NewTranslationStore(base + "/translations.json")
if err != nil {
logger.Error("could not initialize translation store", "error", err)
os.Exit(1)
}
invitationStore, err = jsondb.NewInvitationStore(base + "/invitations.json")
if err != nil {
logger.Error("could not initialize invitation store", "error", err)
os.Exit(1)
}
eventStore, err = jsondb.NewEventStore(base + "/event.json")
if err != nil {
logger.Error("could not initialize event store", "error", err)
os.Exit(1)
}
case "kvdb":
path := u.Host + u.Path
db, err := bolt.Open(path, 0600, nil)
Expand Down
124 changes: 0 additions & 124 deletions internal/db/jsondb/event_store.go

This file was deleted.

Loading