odds-crawler-backend/cmd/main.go

25 lines
505 B
Go
Raw Permalink Normal View History

2019-05-01 14:29:12 +00:00
package main
2019-05-12 10:58:43 +00:00
import (
"log"
"net"
2019-05-01 14:29:12 +00:00
2019-05-12 10:58:43 +00:00
pkg_cdp "git.loafle.net/odds_crawler/odds-crawler-backend/pkg/v1/cdp"
api_cdp "git.loafle.net/odds_crawler/odds-crawler-proto/pkg/api/v1/cdp"
"google.golang.org/grpc"
)
2019-05-01 14:29:12 +00:00
2019-05-12 10:58:43 +00:00
func main() {
lis, err := net.Listen("tcp", ":50051")
if err != nil {
log.Fatalf("failed to listen: %v", err)
}
s := grpc.NewServer()
2019-05-11 04:22:31 +00:00
2019-05-12 10:58:43 +00:00
api_cdp.RegisterCDPServiceServer(s, pkg_cdp.NewCDPServiceServer())
2019-05-01 14:29:12 +00:00
2019-05-12 10:58:43 +00:00
if err := s.Serve(lis); err != nil {
log.Fatalf("failed to serve: %v", err)
}
2019-05-01 14:29:12 +00:00
}