func gRPCVtworkerClientFactory(addr string, dialTimeout time.Duration) (vtworkerclient.VtworkerClient, error) { // create the RPC client cc, err := grpc.Dial(addr) if err != nil { return nil, err } c := pbs.NewVtworkerClient(cc) return &gRPCVtworkerClient{ cc: cc, c: c, }, nil }
func gRPCVtworkerClientFactory(addr string, dialTimeout time.Duration) (vtworkerclient.Client, error) { // create the RPC client cc, err := grpc.Dial(addr, grpc.WithInsecure()) if err != nil { return nil, err } c := vtworkerservicepb.NewVtworkerClient(cc) return &gRPCVtworkerClient{ cc: cc, c: c, }, nil }
func gRPCVtworkerClientFactory(addr string, dialTimeout time.Duration) (vtworkerclient.Client, error) { // create the RPC client opt, err := grpcutils.ClientSecureDialOption(*cert, *key, *ca, *name) if err != nil { return nil, err } cc, err := grpc.Dial(addr, opt, grpc.WithBlock(), grpc.WithTimeout(dialTimeout)) if err != nil { return nil, vterrors.NewVitessError(vtrpcpb.ErrorCode_DEADLINE_EXCEEDED, err, "grpc.Dial() err: %v", err) } c := vtworkerservicepb.NewVtworkerClient(cc) return &gRPCVtworkerClient{ cc: cc, c: c, }, nil }
func gRPCVtworkerClientFactory(addr string, dialTimeout time.Duration) (vtworkerclient.Client, error) { // create the RPC client opt, err := grpcutils.ClientSecureDialOption(*cert, *key, *ca, *name) if err != nil { return nil, err } cc, err := grpc.Dial(addr, opt, grpc.WithBlock(), grpc.WithTimeout(dialTimeout)) if err != nil { return nil, err } c := vtworkerservicepb.NewVtworkerClient(cc) return &gRPCVtworkerClient{ cc: cc, c: c, }, nil }