import "github.com/Jeffail/leaps/lib/audit"
Package audit - Implementations of operational transform auditors responsible for taking a stream of operational transform and creating useful features from that stream.
interface.go package.go to_json.go
type Auditor interface { // OnTransform - Is called by binder threads synchronously for each received // transform. Therefore, the implementation must be thread safe and avoid // blocking. An implementation may wish to perform validation on the // transform, in the case of a 'fail' an error should be returned, which // will prevent the transform from being applied. OnTransform(tform text.OTransform) error }
Auditor - A type that receives all transforms from a running binder as they arrive. The purpose of this type is to expose the flowing data to other components.
type CompressedAuditor struct { Transforms []text.OTransform // contains filtered or unexported fields }
CompressedAuditor - Audit a documents transforms into a compressed structure for serialisation.
func (d *CompressedAuditor) OnTransform(tform text.OTransform) error
OnTransform - Is called for every transform on a document as they arrive.
type ToJSON struct {
// contains filtered or unexported fields
}
ToJSON - An auditor collection that takes streams of operational transforms and can serialise them to JSON format: {
"document_1": [...], "document_2": [...]
}
NewToJSON - Create a new auditor collection that serialises to JSON structure.
Deserialise - Repopulate all audits based on a JSON serialised copy.
Get - Return an auditor for a document.
Reapply - Reapply the audited changes to a document store.
Serialise - Return a JSON serialised copy of all audits.
Package audit imports 5 packages (graph) and is imported by 2 packages. Updated 2018-02-20. Refresh now. Tools for package owners.