Versions in this module Expand all Collapse all v0 v0.2.2 Oct 17, 2016 Changes in this version + const COMPRESS_GZIP + const COMPRESS_NONE + const DEFAULT_PERMISSION + const ENCRYPT_AES + const ENCRYPT_NONE + const FOOTER_SIZE + const HEADER_SIZE + const MAGIC_SIZE + const MagicBytes + const VERSION_1 + var ByteOrder = binary.LittleEndian + func FixPath(path string) string + func HashingKey(settings CipherSettings) []byte + func TransformPack(data []byte, compression byte, encryption byte, key []byte) ([]byte, error) + func TransformUnpack(data []byte, compression byte, encryption byte, key []byte) ([]byte, error) + type BundleFile struct + DataBaseOffset int64 + DupCount int + DupSize int64 + FAT FAT + File *os.File + Footer *Footer + Header *Header + Path string + Settings BundleSettings + func CreateBundle(filename string, settings BundleSettings) (*BundleFile, error) + func OpenBundle(filename string, cipherKey []byte) (*BundleFile, error) + func (this *BundleFile) AddFile(relativePath, file string) (*FATItem, error) + func (this *BundleFile) Close() error + func (this *BundleFile) Flush() error + func (this *BundleFile) ReadFile(item FATItem) ([]byte, error) + func (this *BundleFile) ReadFileFromPath(filepath string) ([]byte, error) + type BundleSettings struct + CipherKey []byte + Compression byte + Encryption byte + type CipherSettings struct + Iteration int + Key string + Salt string + func NewCipherSettings(key string) CipherSettings + type FAT struct + Count int64 + Items []FATItem + Size int64 + func FATFromJSON(buf []byte) (*FAT, error) + func (fat FAT) JSON() ([]byte, error) + func (fat FAT) String() string + type FATItem struct + Hash [64]byte + MTime int64 + Mode uint32 + Offset int64 + OrigSize int64 + Path string + Perm uint32 + Size int64 + func (item FATItem) String() string + type FinishResult struct + DupCount int + DupSize int64 + Err error + FileCount int64 + Size int64 + func Pack(settings PackSettings) FinishResult + func Unpack(settings UnpackSettings) FinishResult + type Footer struct + Checksum uint32 + Magic []byte + PackSize int64 + func GetFooter(pack io.Reader) (*Footer, error) + func NewFooter() *Footer + func (footer *Footer) Write(writer io.Writer) error + type Header struct + Compress byte + Created int64 + Encrypt byte + FatSize int64 + Magic []byte + Version byte + func GetHeader(pack io.Reader) (*Header, error) + func NewHeader(encryption, compression byte) *Header + func (header *Header) Write(writer io.Writer) error + type ListResult struct + Err error + FAT *FAT + func ListPack(settings ListSettings) ListResult + type ListSettings struct + Cipher CipherSettings + OnFinish chan ListResult + PackFileName string + func (this *ListSettings) Finish(err error, fat *FAT) ListResult + func (this *ListSettings) FinishError(err error) ListResult + type PackSettings struct + Cipher CipherSettings + Compression byte + Encryption byte + Excludes string + Includes string + OnFinish chan FinishResult + OnProgress chan ProgressState + SourceDir string + TargetFilename string + func (this *PackSettings) Finish(err error, fileCount int64, size int64, dupCount int, dupSize int64) FinishResult + func (this *PackSettings) FinishError(err error) FinishResult + func (this *PackSettings) Progress(total, index int, filename string) + func (this *PackSettings) ProgressError(err error, filename string) + type ProgressState struct + CurrentFile string + Err error + Index int + Total int + type UnpackSettings struct + Cipher CipherSettings + Excludes string + Includes string + OnFinish chan FinishResult + OnProgress chan ProgressState + PackFileName string + TargetDir string + func (this *UnpackSettings) Finish(err error, fileCount int64, size int64, dupCount int, dupSize int64) FinishResult + func (this *UnpackSettings) FinishError(err error) FinishResult + func (this *UnpackSettings) Progress(total, index int, filename string) + func (this *UnpackSettings) ProgressError(err error, filename string)