hscloud/devtools/depotview/main.go
Sergiusz Bazanski 4c0e9b52c0 devtools/depotview: init
This is a small service for accessing git repos read-only over gRPC.

It's going to be used to allow hackdoc to render arbitrary versions of
hscloud.

Change-Id: Ib3c5eb5a8bc679e8062142e6fa30505d9550e2fa
2020-04-08 22:42:33 +02:00

34 lines
654 B
Go

package main
import (
"flag"
"code.hackerspace.pl/hscloud/go/mirko"
"github.com/golang/glog"
pb "code.hackerspace.pl/hscloud/devtools/depotview/proto"
"code.hackerspace.pl/hscloud/devtools/depotview/service"
)
var (
flagRemote = "https://gerrit.hackerspace.pl/hscloud"
)
func main() {
flag.StringVar(&flagRemote, "git_remote", flagRemote, "Address of Git repository to serve")
flag.Parse()
m := mirko.New()
if err := m.Listen(); err != nil {
glog.Exitf("Listen(): %v", err)
}
s := service.New(flagRemote)
pb.RegisterDepotViewServer(m.GRPC(), s)
if err := m.Serve(); err != nil {
glog.Exitf("Serve(): %v", err)
}
<-m.Done()
}