2019-05-01 14:29:12 +00:00
|
|
|
package main
|
|
|
|
|
2019-05-11 04:22:31 +00:00
|
|
|
// import (
|
|
|
|
// "context"
|
|
|
|
// "log"
|
|
|
|
// "net"
|
2019-05-01 14:29:12 +00:00
|
|
|
|
2019-05-11 04:22:31 +00:00
|
|
|
// "git.loafle.net/chrome_devtools_protocol/protocol-go/page"
|
|
|
|
// cdp "git.loafle.net/odds_crawler/odds-crawler-proto/cdp"
|
|
|
|
// "google.golang.org/grpc"
|
|
|
|
// )
|
2019-05-01 14:29:12 +00:00
|
|
|
|
2019-05-11 04:22:31 +00:00
|
|
|
// // server is used to implement helloworld.GreeterServer.
|
|
|
|
// type server struct{}
|
2019-05-01 14:29:12 +00:00
|
|
|
|
2019-05-11 04:22:31 +00:00
|
|
|
// // SayHello implements helloworld.GreeterServer
|
|
|
|
// func (s *server) Navigate(ctx context.Context, req *cdp.NavigateRequest) (*cdp.NavigateReply, error) {
|
|
|
|
// log.Printf("Received: %v", req.Url)
|
|
|
|
|
|
|
|
// page.Navigate()
|
|
|
|
|
|
|
|
// return &cdp.NavigateReply{Message: "Hello " + in.Name}, nil
|
|
|
|
// }
|
2019-05-01 14:29:12 +00:00
|
|
|
|
|
|
|
func main() {
|
2019-05-11 04:22:31 +00:00
|
|
|
// lis, err := net.Listen("tcp", ":50051")
|
|
|
|
// if err != nil {
|
|
|
|
// log.Fatalf("failed to listen: %v", err)
|
|
|
|
// }
|
|
|
|
// s := grpc.NewServer()
|
|
|
|
// ocp.RegisterNetworkerServer(s, &server{})
|
|
|
|
// if err := s.Serve(lis); err != nil {
|
|
|
|
// log.Fatalf("failed to serve: %v", err)
|
|
|
|
// }
|
2019-05-01 14:29:12 +00:00
|
|
|
}
|