client.go 480 B

12345678910111213141516171819202122232425
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. package tests
  4. import (
  5. "log"
  6. "adm-vehicle-style/pb"
  7. "google.golang.org/grpc"
  8. )
  9. var client pb.VehicleStyleClient
  10. const ServerAddr = "127.0.0.1:50001"
  11. func init() {
  12. // Set up a connection to the server.
  13. conn, err := grpc.Dial(ServerAddr, grpc.WithInsecure())
  14. if err != nil {
  15. log.Fatalf("did not connect: %v", err)
  16. }
  17. client = pb.NewVehicleStyleClient(conn)
  18. }