-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
50 lines (40 loc) · 968 Bytes
/
main.go
File metadata and controls
50 lines (40 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package main
import (
_ "embed"
"os"
_ "github.com/jackc/pgx/v5"
_ "github.com/jackc/pgx/v5/stdlib"
"github.com/qbart/ferrodb/ferro"
"github.com/qbart/ferrodb/ferro/config"
"github.com/qbart/ferrodb/ferro/run"
"github.com/qbart/ferrodb/fmtx"
)
var (
//go:embed res/ferrodbicon.svg
favicon []byte
//go:embed res/ferrodb.svg
logo []byte
//go:embed tpls/embed/migration.fyml.tpl
tplMigration []byte
//go:embed tpls/embed/set.fyml.tpl
tplSet []byte
//go:embed tpls/embed/driver.fyml.tpl
tplDriver []byte
)
func main() {
logger := fmtx.Default()
dir, err := config.Dir()
if err != nil {
logger.WriteError("can't read config dir: %w", err)
os.Exit(1)
}
app := ferro.App{
Logger: logger,
Dir: dir,
Clock: &run.CurrentTime{},
EmbededMigrationTemplate: tplMigration,
EmbededDriverTemplate: tplDriver,
EmbededSetTemplate: tplSet,
}
os.Exit(app.Run(os.Args))
}