Hi,
when I use the go client to query and mutate , I have a question about the high availability, the code for example as below:
func NewGrapher(cfg *GrapherConfig) (*BTCGrapher, error) {
p := new(BTCGrapher)
p.cfg = cfg
conn, err := grpc.Dial(p.cfg.Address+":"+p.cfg.Port, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(4<<30),
grpc.MaxCallSendMsgSize(4<<30)), grpc.WithInsecure())
if err != nil {
log.Error("While trying to dial gRPC", err)
log.DetailError(err)
return nil, err
}
p.grapherClientConn = conn
ctx := context.Background()
mu := &api.Mutation{
CommitNow: true,
DeleteJson: pb,
}
_, err = dgo.NewDgraphClient(api.NewDgraphClient(p.grapherClientConn)).NewTxn().Mutate(ctx, mu)
if err != nil {
log.DetailError(err)
}
return p, nil
}
I have three alpha nodes and I have a domain like “test.dgraph.xx.com” point to the three alpha port 9080, I do not clear how can I write codes to relize the high availability like the method GET or POST in HTTP.
Thank You Very Much!