use request struct for Info

This commit is contained in:
Ethan Buchman
2017-09-22 11:10:39 -04:00
parent 3d1fd4cefa
commit 667c2543ea
15 changed files with 152 additions and 202 deletions

View File

@ -138,8 +138,8 @@ func (cli *grpcClient) FlushAsync() *ReqRes {
return cli.finishAsyncCall(req, &types.Response{&types.Response_Flush{res}})
}
func (cli *grpcClient) InfoAsync() *ReqRes {
req := types.ToRequestInfo()
func (cli *grpcClient) InfoAsync(params types.RequestInfo) *ReqRes {
req := types.ToRequestInfo(params)
res, err := cli.client.Info(context.Background(), req.GetInfo(), grpc.FailFast(true))
if err != nil {
cli.StopForError(err)
@ -174,8 +174,8 @@ func (cli *grpcClient) CheckTxAsync(tx []byte) *ReqRes {
return cli.finishAsyncCall(req, &types.Response{&types.Response_CheckTx{res}})
}
func (cli *grpcClient) QueryAsync(reqQuery types.RequestQuery) *ReqRes {
req := types.ToRequestQuery(reqQuery)
func (cli *grpcClient) QueryAsync(params types.RequestQuery) *ReqRes {
req := types.ToRequestQuery(params)
res, err := cli.client.Query(context.Background(), req.GetQuery(), grpc.FailFast(true))
if err != nil {
cli.StopForError(err)
@ -263,8 +263,8 @@ func (cli *grpcClient) FlushSync() error {
return nil
}
func (cli *grpcClient) InfoSync() (resInfo types.ResponseInfo, err error) {
reqres := cli.InfoAsync()
func (cli *grpcClient) InfoSync(req types.RequestInfo) (resInfo types.ResponseInfo, err error) {
reqres := cli.InfoAsync(req)
if err = cli.Error(); err != nil {
return resInfo, err
}