Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DebugCheckpoint is a switch used to debug if: // - The context passed to checkpoint is generated by checkpoint.NewContext // - multilple context acquire applied to the same context belone to the sampe goroutine DebugCheckpoint = os.Getenv("DEBUG_CHECKPOINT") == "1" )
Functions ¶
func HasCheckPoint ¶
func HasCheckPoint() bool
HasCheckPoint returns if SetCheckPoint has been called
func NewContext ¶
NewContext wraps given context with value needed by checkpoint
func SetCheckPoint ¶
SetCheckPoint set global checkpoint for replay
Types ¶
type CheckField ¶
type CheckField struct {
// contains filtered or unexported fields
}
CheckField is a field that should be checked
func Field ¶
func Field(name string, eq func(interface{}, interface{}) bool) CheckField
Field returns new CheckField
type CheckPoint ¶
type CheckPoint struct {
// contains filtered or unexported fields
}
CheckPoint provides the ability to recover from a failed command at the failpoint
func NewCheckPoint ¶
func NewCheckPoint(r io.Reader) (*CheckPoint, error)
NewCheckPoint returns a CheckPoint by given audit file
type FieldSet ¶
FieldSet is an ordered set stores fields and comparators, it's []CheckField
func Register ¶
func Register(fields ...CheckField) FieldSet
Register register FieldSet to global for latter comparing If there are two fields with the same name, the first one will be used
func (*FieldSet) Slice ¶
func (fs *FieldSet) Slice() []CheckField
Slice returns CheckField slice for iteration
Click to show internal directories.
Click to hide internal directories.