silly grpc client

This commit is contained in:
Ethan Buchman
2016-05-18 18:30:38 -04:00
parent f84f11ffe7
commit 1ab3c74718
12 changed files with 544 additions and 202 deletions

View File

@ -1,8 +1,10 @@
package tmspcli
import (
"github.com/tendermint/tmsp/types"
"fmt"
"sync"
"github.com/tendermint/tmsp/types"
)
type Client interface {
@ -39,6 +41,21 @@ type Client interface {
//----------------------------------------
func NewClient(addr, transport string, mustConnect bool) (client Client, err error) {
switch transport {
case "socket":
client, err = NewSocketClient(addr, mustConnect)
case "grpc":
client, err = NewGRPCClient(addr, mustConnect)
default:
err = fmt.Errorf("Unknown tmsp transport %s", transport)
}
return
}
//----------------------------------------
type Callback func(*types.Request, *types.Response)
//----------------------------------------