Documentation ¶
Index ¶
- func AnnounceDummyBatch(sn t.SeqNr, batch *requestpb.Batch) *eventpb.Event
- func AppSnapshot(sn t.SeqNr, data []byte) *eventpb.Event
- func AppSnapshotRequest(sn t.SeqNr) *eventpb.Event
- func ClientRequest(clientID t.ClientID, reqNo t.ReqNo, data []byte, authenticator []byte) *eventpb.Event
- func Deliver(sn t.SeqNr, batch *requestpb.Batch) *eventpb.Event
- func HashRequest(data [][]byte, origin *eventpb.HashOrigin) *eventpb.Event
- func HashResult(digest []byte, origin *eventpb.HashOrigin) *eventpb.Event
- func Init() *eventpb.Event
- func MessageReceived(from t.NodeID, message *messagepb.Message) *eventpb.Event
- func PersistDummyBatch(sn t.SeqNr, batch *requestpb.Batch) *eventpb.Event
- func RequestReady(requestRef *requestpb.RequestRef) *eventpb.Event
- func RequestSigVerified(reqRef *requestpb.RequestRef, valid bool, error string) *eventpb.Event
- func SendMessage(message *messagepb.Message, destinations []t.NodeID) *eventpb.Event
- func StoreDummyRequest(reqRef *requestpb.RequestRef, data []byte) *eventpb.Event
- func StoreVerifiedRequest(reqRef *requestpb.RequestRef, data []byte, authenticator []byte) *eventpb.Event
- func Tick() *eventpb.Event
- func VerifyRequestSig(reqRef *requestpb.RequestRef, signature []byte) *eventpb.Event
- func WALAppend(event *eventpb.Event, retentionIndex t.WALRetIndex) *eventpb.Event
- func WALEntry(persistedEvent *eventpb.Event, retentionIndex t.WALRetIndex) *eventpb.Event
- type 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) Slice() []*eventpb.Event
- func (el *EventList) StripFollowUps() *EventList
- type EventListIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnounceDummyBatch ¶
func AppSnapshot ¶
AppSnapshot returns an event representing the application making a snapshot of its state. sn is the number of batches delivered to the application when taking the snapshot (i.e. the sequence number of the first unprocessed batch) and data is the serialized application state (the snapshot itself).
func AppSnapshotRequest ¶
AppSnapshotRequest returns an event representing the protocol module asking the application for a state snapshot. sn is the number of batches delivered to the application when taking the snapshot (i.e. the sequence number of the first unprocessed batch). The application itself need not be aware of sn, it is only by the protocol to be able to identify the response of the application in form of an AppSnapshot event.
func ClientRequest ¶
func ClientRequest(clientID t.ClientID, reqNo t.ReqNo, data []byte, authenticator []byte) *eventpb.Event
ClientRequest returns an event representing the reception of a request from a client.
func Deliver ¶
Deliver returns an event of delivering a request batch to the application in sequence number order.
func HashRequest ¶
func HashRequest(data [][]byte, origin *eventpb.HashOrigin) *eventpb.Event
HashRequest returns an event representing a request to the hashing module for computing the hash of data. the origin is an object used to maintain the context for the requesting module and will be included in the HashResult produced by the hashing module.
func HashResult ¶
func HashResult(digest []byte, origin *eventpb.HashOrigin) *eventpb.Event
HashResult returns an event representing the computation of a hash by the hashing module. It contains the computed digest and the HashOrigin, an object used to maintain the context for the requesting module, i.e., information about what to do with the contained digest.
func Init ¶
Init returns an event instructing a module to initialize. This event is the first to be applied to a module after applying all events from the WAL.
func MessageReceived ¶
MessageReceived returns an event representing the reception of a message from another node. The from parameter is the ID of the node the message was received from.
func RequestReady ¶
func RequestReady(requestRef *requestpb.RequestRef) *eventpb.Event
RequestReady returns an event signifying that a new request is ready to be inserted into the protocol state machine. This normally occurs when the request has been received, persisted, authenticated, and an authenticator is available.
func RequestSigVerified ¶
RequestSigVerified represents the result of a client signature verification by the Crypto module. It is routed to the client tracker that initially issued a VerifyRequestSig event.
func SendMessage ¶
SendMessage returns an event of sending the message message to destinations. destinations is a slice of replica IDs that will be translated to actual addresses later.
func StoreDummyRequest ¶
func StoreDummyRequest(reqRef *requestpb.RequestRef, data []byte) *eventpb.Event
func StoreVerifiedRequest ¶
func StoreVerifiedRequest(reqRef *requestpb.RequestRef, data []byte, authenticator []byte) *eventpb.Event
StoreVerifiedRequest returns an event representing an event the ClientTracker emits to request storing a request, including its payload and authenticator, in the request store.
func Tick ¶
Tick returns an event representing a tick - the event of one step of logical time having elapsed.
func VerifyRequestSig ¶
func VerifyRequestSig(reqRef *requestpb.RequestRef, signature []byte) *eventpb.Event
VerifyRequestSig returns an event of a client tracker requesting the verification of a client request signature. This event is routed to the Crypto module that issues a RequestSigVerified event in response.
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 Strip ¶
Strip removes the follow-up events from event (stored under event.Next) and sets event.Next to nil. The removed events are stored in a new EventList that Strip returns a pointer to.
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) 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 removes all follow-up Events from the Events in the list and returns them. Note that StripFollowUps modifies the events in the list by calling Strip on each event in the EventList. After StripFollowUps returns, all events in the list will have no follow-ups. StripFollowUps accumulates all those follow-up Events in a new EventList that it returns.
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.