Documentation ¶
Overview ¶
Package archive implements a simple archive format for `codechain apply -f`.
Index ¶
- Variables
- func Apply(hashchainFile, patchDir string, r io.Reader, head *[32]byte) error
- func ApplyEncryptedFile(hashchainFile, patchDir, filename string, head, key *[32]byte) error
- func ApplyFile(hashchainFile, patchDir, filename string, head *[32]byte) error
- func Create(w io.Writer, c *hashchain.HashChain, patchDir string) error
- func CreateDist(c *hashchain.HashChain, filename string) error
- func CreateEncryptedDist(c *hashchain.HashChain, filename string, key *[32]byte) error
Constants ¶
This section is empty.
Variables ¶
var ErrCannotDecrypt = errors.New("archive: cannot decrypt")
ErrCannotDecrypt is returned if an encrypted archive cannot be decrypted.
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
CreateDist creates a distribution file with filename for hash chain c. Filename must not exist.
Types ¶
This section is empty.