-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
30 lines (26 loc) · 857 Bytes
/
main.go
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
package main
import (
"flag"
"github.com/lim-yoona/ymdb/config"
"github.com/lim-yoona/ymdb/interact/server"
"github.com/lim-yoona/ymdb/options"
"github.com/lim-yoona/ymdb/raft"
"github.com/lim-yoona/ymdb/route"
"github.com/rs/zerolog"
)
var (
storeFilePath = flag.String("store_file_path", "/root/ymdb/walDir/store", "Specify files for ymdb to store")
restoreFilePath = flag.String("restore_file_path", "/root/ymdb/walDir/restore", "Specify files for ymdb to restore")
)
// 服务端,之后可能会进行封装
func main() {
flag.Parse()
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
config.GetConfig()
config.DefaultConfig.Wal.Store.Path = *storeFilePath
config.DefaultConfig.Wal.Restore.Path = *restoreFilePath
options.DefaultOption()
dbServer := server.NewServer()
go route.RouterStart(dbServer)
raft.RaftServer(dbServer)
}