apitypes

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchWriter

type BatchWriter struct {
	// contains filtered or unexported fields
}

BatchWriter for multiple web3 requests

func NewBatchWriter

func NewBatchWriter(singleWriter Web3ResponseWriter) *BatchWriter

NewBatchWriter returns a new BatchWriter

func (*BatchWriter) Flush

func (w *BatchWriter) Flush() error

Flush writes data in batch buffer

func (*BatchWriter) Write

func (w *BatchWriter) Write(in interface{}) error

Write adds data into batch buffer

type BlockWithReceipts added in v1.9.0

type BlockWithReceipts struct {
	Block    *block.Block
	Receipts []*action.Receipt
}

BlockWithReceipts includes block and its receipts

type Listener

type Listener interface {
	Start() error
	Stop() error
	ReceiveBlock(*block.Block) error
	AddResponder(Responder) (string, error)
	RemoveResponder(string) (bool, error)
}

Listener pass new block to all responders

type Responder

type Responder interface {
	Respond(string, *block.Block) error
	Exit()
}

Responder responds to new block

type Web3ResponseWriter

type Web3ResponseWriter interface {
	Write(interface{}) error
}

Web3ResponseWriter is writer for web3 request

func NewResponseWriter

func NewResponseWriter(handler func(interface{}) error) Web3ResponseWriter

NewResponseWriter returns a new responseWriter

Jump to

Keyboard shortcuts

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