archive

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: Unlicense Imports: 17 Imported by: 0

Documentation

Overview

Package archive implements a simple archive format for `codechain apply -f`.

Index

Constants

This section is empty.

Variables

View Source
var ErrCannotDecrypt = errors.New("archive: cannot decrypt")

ErrCannotDecrypt is returned if an encrypted archive cannot be decrypted.

View Source
var ErrUnknownFile = errors.New("archive: contains unknown file, not a codechain archive?")

ErrUnknownFile is returned if an archive contains an unknown file.

Functions

func Apply

func Apply(hashchainFile, patchDir string, r io.Reader, head *[32]byte) error

Apply the archive read from r to the given hashchainFile and patchDir. If the hashchainFile is already present it must be transformable by appending to the hashchain present in r, otherwise an error is returned. If head is not nil the hash chain read from r must contain the given head.

func ApplyEncryptedFile

func ApplyEncryptedFile(hashchainFile, patchDir, filename string, head, key *[32]byte) error

ApplyEncryptedFile applies the encrypted archive in filename to the given hashchainFile and patchDir. If the hashchainFile is already present it must be transformable by appending to the hashchain present in r, otherwise an error is returned. If head is not nil the hash chain read from filename must contain the given head.

func ApplyFile

func ApplyFile(hashchainFile, patchDir, filename string, head *[32]byte) error

ApplyFile applies the archive in filename to the given hashchainFile and patchDir. If the hashchainFile is already present it must be transformable by appending to the hashchain present in r, otherwise an error is returned. If head is not nil the hash chain read from filename must contain the given head.

func Create

func Create(w io.Writer, c *hashchain.HashChain, patchDir string) error

Create a new archive for the given hash chain and write it to w. patchDir must contain all the necessary patch files. The validity of the patch files is not verified!

func CreateDist

func CreateDist(c *hashchain.HashChain, filename string) error

CreateDist creates a distribution file with filename for hash chain c. Filename must not exist.

func CreateEncryptedDist

func CreateEncryptedDist(c *hashchain.HashChain, filename string, key *[32]byte) error

CreateEncryptedDist creates an encrypted distribution file with filename for hash chain c. Filename must not exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

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