-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.go
33 lines (28 loc) · 772 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
package main
import (
"context"
"flag"
"github.com/golang/glog"
gateway "github.com/minhoryang/KoNLPy-gRPC/konlpy_grpc_gateway/lib"
)
var (
endpoint = flag.String("endpoint", "localhost:9090", "endpoint of the gRPC service")
network = flag.String("network", "tcp", `one of "tcp" or "unix". Must be consistent to -endpoint`)
swaggerDir = flag.String("swagger_dir", "examples/proto/examplepb", "path to the directory which contains swagger definitions")
)
func main() {
flag.Parse()
defer glog.Flush()
ctx := context.Background()
opts := gateway.Options{
Addr: ":80",
GRPCServer: gateway.Endpoint{
Network: *network,
Addr: *endpoint,
},
SwaggerDir: *swaggerDir,
}
if err := gateway.Run(ctx, opts); err != nil {
glog.Fatal(err)
}
}