abcicli

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OK  = types.CodeType_OK
	LOG = ""
)

Variables

This section is empty.

Functions

func NewGRPCClient

func NewGRPCClient(addr string, mustConnect bool) *grpcClient

func NewLocalClient

func NewLocalClient(mtx *sync.Mutex, app types.Application) *localClient

func NewSocketClient

func NewSocketClient(addr string, mustConnect bool) *socketClient

Types

type Callback

type Callback func(*types.Request, *types.Response)

type Client

type Client interface {
	cmn.Service

	SetResponseCallback(Callback)
	Error() error

	FlushAsync() *ReqRes
	EchoAsync(msg string) *ReqRes
	InfoAsync(types.RequestInfo) *ReqRes
	SetOptionAsync(key string, value string) *ReqRes
	DeliverTxAsync(tx []byte) *ReqRes
	CheckTxAsync(tx []byte) *ReqRes
	QueryAsync(types.RequestQuery) *ReqRes
	CommitAsync() *ReqRes

	FlushSync() error
	EchoSync(msg string) (res types.Result)
	InfoSync(types.RequestInfo) (resInfo types.ResponseInfo, err error)
	SetOptionSync(key string, value string) (res types.Result)
	DeliverTxSync(tx []byte) (res types.Result)
	CheckTxSync(tx []byte) (res types.Result)
	QuerySync(types.RequestQuery) (resQuery types.ResponseQuery, err error)
	CommitSync() (res types.Result)

	InitChainAsync(types.RequestInitChain) *ReqRes
	BeginBlockAsync(types.RequestBeginBlock) *ReqRes
	EndBlockAsync(height uint64) *ReqRes

	InitChainSync(types.RequestInitChain) (err error)
	BeginBlockSync(types.RequestBeginBlock) (err error)
	EndBlockSync(height uint64) (resEndBlock types.ResponseEndBlock, err error)
}

func NewClient

func NewClient(addr, transport string, mustConnect bool) (client Client, err error)

NewClient returns a new ABCI client of the specified transport type. It returns an error if the transport is not "socket" or "grpc"

type ReqRes

type ReqRes struct {
	*types.Request
	*sync.WaitGroup
	*types.Response // Not set atomically, so be sure to use WaitGroup.
	// contains filtered or unexported fields
}

func NewReqRes

func NewReqRes(req *types.Request) *ReqRes

func (*ReqRes) GetCallback

func (reqRes *ReqRes) GetCallback() func(*types.Response)

func (*ReqRes) SetCallback

func (reqRes *ReqRes) SetCallback(cb func(res *types.Response))

Sets the callback for this ReqRes atomically. If reqRes is already done, calls cb immediately. NOTE: reqRes.cb should not change if reqRes.done. NOTE: only one callback is supported.

func (*ReqRes) SetDone

func (reqRes *ReqRes) SetDone()

NOTE: it should be safe to read reqRes.cb without locks after this.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL