arq

package module
v0.0.0-...-6842840 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2021 License: MIT Imports: 24 Imported by: 0

README

GoDoc Go Report Card

arq

Go library to explore and restore data created by the awesome Arq Backup software.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnimplemented      = errors.New("Unimplemented")
	ErrUnknownSliceLength = errors.New("ErrUnknownSliceLength")
	ErrTooLong            = errors.New("value contains too many elements")
	ErrInvalidNotNull     = errors.New("ErrInvalidNotNull")
)

Functions

func DecodeArq

func DecodeArq(r io.Reader, i interface{}) error

func NewEObjectReader

func NewEObjectReader(ur io.Reader, e *encryptionV3) io.Reader

func Unlock

func Unlock(ctx context.Context, reader io.ReadCloser, passphrase string) (*encryptionV3, error)

Types

type ArqBlobKey

type ArqBlobKey struct {
	Hash                   ShaHash
	EncryptionKeyStretched bool
	StorageType            int32
	ArchiveId              string
	ArchiveSize            uint64
	ArchiveUploadDate      time.Time
}

type ArqNode

type ArqNode struct {
	IsTree                   bool
	TreeContainsMissingItems bool
	DataCompressionType      CompressionType
	XattrsCompressionType    CompressionType
	AclCompressionType       CompressionType
	DataBlobKeys             []ArqBlobKey `arq:"len-uint32"`
	DataSize                 uint64
	XattrsBlobKey            ArqBlobKey
	XattrsSize               uint64
	AclBlobKey               ArqBlobKey
	Uid                      int32
	Gid                      int32
	Mode                     int32
	Mtime                    time.Time `arq:"nsec"`
	Flags                    int64
	FinderFlags              int32
	ExtendedFinderFlags      int32
	FinderFileType           string
	FinderFileCreator        string
	IsFileExtensionHidden    bool
	StDev                    int32
	StIno                    int32
	StNlink                  uint32
	StRdev                   int32
	Ctime                    time.Time `arq:"nsec"`
	CreateTime               time.Time `arq:"nsec"`
	StBlocks                 int64
	StBlkSize                uint32
}

type ArqPack

type ArqPack struct {
	Magic       [4]byte
	Version     uint32
	ObjectCount uint64
	Objects     []ArqPackObject
	SHA1        [20]byte
}

func (*ArqPack) UnmarshalArq

func (p *ArqPack) UnmarshalArq(input io.Reader) error

type ArqPackIndex

type ArqPackIndex struct {
	Header  [4]byte
	Version uint32
	Fanout  [256]uint32
	Objects []ArqPackIndexObject
	SHA1    [20]byte
}

func (*ArqPackIndex) UnmarshalArq

func (o *ArqPackIndex) UnmarshalArq(input io.Reader) error

type ArqPackIndexObject

type ArqPackIndexObject struct {
	Offset    uint64
	Length    uint64
	SHA1      [20]byte
	Alignment [4]byte
}

func (ArqPackIndexObject) String

func (o ArqPackIndexObject) String() string

type ArqPackObject

type ArqPackObject struct {
	Mimetype string
	Name     string
	Data     []byte `arq:"len-uint64"`
}

type ArqTree

type ArqTree struct {
	// 54 72 65 65 56 30 32 32             "TreeV022"
	Header                [8]byte
	XattrsCompressionType CompressionType
	AclCompressionType    CompressionType
	XattrsBlobKey         ArqBlobKey
	XattrsSize            uint64
	AclBlobKey            ArqBlobKey
	Uid                   int32
	Gid                   int32
	Mode                  int32
	Mtime                 time.Time `arq:"nsec"`
	Flags                 int64
	FinderFlags           int32
	ExtendedFinderFlags   int32
	StDev                 int32
	StIno                 int32
	StNlink               uint32
	StRdev                int32
	Ctime                 time.Time `arq:"nsec"`
	StBlocks              int64
	StBlkSize             uint32
	CreateTimeSec         int64
	CreateTimeNsec        int64
	MissingNodes          []string      `arq:"len-uint32"`
	Nodes                 []ArqTreeNode `arq:"len-uint32"`
}

type ArqTreeNode

type ArqTreeNode struct {
	FileName string
	Node     ArqNode
}

type ArqUnmarshaler

type ArqUnmarshaler interface {
	UnmarshalArq(io.Reader) error
}

type CompressionType

type CompressionType int32
const (
	NoneCompression CompressionType = 0
	GzipCompression CompressionType = 1
	Lz4Compression  CompressionType = 2
)

func (CompressionType) String

func (ct CompressionType) String() string

type Computer

type Computer struct {
	Uuid string
	Info ComputerInfo
	// contains filtered or unexported fields
}

func ListComputers

func ListComputers(ctx context.Context, f fs.Fs, base string) ([]Computer, error)

func NewComputer

func NewComputer(fs fs.Fs, base string) *Computer

func (*Computer) List

func (c *Computer) List(ctx context.Context, dir string) (fs.DirEntries, error)

func (*Computer) ListFolders

func (c *Computer) ListFolders(ctx context.Context) ([]FolderInfo, error)

func (*Computer) NewObject

func (c *Computer) NewObject(ctx context.Context, p string) (fs.Object, error)

func (*Computer) Open

func (c *Computer) Open(ctx context.Context, passphrase string) error

type ComputerInfo

type ComputerInfo struct {
	UserName     string `plist:"userName"`
	ComputerName string `plist:"computerName"`
}

type Folder

type Folder struct {
	// contains filtered or unexported fields
}

func (*Folder) FindMaster

func (f *Folder) FindMaster(ctx context.Context) (ShaHash, error)

func (*Folder) ListRefs

func (f *Folder) ListRefs(ctx context.Context) ([]RefListEntry, error)

ListRefs returns a sorted list of RefListEntry, corresponding to all the commits in `refs/logs/master`.

The list is sorted in reverse chronological order (the most recent commit is first).

func (*Folder) RefEntry

func (f *Folder) RefEntry(ctx context.Context, name int) (RefEntry, error)

type FolderInfo

type FolderInfo struct {
	Endpoint                                       string `plist:"Endpoint"`
	BucketUuid                                     string `plist:"BucketUUID"`
	BucketName                                     string `plist:"BucketName"`
	ComputerUuid                                   string `plist:"ComputerUUID"`
	LocalPath                                      string `plist:"LocalPath"`
	LocalMountPoint                                string `plist:"LocalMountPoint"`
	StorageType                                    int    `plist:"StorageType"`
	SkipDuringBackup                               bool   `plist:"SkipDuringBackup"`
	ExcludeItemsWithTimeMachineExcludeMetadataFlag bool   `plist:"ExcludeItemsWithTimeMachineExcludeMetadataFlag"`
	// contains filtered or unexported fields
}

func (*FolderInfo) Folder

func (fi *FolderInfo) Folder() *Folder

type PaddedReader

type PaddedReader struct {
	// contains filtered or unexported fields
}

func NewPaddedReader

func NewPaddedReader(r io.Reader, blockSize int) *PaddedReader

func (*PaddedReader) Read

func (pr *PaddedReader) Read(dst []byte) (n int, err error)

type RefEntry

type RefEntry struct {
	OldHeadStretchKey bool   `plist:"oldHeadStretchKey"`
	NewHeadSha1       string `plist:"newHeadSHA1"`
	NewHeadStretchKey bool   `plist:"newHeadStretchKey"`
	PackSha1          string `plist:"packSHA1"`
}

type RefListEntry

type RefListEntry struct {
	Name int
	// contains filtered or unexported fields
}

type ShaHash

type ShaHash struct {
	Contents [20]byte
}

func DecodeShaHash

func DecodeShaHash(in []byte) (ShaHash, error)

func DecodeShaHashString

func DecodeShaHashString(in string) (ShaHash, error)

func WrapShaHash

func WrapShaHash(in *[20]byte) ShaHash

func (ShaHash) String

func (sh ShaHash) String() string

func (*ShaHash) UnmarshalArq

func (sh *ShaHash) UnmarshalArq(input io.Reader) error

Directories

Path Synopsis
pack

Jump to

Keyboard shortcuts

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