deltamesh

API reference

Everything exported by github.com/deltamesh/deltamesh as of v1.9.2.

Differ

func NewDiffer(c Codec, opts ...Option) *Differ
func (d *Differ) Diff(ctx context.Context, a, b io.Reader) (*Patch, error)
func (d *Differ) DiffTo(ctx context.Context, a, b io.Reader, w io.Writer) error

DiffTo never builds the patch in memory and is the right choice when the result is written straight to disk or to the network.

Applier

func NewApplier(c Codec, opts ...Option) *Applier
func (a *Applier) Apply(ctx context.Context, src io.Reader, p *Patch, dst io.Writer) error
func (a *Applier) Invert(p *Patch) (*Patch, error)

Codecs

ConstructorHandlesNotes
JSON()RFC 8259 documentsNumbers preserved as written
Proto(md)Protobuf messagesRequires a descriptor
Arrow(schema)Record batchesColumn-wise diffing
NDJSON()Line-delimited JSONEach line is a top-level entry

Error codes

SentinelMeaningRetryable
ErrTooDeepNesting exceeded WithMaxDepthNo
ErrMalformedInput is not valid for the codecNo
ErrPathMissingPatch references a path absent from the sourceNo
ErrVersionSkewPatch was produced by an incompatible major versionNo
ErrShortReadUnderlying reader ended mid-valueYes
All errors wrap the underlying cause, so errors.Is and errors.As work as expected.