mirror of
https://github.com/hanzoai/s3-cli.git
synced 2026-10-30 18:23:12 +00:00
Vendor the CLI helpers into pkg/, use hanzos3/go, rename the module to hanzoai/s3-cli, and gate the names in cmd/names_test.go. Claude-Session: https://claude.ai/code/session_011i2AG9nwpiKUCVxAdDzYuU
25 lines
670 B
Go
25 lines
670 B
Go
package selfupdate
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/hanzoai/s3-cli/pkg/selfupdate/internal/binarydist"
|
|
)
|
|
|
|
// Patcher defines an interface for applying binary patches to an old item to get an updated item.
|
|
type Patcher interface {
|
|
Patch(old io.Reader, new io.Writer, patch io.Reader) error
|
|
}
|
|
|
|
type patchFn func(io.Reader, io.Writer, io.Reader) error
|
|
|
|
func (fn patchFn) Patch(old io.Reader, new io.Writer, patch io.Reader) error {
|
|
return fn(old, new, patch)
|
|
}
|
|
|
|
// NewBSDifferPatcher returns a new Patcher that applies binary patches using
|
|
// the bsdiff algorithm. See http://www.daemonology.net/bsdiff/
|
|
func NewBSDiffPatcher() Patcher {
|
|
return patchFn(binarydist.Patch)
|
|
}
|