client.go 470 B

123456789101112131415161718192021222324
  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. "cp-system-management/pb"
  6. "log"
  7. "google.golang.org/grpc"
  8. )
  9. var client pb.SystemClient
  10. const ServerAddr = "127.0.0.1:10003"
  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.NewSystemClient(conn)
  18. }