func getAPIClient(address string) (pps.APIClient, error) { clientConn, err := grpc.Dial(address, grpc.WithInsecure()) if err != nil { return nil, err } return pps.NewAPIClient(clientConn), nil }
func getPpsClient(t *testing.T) pps.APIClient { ppsdAddr := os.Getenv("PPSD_PORT_651_TCP_ADDR") if ppsdAddr == "" { t.Error("PPSD_PORT_651_TCP_ADDR not set") } clientConn, err := grpc.Dial(fmt.Sprintf("%s:651", ppsdAddr), grpc.WithInsecure()) require.NoError(t, err) return pps.NewAPIClient(clientConn) }
func NewAPIClient(cc *grpc.ClientConn) *APIClient { return &APIClient{ pfs.NewAPIClient(cc), pps.NewAPIClient(cc), } }