Documentation ¶
Overview ¶
Directory compression/extraction functions Adapted from "github.com/walle/targz" (MIT)
Index ¶
- Constants
- func Compress(inputDirPath string, includeRootFolder bool) (io.Reader, error)
- func Decrypt(ciphertextReader io.Reader, password []byte) (io.Reader, error)
- func Encrypt(plaintextReader io.Reader, password []byte) (io.Reader, error)
- func Extract(zippedData io.Reader, outputDirPath string) error
- type Params
- type Storage
- type StorageError
Constants ¶
View Source
const ( ErrRetrieveSourceNotFound = 0 ErrDecryptPassword = 1 ErrDecryptGpg = 2 ErrExtractCreateDest = 3 ErrExtractUnzip = 4 )
Variables ¶
This section is empty.
Functions ¶
func Compress ¶
Compress creates a archive from the folder inputDirPath and returns an io.Reader so that the caller can redirect it where he wants (file, socket, ...). It only adds the last directory in inputDirPath to the archive, not the whole path.
func Decrypt ¶
Reads the input `cypherTextReader` and decrypts it with `password` based on `openpgp` algo, then returns the result as an io.Reader. Up to the caller to redirect the output wherever he wants (file, Extract zip, ...).
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Object owner of the encryption and compression options. Can be global (application wise) or contextual (session/user wise).
func NewStorage ¶
type StorageError ¶ added in v0.1.0
type StorageError struct {
// contains filtered or unexported fields
}
func NewStorageError ¶ added in v0.2.0
func NewStorageError(code int) *StorageError
func (*StorageError) Error ¶ added in v0.1.0
func (this *StorageError) Error() string
Click to show internal directories.
Click to hide internal directories.