-
Notifications
You must be signed in to change notification settings - Fork 57
/
main.go
35 lines (28 loc) · 796 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
package main
import (
"context"
"flag"
"github.com/klintcheng/kim/logger"
"github.com/klintcheng/kim/services/gateway"
"github.com/klintcheng/kim/services/router"
"github.com/klintcheng/kim/services/server"
"github.com/klintcheng/kim/services/service"
"github.com/spf13/cobra"
)
const version = "v1"
func main() {
flag.Parse()
root := &cobra.Command{
Use: "kim",
Version: version,
Short: "King IM Cloud",
}
ctx := context.Background()
root.AddCommand(gateway.NewServerStartCmd(ctx, version))
root.AddCommand(server.NewServerStartCmd(ctx, version))
root.AddCommand(service.NewServerStartCmd(ctx, version))
root.AddCommand(router.NewServerStartCmd(ctx, version))
if err := root.Execute(); err != nil {
logger.WithError(err).Fatal("Could not run command")
}
}