Documentation ¶
Index ¶
- func Init(destModule t.ModuleID) *eventpb.Event
- func Redirect(event *eventpbtypes.Event, destination t.ModuleID) *eventpbtypes.Event
- func TestingString(dest t.ModuleID, s string) *eventpb.Event
- func TestingUint(dest t.ModuleID, u uint64) *eventpb.Event
- type EventList
- func (el *EventList) Head(n int) *EventList
- func (el *EventList) Iterator() *EventListIterator
- func (el *EventList) Len() int
- func (el *EventList) PushBack(event *eventpb.Event) *EventList
- func (el *EventList) PushBackList(newEvents *EventList) *EventList
- func (el *EventList) PushBackSlice(events []*eventpb.Event) *EventList
- func (el *EventList) RemoveFront(n int) int
- func (el *EventList) Slice() []*eventpb.Event
- func (el *EventList) StripFollowUps() (*EventList, *EventList)
- type EventListIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
Init returns an event instructing a module to initialize. This event is the first to be applied to a module.
func Redirect ¶
func Redirect(event *eventpbtypes.Event, destination t.ModuleID) *eventpbtypes.Event
Types ¶
type EventList ¶
type EventList struct {
// contains filtered or unexported fields
}
EventList represents a list of Events, e.g. as produced by a module.
func EmptyList ¶
func EmptyList() *EventList
EmptyList returns an empty EventList. TODO: consider passing EventList by value here and everywhere else.
func Strip ¶
Strip returns a new identical (shallow copy of the) event, but with all follow-up events (stored under event.Next) removed. The removed events are stored in a new EventList that Strip returns a pointer to as the second return value.
func (*EventList) Head ¶
Head returns the first up to n events in the list as a new list. The original list is not modified.
func (*EventList) Iterator ¶
func (el *EventList) Iterator() *EventListIterator
Iterator returns a pointer to an EventListIterator object used to iterate over the events in this list, starting from the beginning of the list.
func (*EventList) PushBack ¶
PushBack appends an event to the end of the list. Returns the EventList itself, for the convenience of chaining multiple calls to PushBack.
func (*EventList) PushBackList ¶
PushBackList appends all events in newEvents to the end of the current EventList.
func (*EventList) PushBackSlice ¶
PushBackSlice appends all events in newEvents to the end of the current EventList.
func (*EventList) RemoveFront ¶
RemoveFront removes the first up to n events from the list. Returns the number of events actually removed.
func (*EventList) Slice ¶
Slice returns a slice representation of the current state of the list. The returned slice only contains pointers to the events in this list, no deep copying is performed. Any modifications performed on the events will affect the contents of both the EventList and the returned slice.
func (*EventList) StripFollowUps ¶
StripFollowUps collects all follow-up Events of the Events in the list. It returns two lists: 1. An EventList containing the same events as this list, but with all follow-up events removed. 2. An EventList containing only those follow-up events.
type EventListIterator ¶
type EventListIterator struct {
// contains filtered or unexported fields
}
EventListIterator is an object returned from EventList.Iterator used to iterate over the elements (Events) of an EventList using the iterator's Next method.
func (*EventListIterator) Next ¶
func (eli *EventListIterator) Next() *eventpb.Event
Next will return the next Event until the end of the associated EventList is encountered. Thereafter, it will return nil.