Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BsdiffEngine ¶
type BsdiffEngine struct{}
BsdiffEngine implements the DiffEngine interface using bsdiff
func NewBsdiffEngine ¶
func NewBsdiffEngine() *BsdiffEngine
NewBsdiffEngine creates a new bsdiff-based diff engine
func (*BsdiffEngine) ApplyPatch ¶
func (e *BsdiffEngine) ApplyPatch(baseData, patchData []byte) ([]byte, error)
ApplyPatch applies a bsdiff patch to base data
func (*BsdiffEngine) ComputeDiff ¶
func (e *BsdiffEngine) ComputeDiff(oldData, newData []byte) ([]byte, error)
ComputeDiff computes a binary diff using bsdiff
func (*BsdiffEngine) Name ¶
func (e *BsdiffEngine) Name() string
Name returns the name of the engine
type DiffEngine ¶
type DiffEngine interface {
// ComputeDiff computes the binary diff between old and new data
ComputeDiff(oldData, newData []byte) ([]byte, error)
// ApplyPatch applies a diff patch to base data to produce new data
ApplyPatch(baseData, patchData []byte) ([]byte, error)
// Name returns the name of the diff engine
Name() string
}
DiffEngine defines the interface for binary diff operations
func NewDiffEngine ¶
func NewDiffEngine(library string) (DiffEngine, error)
NewDiffEngine creates a new diff engine based on the specified library
type Stats ¶
type Stats struct {
OldSize int // Size of old data
NewSize int // Size of new data
PatchSize int // Size of patch data
CompressionRate float64 // Patch size / new size (lower is better)
}
Stats holds statistics about a diff operation
func ComputeStats ¶
ComputeStats calculates statistics for a diff operation
Click to show internal directories.
Click to hide internal directories.