Documentation ¶
Overview ¶
A means of conveying a series of edits to binary files. Each item in a patchset consists of an offset into the old file, the number of bytes to remove, and the octet string to replace it with.
Index ¶
Constants ¶
const (
MimeType = "application/x-binary-patch"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PatchHeader ¶
type PatchSet ¶
type PatchSet struct { Patches []PatchHeader Blobs [][]byte }
func (*PatchSet) Add ¶
Add a new patch region to a PatchSet. The bytes beginning at "offset" and running for "oldSize" are removed and replaced with "blob". oldSize may be 0.
func (*PatchSet) Apply ¶
Apply a PatchSet by taking the input file, transforming it, and writing the result to outpath. If outpath is the same name as infile then the file will be updated in-place if a direct overwrite is possible. If they are not the same file, or the patch requires moving parts of the old file, then the output will be written to a temporary file then renamed over the destination path.
type PatchSetHeader ¶
type PatchSetHeader struct {
Version, NumPatches uint32
}