Documentation
¶
Overview ¶
Package vcdiff is a pure-Go, cgo-free, xdelta3-interoperable implementation of the VCDIFF (RFC 3284) delta format. It encodes a delta from a source ("dictionary") to a target and decodes it back, using the standard wire layout (default code table, separate sections, no secondary compression) so deltas interoperate with xdelta3 and other RFC 3284 tools.
delta := vcdiff.EncodeBytes(source, target) var out bytes.Buffer _, _ = vcdiff.Decode(source, bytes.NewReader(delta), &out) // out == target
For batch workloads, reuse an Encoder to amortize buffer allocation:
enc := vcdiff.NewEncoder()
for _, p := range pairs {
delta := enc.EncodeBytes(p.source, p.target)
// ...
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode applies a VCDIFF delta to source, writes the reconstructed target to out, and returns the number of target bytes written. The delta may use any standard RFC 3284 construct, so deltas produced by xdelta3 are accepted.
func Encode ¶
Encode writes a VCDIFF delta that reconstructs target from source to out. A nil or empty source produces a self-referential ("pure compression") delta.
func EncodeBytes ¶
EncodeBytes returns a VCDIFF delta that reconstructs target from source. A nil or empty source produces a self-referential ("pure compression") delta.
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
vcdiff
command
vcdiff is a pure-Go, open-vcdiff-interoperable implementation of the VCDIFF (RFC 3284) delta format:
|
vcdiff is a pure-Go, open-vcdiff-interoperable implementation of the VCDIFF (RFC 3284) delta format: |
|
internal
|
|
|
vcdiff
Package vcdiff implements a pure-Go, cgo-free VCDIFF (RFC 3284) delta encoder and decoder, aiming for on-the-wire compatibility with Google's open-vcdiff (the standard interchange format: version byte 0x00, the default instruction code table, and no secondary compression).
|
Package vcdiff implements a pure-Go, cgo-free VCDIFF (RFC 3284) delta encoder and decoder, aiming for on-the-wire compatibility with Google's open-vcdiff (the standard interchange format: version byte 0x00, the default instruction code table, and no secondary compression). |
