Added counter test written in Golang

This commit is contained in:
Jae Kwon
2016-02-14 14:59:53 -08:00
parent 88fcacac7a
commit 90e38f08f4
14 changed files with 154 additions and 167 deletions

View File

@ -217,6 +217,11 @@ func (cli *TMSPClient) QueryAsync(query []byte) *ReqRes {
//----------------------------------------
func (cli *TMSPClient) FlushSync() error {
cli.queueRequest(types.RequestFlush()).Wait()
return cli.err
}
func (cli *TMSPClient) InfoSync() (info string, err error) {
reqres := cli.queueRequest(types.RequestInfo())
cli.FlushSync()
@ -226,9 +231,13 @@ func (cli *TMSPClient) InfoSync() (info string, err error) {
return string(reqres.Response.Data), nil
}
func (cli *TMSPClient) FlushSync() error {
cli.queueRequest(types.RequestFlush()).Wait()
return cli.err
func (cli *TMSPClient) SetOptionSync(key string, value string) (log string, err error) {
reqres := cli.queueRequest(types.RequestSetOption(key, value))
cli.FlushSync()
if cli.err != nil {
return "", cli.err
}
return reqres.Response.Log, nil
}
func (cli *TMSPClient) AppendTxSync(tx []byte) (code types.CodeType, result []byte, log string, err error) {