leaps: github.com/Jeffail/leaps/lib/audit Index | Files

package audit

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.

Index

Package Files

interface.go package.go to_json.go

type Auditor Uses

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 Uses

type CompressedAuditor struct {
    Transforms []text.OTransform
    // contains filtered or unexported fields
}

CompressedAuditor - Audit a documents transforms into a compressed structure for serialisation.

func (*CompressedAuditor) OnTransform Uses

func (d *CompressedAuditor) OnTransform(tform text.OTransform) error

OnTransform - Is called for every transform on a document as they arrive.

type ToJSON Uses

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": [...]

}

func NewToJSON Uses

func NewToJSON() *ToJSON

NewToJSON - Create a new auditor collection that serialises to JSON structure.

func (*ToJSON) Deserialise Uses

func (t *ToJSON) Deserialise(data []byte) error

Deserialise - Repopulate all audits based on a JSON serialised copy.

func (*ToJSON) Get Uses

func (t *ToJSON) Get(binderID string) (Auditor, error)

Get - Return an auditor for a document.

func (*ToJSON) Reapply Uses

func (t *ToJSON) Reapply(docStore store.Type) error

Reapply - Reapply the audited changes to a document store.

func (*ToJSON) Serialise Uses

func (t *ToJSON) Serialise() ([]byte, error)

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.