Documentation ¶
Overview ¶
Package patchclient implements all you need to easily do updates for your application.
Index ¶
- Variables
- func GetLocalBinaryName() string
- func GetUpdate(baseUpdateURL, version string) (io.ReadCloser, error)
- type PatchClient
- func (pc *PatchClient) ApplyUpdate(rc io.ReadCloser) error
- func (pc *PatchClient) ApplyUpdateWithPatch(patch io.Reader) error
- func (pc *PatchClient) ApplyVerifiedPatchUpdate(binary io.ReadCloser, hexChecksum, hexSignature string) error
- func (pc *PatchClient) ApplyVerifiedUpdate(binary io.ReadCloser, hexChecksum, hexSignature string) error
- func (pc *PatchClient) SignedVerifiedPatchUpdate() error
- func (pc *PatchClient) SignedVerifiedUpdate() error
- func (pc *PatchClient) UnsignedNotVerifiedPatchUpdate() error
- func (pc *PatchClient) UnsignedNotVerifiedUpdate() error
- type SignedUpdate
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetLocalBinaryName ¶
func GetLocalBinaryName() string
Types ¶
type PatchClient ¶
func NewInsecurePatchClient ¶
func NewInsecurePatchClient(url, version string) *PatchClient
NewInsecurePatchClient is not able to verify the signature of your update.
func NewPatchClient ¶
func NewPatchClient(url, version string, pubKey []byte) *PatchClient
NewPatchClient is able to verify updates.
func (*PatchClient) ApplyUpdate ¶
func (pc *PatchClient) ApplyUpdate(rc io.ReadCloser) error
ApplyUpdate is the simplest version of applying an update. It patches a full binary without checking a signature.
func (*PatchClient) ApplyUpdateWithPatch ¶
func (pc *PatchClient) ApplyUpdateWithPatch(patch io.Reader) error
ApplyUpdateWithPatch applies a not signed binary patch.
func (*PatchClient) ApplyVerifiedPatchUpdate ¶
func (pc *PatchClient) ApplyVerifiedPatchUpdate(binary io.ReadCloser, hexChecksum, hexSignature string) error
ApplyVerifiedPatchUpdate applies a signed binary patch and checks the checksum.
func (*PatchClient) ApplyVerifiedUpdate ¶
func (pc *PatchClient) ApplyVerifiedUpdate(binary io.ReadCloser, hexChecksum, hexSignature string) error
ApplyVerifiedUpdate applies a signed binary update and checks the checksum.
func (*PatchClient) SignedVerifiedPatchUpdate ¶
func (pc *PatchClient) SignedVerifiedPatchUpdate() error
func (*PatchClient) SignedVerifiedUpdate ¶
func (pc *PatchClient) SignedVerifiedUpdate() error
func (*PatchClient) UnsignedNotVerifiedPatchUpdate ¶
func (pc *PatchClient) UnsignedNotVerifiedPatchUpdate() error
func (*PatchClient) UnsignedNotVerifiedUpdate ¶
func (pc *PatchClient) UnsignedNotVerifiedUpdate() error
type SignedUpdate ¶
type SignedUpdate struct { // Patch contains the binary diff of current to next version Patch []byte `json:"patch"` // Signature contains the signature of the next version binary // to verify, if the resulting binary patch is correct. Signature []byte `json:"signature"` // Digest is the SHA256 of the Patch Digest []byte `json:"sha256"` }
SignedUpdate contains data required to validate and verify patch the applied patch. If the Digest is not correct, the Patch should not be applied, if the Signature can not be verified, the patch will return an error and you can rollback the patch.