-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
43 lines (33 loc) · 1.24 KB
/
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
package main
import (
"fmt"
"github.com/samlotti/relKV/backup"
"github.com/samlotti/relKV/cmd"
"github.com/samlotti/relKV/commands"
"os"
)
const Version = "0.3.20"
const Banner = `
██████╗ ███████╗██╗ ██╗ ██╗██╗ ██╗
██╔══██╗██╔════╝██║ ██║ ██╔╝██║ ██║
██████╔╝█████╗ ██║ █████╔╝ ██║ ██║
██╔══██╗██╔══╝ ██║ ██╔═██╗ ╚██╗ ██╔╝
██║ ██║███████╗███████╗██║ ██╗ ╚████╔╝
╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝
./relKv help - for help`
func main() {
if len(os.Args) > 1 {
commands.ProcessCommands(os.Args[1:])
return
}
fmt.Println(Banner)
readyChannel := make(chan *cmd.BucketsDb)
go cmd.BootServer(Version, readyChannel)
bk := <-readyChannel
backup.ScpInit(cmd.BucketsInstance)
if !cmd.EnvironmentInstance.GetBoolEnv("NOBACKUP") {
backup.BackupsInit(cmd.BucketsInstance)
go backup.BackupsInstance.Run()
}
bk.WaitTillStopped()
}