Documentation ¶
Index ¶
- func ActionAllocateRequest(clientID, reqNo uint64) *state.Action
- func ActionCheckpoint(seqNo uint64, networkConfig *msgs.NetworkState_Config, ...) *state.Action
- func ActionCommit(qEntry *msgs.QEntry) *state.Action
- func ActionCorrectRequest(ack *msgs.RequestAck) *state.Action
- func ActionForwardRequest(targets []uint64, requestAck *msgs.RequestAck) *state.Action
- func ActionHash(data [][]byte, origin *state.HashOrigin) *state.Action
- func ActionPersist(index uint64, p *msgs.Persistent) *state.Action
- func ActionSend(targets []uint64, msg *msgs.Msg) *state.Action
- func ActionStateApplied(seqNo uint64, ns *msgs.NetworkState) *state.Action
- func ActionStateTransfer(seqNo uint64, value []byte) *state.Action
- func ActionTruncate(index uint64) *state.Action
- func EventActionsReceived() *state.Event
- func EventCheckpointResult(value []byte, pendingReconfigurations []*msgs.Reconfiguration, ...) *state.Event
- func EventCompleteInitialization() *state.Event
- func EventHashResult(digest []byte, origin *state.HashOrigin) *state.Event
- func EventInitialize(initialParms *state.EventInitialParameters) *state.Event
- func EventLoadPersistedEntry(index uint64, entry *msgs.Persistent) *state.Event
- func EventRequestPersisted(ack *msgs.RequestAck) *state.Event
- func EventStateTransferComplete(networkState *msgs.NetworkState, actionStateTransfer *state.ActionStateTarget) *state.Event
- func EventStateTransferFailed(actionStateTransfer *state.ActionStateTarget) *state.Event
- func EventStep(source uint64, msg *msgs.Msg) *state.Event
- func EventTickElapsed() *state.Event
- type ActionList
- func (al *ActionList) AllocateRequest(clientID, reqNo uint64) *ActionList
- func (al *ActionList) Checkpoint(seqNo uint64, networkConfig *msgs.NetworkState_Config, ...) *ActionList
- func (al *ActionList) Commit(qEntry *msgs.QEntry) *ActionList
- func (al *ActionList) CorrectRequest(ack *msgs.RequestAck) *ActionList
- func (al *ActionList) ForwardRequest(targets []uint64, requestAck *msgs.RequestAck) *ActionList
- func (al *ActionList) Hash(data [][]byte, origin *state.HashOrigin) *ActionList
- func (al *ActionList) Iterator() *ActionListIterator
- func (al *ActionList) Len() int
- func (al *ActionList) Persist(index uint64, p *msgs.Persistent) *ActionList
- func (al *ActionList) PushBack(action *state.Action)
- func (al *ActionList) PushBackList(actionList *ActionList)
- func (al *ActionList) Send(targets []uint64, msg *msgs.Msg) *ActionList
- func (al *ActionList) StateApplied(seqNo uint64, ns *msgs.NetworkState) *ActionList
- func (al *ActionList) StateTransfer(seqNo uint64, value []byte) *ActionList
- func (al *ActionList) Truncate(index uint64) *ActionList
- type ActionListIterator
- type EventList
- func (el *EventList) ActionsReceived() *EventList
- func (el *EventList) CheckpointResult(value []byte, pendingReconfigurations []*msgs.Reconfiguration, ...) *EventList
- func (el *EventList) CompleteInitialization() *EventList
- func (el *EventList) HashResult(digest []byte, origin *state.HashOrigin) *EventList
- func (el *EventList) Initialize(initialParms *state.EventInitialParameters) *EventList
- func (el *EventList) Iterator() *EventListIterator
- func (el *EventList) Len() int
- func (el *EventList) LoadPersistedEntry(index uint64, entry *msgs.Persistent) *EventList
- func (el *EventList) PushBack(action *state.Event)
- func (el *EventList) PushBackList(actionList *EventList)
- func (el *EventList) RequestPersisted(ack *msgs.RequestAck) *EventList
- func (el *EventList) StateTransferComplete(networkState *msgs.NetworkState, actionStateTransfer *state.ActionStateTarget) *EventList
- func (el *EventList) StateTransferFailed(actionStateTransfer *state.ActionStateTarget) *EventList
- func (el *EventList) Step(source uint64, msg *msgs.Msg) *EventList
- func (el *EventList) TickElapsed() *EventList
- type EventListIterator
- type LogLevel
- type Logger
- type StateMachine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActionAllocateRequest ¶
func ActionCheckpoint ¶
func ActionCheckpoint(seqNo uint64, networkConfig *msgs.NetworkState_Config, clientStates []*msgs.NetworkState_Client) *state.Action
func ActionCorrectRequest ¶
func ActionCorrectRequest(ack *msgs.RequestAck) *state.Action
func ActionForwardRequest ¶
func ActionForwardRequest(targets []uint64, requestAck *msgs.RequestAck) *state.Action
func ActionHash ¶
func ActionHash(data [][]byte, origin *state.HashOrigin) *state.Action
func ActionPersist ¶
func ActionPersist(index uint64, p *msgs.Persistent) *state.Action
func ActionStateApplied ¶
func ActionStateApplied(seqNo uint64, ns *msgs.NetworkState) *state.Action
func ActionTruncate ¶
func EventActionsReceived ¶
func EventCheckpointResult ¶
func EventCheckpointResult(value []byte, pendingReconfigurations []*msgs.Reconfiguration, actionCheckpoint *state.ActionCheckpoint) *state.Event
func EventHashResult ¶
func EventHashResult(digest []byte, origin *state.HashOrigin) *state.Event
func EventInitialize ¶
func EventInitialize(initialParms *state.EventInitialParameters) *state.Event
func EventLoadPersistedEntry ¶
func EventLoadPersistedEntry(index uint64, entry *msgs.Persistent) *state.Event
func EventRequestPersisted ¶
func EventRequestPersisted(ack *msgs.RequestAck) *state.Event
func EventStateTransferComplete ¶
func EventStateTransferComplete(networkState *msgs.NetworkState, actionStateTransfer *state.ActionStateTarget) *state.Event
func EventStateTransferFailed ¶
func EventStateTransferFailed(actionStateTransfer *state.ActionStateTarget) *state.Event
func EventTickElapsed ¶
Types ¶
type ActionList ¶
type ActionList struct {
// contains filtered or unexported fields
}
func (*ActionList) AllocateRequest ¶
func (al *ActionList) AllocateRequest(clientID, reqNo uint64) *ActionList
func (*ActionList) Checkpoint ¶
func (al *ActionList) Checkpoint(seqNo uint64, networkConfig *msgs.NetworkState_Config, clientStates []*msgs.NetworkState_Client) *ActionList
func (*ActionList) Commit ¶
func (al *ActionList) Commit(qEntry *msgs.QEntry) *ActionList
func (*ActionList) CorrectRequest ¶
func (al *ActionList) CorrectRequest(ack *msgs.RequestAck) *ActionList
func (*ActionList) ForwardRequest ¶
func (al *ActionList) ForwardRequest(targets []uint64, requestAck *msgs.RequestAck) *ActionList
func (*ActionList) Hash ¶
func (al *ActionList) Hash(data [][]byte, origin *state.HashOrigin) *ActionList
func (*ActionList) Iterator ¶
func (al *ActionList) Iterator() *ActionListIterator
func (*ActionList) Len ¶
func (al *ActionList) Len() int
func (*ActionList) Persist ¶
func (al *ActionList) Persist(index uint64, p *msgs.Persistent) *ActionList
func (*ActionList) PushBack ¶
func (al *ActionList) PushBack(action *state.Action)
func (*ActionList) PushBackList ¶
func (al *ActionList) PushBackList(actionList *ActionList)
func (*ActionList) Send ¶
func (al *ActionList) Send(targets []uint64, msg *msgs.Msg) *ActionList
func (*ActionList) StateApplied ¶
func (al *ActionList) StateApplied(seqNo uint64, ns *msgs.NetworkState) *ActionList
func (*ActionList) StateTransfer ¶
func (al *ActionList) StateTransfer(seqNo uint64, value []byte) *ActionList
func (*ActionList) Truncate ¶
func (al *ActionList) Truncate(index uint64) *ActionList
type ActionListIterator ¶
type ActionListIterator struct {
// contains filtered or unexported fields
}
func (*ActionListIterator) Next ¶
func (ali *ActionListIterator) Next() *state.Action
Next will return the next value until the end of the list is encountered. Thereafter, it will return nil.
type EventList ¶
type EventList struct {
// contains filtered or unexported fields
}
func (*EventList) ActionsReceived ¶
func (*EventList) CheckpointResult ¶
func (el *EventList) CheckpointResult(value []byte, pendingReconfigurations []*msgs.Reconfiguration, actionCheckpoint *state.ActionCheckpoint) *EventList
func (*EventList) CompleteInitialization ¶
func (*EventList) HashResult ¶
func (el *EventList) HashResult(digest []byte, origin *state.HashOrigin) *EventList
func (*EventList) Initialize ¶
func (el *EventList) Initialize(initialParms *state.EventInitialParameters) *EventList
func (*EventList) Iterator ¶
func (el *EventList) Iterator() *EventListIterator
func (*EventList) LoadPersistedEntry ¶
func (el *EventList) LoadPersistedEntry(index uint64, entry *msgs.Persistent) *EventList
func (*EventList) PushBackList ¶
func (*EventList) RequestPersisted ¶
func (el *EventList) RequestPersisted(ack *msgs.RequestAck) *EventList
func (*EventList) StateTransferComplete ¶
func (el *EventList) StateTransferComplete(networkState *msgs.NetworkState, actionStateTransfer *state.ActionStateTarget) *EventList
func (*EventList) StateTransferFailed ¶
func (el *EventList) StateTransferFailed(actionStateTransfer *state.ActionStateTarget) *EventList
func (*EventList) TickElapsed ¶
type EventListIterator ¶
type EventListIterator struct {
// contains filtered or unexported fields
}
func (*EventListIterator) Next ¶
func (ali *EventListIterator) Next() *state.Event
Next will return the next value until the end of the list is encountered. Thereafter, it will return nil.
type Logger ¶
type Logger interface { // Log is invoked with the log level, the log message, and key/value pairs // of any relevant log details. The keys are always strings, while the // values are unspecified. Log(level LogLevel, text string, args ...interface{}) }
Logger is minimal logging interface designed to be easily adaptable to any logging library.
var ( // ConsoleDebugLogger implements Logger and writes all log messages to stdout. ConsoleDebugLogger Logger = consoleLogger(LevelDebug) // ConsoleInfoLogger implements Logger and writes all LevelInfo and above log messages to stdout. ConsoleInfoLogger Logger = consoleLogger(LevelInfo) // ConsoleWarnLogger implements Logger and writes all LevelWarn and above log messages to stdout. ConsoleWarnLogger Logger = consoleLogger(LevelWarn) // ConsoleErrorLogger implements Logger and writes all LevelError log messages to stdout. ConsoleErrorLogger Logger = consoleLogger(LevelError) )
type StateMachine ¶
type StateMachine struct { Logger Logger // contains filtered or unexported fields }
StateMachine contains a deterministic processor for state events. This structure should almost never be initialized directly but should instead be allocated via StartNode.
func (*StateMachine) ApplyEvent ¶
func (sm *StateMachine) ApplyEvent(stateEvent *state.Event) *ActionList
Public wrapper for StateMachine.applyEvent()
func (*StateMachine) Status ¶
func (sm *StateMachine) Status() (s *status.StateMachine, err error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.