-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmain.go
44 lines (40 loc) · 833 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package main
import (
"os"
"github.com/innovationb1ue/RedisGO/config"
"github.com/innovationb1ue/RedisGO/logger"
"github.com/innovationb1ue/RedisGO/memdb"
"github.com/innovationb1ue/RedisGO/server"
)
func init() {
// Register commands
memdb.RegisterKeyCommands()
memdb.RegisterStringCommands()
memdb.RegisterListCommands()
memdb.RegisterSetCommands()
memdb.RegisterHashCommands()
memdb.RegisterPubSubCommands()
memdb.RegisterSortedSetCommands()
memdb.RegisterStreamCommands()
memdb.RegisterRaftCommand()
}
func main() {
// setup config
cfg, err := config.Setup()
if err != nil {
logger.Error(err)
os.Exit(1)
}
// setup logger
err = logger.SetUp(cfg)
if err != nil {
logger.Error(err)
os.Exit(1)
}
// setup tcp server
err = server.Start(cfg)
if err != nil {
logger.Error(err)
os.Exit(1)
}
}