binarydist

package module
v0.0.0-...-20248b8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2014 License: MIT Imports: 8 Imported by: 1

README

binarydist

Package binarydist implements binary diff and patch as described on http://www.daemonology.net/bsdiff/. It reads and writes files compatible with the tools there.

This project is forked from https://github.com/kr/binarydist The reason why we have to fork this proeject is that, in kr/binarydist, the authors had to fork a process to do the bzip compression, because the native golang lib only have uncompressor, not compressor. Doing such fork is ok in general usage. However, in a such heavy loaded system, forking a process on the fly will worse hardware resources, which reduces the overall throughput. Instead of doing that, we decided to use cgo to wrap bzip compressor which could be used to replace the forked one, the performance should be better.

If you have any bugs, please mail to yhh92u@gmail.com

Documentation

Overview

Package binarydist implements binary diff and patch as described on http://www.daemonology.net/bsdiff/. It reads and writes files compatible with the tools there.

Index

Constants

This section is empty.

Variables

View Source
var ErrCorrupt = errors.New("corrupt patch")

Functions

func Diff

func Diff(old, new io.Reader, patch io.Writer) error

Diff computes the difference between old and new, according to the bsdiff algorithm, and writes the result to patch.

func Patch

func Patch(old io.Reader, new io.Writer, patch io.Reader) error

Patch applies patch to old, according to the bspatch algorithm, and writes the result to new.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL