feat: 🎉 Rating Orama!

This commit is contained in:
2023-04-09 06:45:27 +02:00
commit b2f4b573f3
61 changed files with 8130 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
package app
import (
"golang.org/x/exp/slog"
"os"
)
type Application struct {
*slog.Logger
Environment
}
type Environment struct {
Datasource string
HarvesterApi string
}
func NewApp(isProduction bool) *Application {
if isProduction {
return &Application{
newStructuredLogger(),
Environment{
Datasource: os.Getenv("DATASOURCE"),
HarvesterApi: os.Getenv("HARVESTER_API"),
},
}
} else {
return &Application{
newStructuredLogger(),
Environment{
Datasource: "postgres://postgres:postgres@localhost:5432/postgres",
HarvesterApi: "http://localhost:5000/tv-show/%s",
},
}
}
}