Sergiusz Bazanski | 4c0e9b5 | 2020-04-08 22:42:33 +0200 | [diff] [blame] | 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "flag" |
| 5 | |
| 6 | "code.hackerspace.pl/hscloud/go/mirko" |
| 7 | "github.com/golang/glog" |
| 8 | |
| 9 | pb "code.hackerspace.pl/hscloud/devtools/depotview/proto" |
| 10 | "code.hackerspace.pl/hscloud/devtools/depotview/service" |
| 11 | ) |
| 12 | |
| 13 | var ( |
| 14 | flagRemote = "https://gerrit.hackerspace.pl/hscloud" |
| 15 | ) |
| 16 | |
| 17 | func main() { |
| 18 | flag.StringVar(&flagRemote, "git_remote", flagRemote, "Address of Git repository to serve") |
| 19 | flag.Parse() |
| 20 | |
| 21 | m := mirko.New() |
| 22 | if err := m.Listen(); err != nil { |
| 23 | glog.Exitf("Listen(): %v", err) |
| 24 | } |
| 25 | |
| 26 | s := service.New(flagRemote) |
| 27 | pb.RegisterDepotViewServer(m.GRPC(), s) |
| 28 | |
| 29 | if err := m.Serve(); err != nil { |
| 30 | glog.Exitf("Serve(): %v", err) |
| 31 | } |
| 32 | |
| 33 | <-m.Done() |
| 34 | } |