in at/grpc/cmd/client/main.go [34:64]
func main() {
flag.Parse()
// to set up grpc env
// set up a connection to the server.
conn, err := grpc.Dial("localhost:50051",
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithUnaryInterceptor(grpc2.ClientTransactionInterceptor))
if err != nil {
log.Fatalf("did not connect: %v", err)
}
defer conn.Close()
businessClient := __.NewATServiceBusinessClient(conn)
client.InitPath("../../../../conf/seatago.yml")
tm.WithGlobalTx(
context.Background(),
&tm.GtxConfig{
Name: "XASampleLocalGlobalTx",
},
func(ctx context.Context) (re error) {
r1, re := businessClient.UpdateDataSuccess(ctx, &__.Params{A: "1", B: "2"})
if re != nil {
log.Fatalf("could not do TestXAServiceBusiness: %v", re)
return
}
log.Infof("TestXAServiceBusiness res: %s", r1)
return
})
<-make(chan struct{})
}