diff --git a/cmd/africastalking/main.go b/cmd/africastalking/main.go index 3e17d81..6c19aa3 100644 --- a/cmd/africastalking/main.go +++ b/cmd/africastalking/main.go @@ -98,9 +98,7 @@ func main() { cfg.EngineDebug = true } - resourceDir := scriptDir menuStorageService := storage.NewMenuStorageService(dbDir, resourceDir) - rs, err := menuStorageService.GetResource(ctx) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) @@ -113,7 +111,7 @@ func main() { os.Exit(1) } - userdataStore := menuStorageService.GetUserdataDb(ctx) + userdataStore, err := menuStorageService.GetUserdataDb(ctx) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) os.Exit(1) @@ -126,7 +124,7 @@ func main() { } lhs, err := handlers.NewLocalHandlerService(pfp, true, dbResource, cfg, rs) - lhs.WithDataStore(&userdataStore) + lhs.SetDataStore(&userdataStore) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) diff --git a/cmd/async/main.go b/cmd/async/main.go index 8d50e4a..fbcf9d8 100644 --- a/cmd/async/main.go +++ b/cmd/async/main.go @@ -71,7 +71,6 @@ func main() { cfg.EngineDebug = true } - resourceDir := scriptDir menuStorageService := storage.NewMenuStorageService(dbDir, resourceDir) rs, err := menuStorageService.GetResource(ctx) if err != nil { @@ -85,7 +84,7 @@ func main() { os.Exit(1) } - userdataStore := menuStorageService.GetUserdataDb(ctx) + userdataStore, err := menuStorageService.GetUserdataDb(ctx) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) os.Exit(1) @@ -98,7 +97,7 @@ func main() { } lhs, err := handlers.NewLocalHandlerService(pfp, true, dbResource, cfg, rs) - lhs.WithDataStore(&userdataStore) + lhs.SetDataStore(&userdataStore) hl, err := lhs.GetHandler() if err != nil { diff --git a/cmd/http/main.go b/cmd/http/main.go index a9e7d00..9c24a55 100644 --- a/cmd/http/main.go +++ b/cmd/http/main.go @@ -59,7 +59,6 @@ func main() { cfg.EngineDebug = true } - resourceDir := scriptDir menuStorageService := storage.NewMenuStorageService(dbDir, resourceDir) rs, err := menuStorageService.GetResource(ctx) if err != nil { @@ -73,7 +72,7 @@ func main() { os.Exit(1) } - userdataStore := menuStorageService.GetUserdataDb(ctx) + userdataStore, err := menuStorageService.GetUserdataDb(ctx) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) os.Exit(1) @@ -86,7 +85,7 @@ func main() { } lhs, err := handlers.NewLocalHandlerService(pfp, true, dbResource, cfg, rs) - lhs.WithDataStore(&userdataStore) + lhs.SetDataStore(&userdataStore) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) @@ -99,7 +98,7 @@ func main() { os.Exit(1) } - stateStore, err := menuStorageService.GetStateStore(dbDir, ctx) + stateStore, err := menuStorageService.GetStateStore(ctx) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) os.Exit(1) diff --git a/cmd/main.go b/cmd/main.go index 2a2f896..bd3d634 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -64,7 +64,7 @@ func main() { os.Exit(1) } - userdatastore := menuStorageService.GetUserdataDb(ctx) + userdatastore, err := menuStorageService.GetUserdataDb(ctx) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) os.Exit(1)