Documentation
¶
Index ¶
Constants ¶
View Source
const ( ErrNotConnected = 1 ErrSockRead = 2 ErrSendClose = 3 ErrACK = 4 ErrParse = 5 )
View Source
const NULL_BLOCK_NUMBER uint32 = 0xffffffff
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ShipClient ¶
type ShipClient struct {
// Block to start receiving notifications on.
StartBlock uint32
// Block to end receiving notifications on.
EndBlock uint32
// if only irreversible blocks should be sent.
IrreversibleOnly bool
// Max number of non-ACKed messages that may be sent.
MaxMessagesInFlight uint32
// Callback functions
BlockHandler func(*ship.GetBlocksResultV0)
TraceHandler func([]*ship.TransactionTraceV0)
StatusHandler func(*ship.GetStatusResultV0)
CloseHandler func()
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(startBlock uint32, endBlock uint32, irreversibleOnly bool) *ShipClient
func (*ShipClient) Close ¶
func (this *ShipClient) Close() *ShipClientError
func (*ShipClient) Connect ¶
func (this *ShipClient) Connect(host string) error
func (*ShipClient) IsOpen ¶
func (this *ShipClient) IsOpen() bool
func (*ShipClient) Read ¶
func (this *ShipClient) Read() *ShipClientError
func (*ShipClient) SendBlocksRequest ¶
func (this *ShipClient) SendBlocksRequest() error
func (*ShipClient) SendCloseMessage ¶
func (this *ShipClient) SendCloseMessage() *ShipClientError
type ShipClientError ¶
func (*ShipClientError) Error ¶
func (e *ShipClientError) Error() string
Click to show internal directories.
Click to hide internal directories.