Documentation ¶
Index ¶
- func CompleteOperations(ops []core.Operation, p RecordParser) ([]core.Operation, error)
- func ReadHistory(historyFile string, p RecordParser) ([]core.Operation, interface{}, error)
- type NoopParser
- type NoopRequest
- type NoopResponse
- type RecordParser
- type Recorder
- func (r *Recorder) Close()
- func (r *Recorder) RecordInvokeNemesis(nemesisRecord core.NemesisGeneratorRecord) error
- func (r *Recorder) RecordRecoverNemesis(op string) error
- func (r *Recorder) RecordRequest(proc int64, op interface{}) error
- func (r *Recorder) RecordResponse(proc int64, op interface{}) error
- func (r *Recorder) RecordState(state interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompleteOperations ¶
CompleteOperations completes the history of operation.
func ReadHistory ¶
func ReadHistory(historyFile string, p RecordParser) ([]core.Operation, interface{}, error)
ReadHistory reads operations and a model state from a history file.
Types ¶
type NoopParser ¶
type NoopParser struct {
State int
}
NoopParser is a noop parser.
func (NoopParser) OnNoopResponse ¶
func (p NoopParser) OnNoopResponse() interface{}
OnNoopResponse impls RecordParser.
func (NoopParser) OnRequest ¶
func (p NoopParser) OnRequest(data json.RawMessage) (interface{}, error)
OnRequest impls RecordParser.
func (NoopParser) OnResponse ¶
func (p NoopParser) OnResponse(data json.RawMessage) (interface{}, error)
OnResponse impls RecordParser.
func (NoopParser) OnState ¶
func (p NoopParser) OnState(state json.RawMessage) (interface{}, error)
OnState impls RecordParser.
type NoopRequest ¶
NoopRequest is a noop request.
type NoopResponse ¶
NoopResponse is a noop response.
func (NoopResponse) IsUnknown ¶
func (n NoopResponse) IsUnknown() bool
IsUnknown implements UnknownResponse interface
type RecordParser ¶
type RecordParser interface { // OnRequest parses an operation data to model's input. OnRequest(data json.RawMessage) (interface{}, error) // OnResponse parses an operation data to model's output. OnResponse(data json.RawMessage) (interface{}, error) // If we have some infinite operations, we should return a // noop response to complete the operation. OnNoopResponse() interface{} // OnState parses model state json data to model's state OnState(state json.RawMessage) (interface{}, error) }
RecordParser is to parses the operation data. It must be thread-safe.
type Recorder ¶
Recorder records operation history.
func NewRecorder ¶
NewRecorder creates a recorder to log the history to the file.
func (*Recorder) RecordInvokeNemesis ¶
func (r *Recorder) RecordInvokeNemesis(nemesisRecord core.NemesisGeneratorRecord) error
RecordInvokeNemesis records nemesis invocation events on history file
func (*Recorder) RecordRecoverNemesis ¶
RecordRecoverNemesis records nemesis recovery events on history file
func (*Recorder) RecordRequest ¶
RecordRequest records the request.
func (*Recorder) RecordResponse ¶
RecordResponse records the response.
func (*Recorder) RecordState ¶
RecordState records the request.