neoneo-go/pkg/pubsub/event.go

21 lines
599 B
Go
Raw Normal View History

2019-02-25 22:44:14 +00:00
package pubsub
// EventType is an enum
// representing the types of messages we can subscribe to
2019-02-25 22:44:14 +00:00
type EventType int
const (
// NewBlock is called When blockchain connects a new block, it will emit an NewBlock Event
NewBlock EventType = iota
// BadBlock is called When blockchain declines a block, it will emit a new block event
BadBlock
// BadHeader is called When blockchain rejects a Header, it will emit this event
BadHeader
2019-02-25 22:44:14 +00:00
)
// Event represents a new Event that a subscriber can listen to
2019-02-25 22:44:14 +00:00
type Event struct {
Type EventType // E.g. event.NewBlock
data []byte // Raw information
}