1234567891011121314151617181920212223242526272829 |
- package main
- import (
- "cfTest/curlServer"
- pb "cfTest/curlServer/pb"
- "google.golang.org/grpc"
- "net"
- )
- const (
- curlPort = ":50053"
- )
- func main() {
- curlServer.InitLogger()
- logger := curlServer.GetLogger()
- lis, err := net.Listen("tcp", curlPort)
- if err != nil {
- logger.Error("failed to listen: ", err)
- }
- s := grpc.NewServer()
- pb.RegisterCurlWithResolveServer(s, &curlServer.CurlServer{})
- logger.Println("server listening at ", lis.Addr())
- if err := s.Serve(lis); err != nil {
- logger.Error("failed to serve: ", err)
- }
- }
|