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
|
/*
Command example-grpc-server is an example grpc server
to be called by example-gateway-server.
*/
package main
import (
"context"
"flag"
"github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/server"
"google.golang.org/grpc/grpclog"
)
var (
addr = flag.String("addr", ":9090", "endpoint of the gRPC service")
network = flag.String("network", "tcp", "a valid network type which is consistent to -addr")
)
func main() {
flag.Parse()
ctx := context.Background()
if err := server.Run(ctx, *network, *addr); err != nil {
grpclog.Fatal(err)
}
}
|