Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrongNumberOfParameters ¶
WrongNumberOfParameters returns an error about wrong number of smart contract parameters.
Types ¶
type BlockHandler ¶ added in v0.15.0
BlockHandler is a chain block processing function.
type Event ¶
type Event interface {
MorphEvent()
}
Event is an interface that is provided by Neo:Morph event structures.
type Handler ¶
type Handler func(Event)
Handler is an Event processing function.
func WorkerPoolHandler ¶ added in v0.19.0
WorkerPoolHandler sets closure over worker pool w with passed handler h.
type HandlerInfo ¶
type HandlerInfo struct {
// contains filtered or unexported fields
}
HandlerInfo is a structure that groups the parameters of the handler of particular contract event.
func (HandlerInfo) Handler ¶
func (s HandlerInfo) Handler() Handler
Handler returns an event handler.
func (*HandlerInfo) SetHandler ¶
func (s *HandlerInfo) SetHandler(v Handler)
SetHandler is an event handler setter.
type Listener ¶
type Listener interface { // Must start the event listener. // // Must listen to events with the parser installed. Listen(context.Context) // Must start the event listener. // // Must listen to events with the parser installed. // // Must send error to channel if subscriber channel has been closed or // it could not be started. ListenWithError(context.Context, chan<- error) // Must set the parser of particular contract event. // // Parser of each event must be set once. All parsers must be set before Listen call. // // Must ignore nil parsers and all calls after listener has been started. SetParser(ParserInfo) // Must register the event handler for particular notification event of contract. // // The specified handler must be called after each capture and parsing of the event // // Must ignore nil handlers. RegisterHandler(HandlerInfo) // Must stop the event listener. Stop() // Must register chain block handler. // // The specified handler must be called after each capture and parsing of the new block from chain. // // Must ignore nil handlers. RegisterBlockHandler(BlockHandler) }
Listener is an interface of smart contract notification event listener.
func NewListener ¶
func NewListener(p ListenerParams) (Listener, error)
NewListener create the notification event listener instance and returns Listener interface.
type ListenerParams ¶
type ListenerParams struct { Logger *zap.Logger Subscriber subscriber.Subscriber }
ListenerParams is a group of parameters for Listener constructor.
type ParserInfo ¶
type ParserInfo struct {
// contains filtered or unexported fields
}
ParserInfo is a structure that groups the parameters of particular contract notification event parser.
func (*ParserInfo) SetParser ¶
func (s *ParserInfo) SetParser(v Parser)
SetParser is an event parser setter.