Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler func(string, *events_pb2.Event) bool
Handler is a sawtooth subscriber handler. Return true if need to pass next handler, or return false.
type Subscriber ¶
type Subscriber struct { RecordBlockID bool // flag to record last block id into file. OnClose func() OnSubcribed func(string, *client_event_pb2.ClientEventsSubscribeResponse) OnUnsubscribed func(string, *client_event_pb2.ClientEventsUnsubscribeResponse) // contains filtered or unexported fields }
Subscriber is a sawtooth event subscriber.
func New ¶
func New(endpoint string, wait time.Duration) (*Subscriber, error)
New returns a subcriber for some sawtooth events.
func (*Subscriber) HandleFunc ¶
func (s *Subscriber) HandleFunc(eventType string, h Handler)
HandleFunc appends an handler for some event.
func (*Subscriber) Subscribe ¶
func (s *Subscriber) Subscribe(eventType string, h Handler, filters ...*events_pb2.EventFilter)
Subscribe records an event subscription with filters and handler for it.
func (*Subscriber) WaitForShutdown ¶
func (s *Subscriber) WaitForShutdown(lastBlockIDs ...string)
WaitForShutdown is to start a subscriber and wait for shutdown.
Click to show internal directories.
Click to hide internal directories.