github.com/prysmaticlabs/prysm@v1.4.4/beacon-chain/core/feed/event.go (about) 1 // Package feed defines event feed types for inter-service communication 2 // during a beacon node's runtime. 3 package feed 4 5 // How to add a new event to the feed: 6 // 1. Add a file for the new type of feed. 7 // 2. Add a constant describing the list of events. 8 // 3. Add a structure with the name `<event>Data` containing any data fields that should be supplied with the event. 9 // 10 // Note that the same event is supplied to all subscribers, so the event received by subscribers should be considered read-only. 11 12 // EventType is the type that defines the type of event. 13 type EventType int 14 15 // Event is the event that is sent with operation feed updates. 16 type Event struct { 17 // Type is the type of event. 18 Type EventType 19 // Data is event-specific data. 20 Data interface{} 21 }