Versions in this module Expand all Collapse all v0 v0.9.2 Aug 6, 2018 Changes in this version type Node + func (node Node) RestoreMetadata(path string) error v0.9.1 Jun 10, 2018 v0.9.0 May 21, 2018 Changes in this version + func TestDisableCheckPolynomial(t testing.TB) + type ByteReader struct + Len int64 + func NewByteReader(buf []byte) *ByteReader + func (b *ByteReader) Length() int64 + func (b *ByteReader) Rewind() error + type Duration struct + Days int + Months int + Years int + func ParseDuration(s string) (Duration, error) + func (d *Duration) Set(s string) error + func (d Duration) String() string + func (d Duration) Type() string + func (d Duration) Zero() bool type ExpirePolicy + Within Duration + func (e ExpirePolicy) String() (s string) + type FileReader struct + Len int64 + func NewFileReader(f io.ReadSeeker) (*FileReader, error) + func (f *FileReader) Length() int64 + func (f *FileReader) Rewind() error + type RewindReader interface + Length func() int64 + Rewind func() error type Tree + func (t *Tree) Find(name string) *Node v0.8.3 Feb 26, 2018 v0.8.2 Feb 17, 2018 Changes in this version type FileInfo + Name string v0.8.1 Dec 27, 2017 v0.8.0 Nov 26, 2017 Changes in this version type Backend + Delete func(ctx context.Context) error + type Cache interface + BaseDir func() string + Clear func(FileType, IDSet) error + Has func(Handle) bool + IsNotExist func(err error) bool + Load func(h Handle, length int, offset int64) (io.ReadCloser, error) + Remove func(Handle) error + Save func(Handle, io.Reader) error + SaveWriter func(Handle) (io.WriteCloser, error) + Wrap func(Backend) Backend + type Nodes []*Node + func (n Nodes) Len() int + func (n Nodes) Less(i, j int) bool + func (n Nodes) Swap(i, j int) type Tree + func (t *Tree) Sort() v0.7.3 Sep 20, 2017 v0.7.2 Sep 13, 2017 Changes in this version + const ConfigFile + const DataFile + const IndexFile + const KeyFile + const LockFile + const RepoVersion + const SnapshotFile + var ErrMultipleIDMatches = errors.New("multiple IDs with prefix found") + var ErrNoIDPrefixFound = errors.New("no ID found") + var ErrNoSnapshotFound = errors.New("no snapshot found") + func CiphertextLength(plaintextSize int) int + func Find(be Lister, t FileType, prefix string) (string, error) + func FindUsedBlobs(ctx context.Context, repo Repository, treeID ID, blobs BlobSet, seen BlobSet) error + func Getxattr(path, name string) ([]byte, error) + func IsAlreadyLocked(err error) bool + func Listxattr(path string) ([]string, error) + func NewBlobBuffer(size int) []byte + func NewRandReader(rnd *rand.Rand) io.Reader + func PlaintextLength(ciphertextSize int) int + func PrefixLength(be Lister, t FileType) (int, error) + func ReadAt(ctx context.Context, be Backend, h Handle, offset int64, p []byte) (n int, err error) + func ReaderAt(be Backend, h Handle) io.ReaderAt + func RemoveAllLocks(ctx context.Context, repo Repository) error + func RemoveStaleLocks(ctx context.Context, repo Repository) error + func Setxattr(path, name string, data []byte) error + func TestSetLockTimeout(t testing.TB, d time.Duration) + type Backend interface + Close func() error + IsNotExist func(err error) bool + List func(ctx context.Context, t FileType) <-chan string + Load func(ctx context.Context, h Handle, length int, offset int64) (io.ReadCloser, error) + Location func() string + Remove func(ctx context.Context, h Handle) error + Save func(ctx context.Context, h Handle, rd io.Reader) error + Stat func(ctx context.Context, h Handle) (FileInfo, error) + Test func(ctx context.Context, h Handle) (bool, error) + type Blob struct + ID ID + Length uint + Offset uint + Type BlobType + func (b Blob) String() string + type BlobHandle struct + ID ID + Type BlobType + func (h BlobHandle) String() string + type BlobHandles []BlobHandle + func (h BlobHandles) Len() int + func (h BlobHandles) Less(i, j int) bool + func (h BlobHandles) String() string + func (h BlobHandles) Swap(i, j int) + type BlobSet map[BlobHandle]struct + func NewBlobSet(handles ...BlobHandle) BlobSet + func (s BlobSet) Delete(h BlobHandle) + func (s BlobSet) Equals(other BlobSet) bool + func (s BlobSet) Has(h BlobHandle) bool + func (s BlobSet) Insert(h BlobHandle) + func (s BlobSet) Intersect(other BlobSet) (result BlobSet) + func (s BlobSet) List() BlobHandles + func (s BlobSet) Merge(other BlobSet) + func (s BlobSet) String() string + func (s BlobSet) Sub(other BlobSet) (result BlobSet) + type BlobType uint8 + const DataBlob + const InvalidBlob + const TreeBlob + func (t *BlobType) UnmarshalJSON(buf []byte) error + func (t BlobType) MarshalJSON() ([]byte, error) + func (t BlobType) String() string + type Config struct + ChunkerPolynomial chunker.Pol + ID string + Version uint + func CreateConfig() (Config, error) + func LoadConfig(ctx context.Context, r JSONUnpackedLoader) (Config, error) + func TestCreateConfig(t testing.TB, pol chunker.Pol) (cfg Config) + type Deleter interface + Delete func(context.Context) error + type ErrAlreadyLocked struct + func (e ErrAlreadyLocked) Error() string + type ExpirePolicy struct + Daily int + Hourly int + Last int + Monthly int + Tags []TagList + Weekly int + Yearly int + func (e ExpirePolicy) Empty() bool + func (e ExpirePolicy) Sum() int + type ExtendedAttribute struct + Name string + Value []byte + type FileInfo struct + Size int64 + type FileType string + type Handle struct + Name string + Type FileType + func (h Handle) String() string + func (h Handle) Valid() error + type HardlinkIndex struct + Index map[HardlinkKey]string + func NewHardlinkIndex() *HardlinkIndex + func (idx *HardlinkIndex) Add(inode uint64, device uint64, name string) + func (idx *HardlinkIndex) GetFilename(inode uint64, device uint64) string + func (idx *HardlinkIndex) Has(inode uint64, device uint64) bool + func (idx *HardlinkIndex) Remove(inode uint64, device uint64) + type HardlinkKey struct + Device uint64 + Inode uint64 + type ID [idSize]byte + func FindLatestSnapshot(ctx context.Context, repo Repository, targets []string, tagLists []TagList, ...) (ID, error) + func FindSnapshot(repo Repository, s string) (ID, error) + func Hash(data []byte) ID + func IDFromHash(hash []byte) (id ID) + func NewRandomID() ID + func ParseID(s string) (ID, error) + func TestParseID(s string) ID + func (id *ID) Str() string + func (id *ID) UnmarshalJSON(b []byte) error + func (id ID) Equal(other ID) bool + func (id ID) EqualString(other string) (bool, error) + func (id ID) IsNull() bool + func (id ID) MarshalJSON() ([]byte, error) + func (id ID) String() string + type IDSet map[ID]struct + func NewIDSet(ids ...ID) IDSet + func (s IDSet) Delete(id ID) + func (s IDSet) Equals(other IDSet) bool + func (s IDSet) Has(id ID) bool + func (s IDSet) Insert(id ID) + func (s IDSet) Intersect(other IDSet) (result IDSet) + func (s IDSet) List() IDs + func (s IDSet) Merge(other IDSet) + func (s IDSet) String() string + func (s IDSet) Sub(other IDSet) (result IDSet) + type IDs []ID + func (ids IDs) Len() int + func (ids IDs) Less(i, j int) bool + func (ids IDs) String() string + func (ids IDs) Swap(i, j int) + func (ids IDs) Uniq() (list IDs) + type Index interface + Count func(BlobType) uint + Each func(ctx context.Context) <-chan PackedBlob + Has func(ID, BlobType) bool + Lookup func(ID, BlobType) ([]PackedBlob, error) + type JSONUnpackedLoader interface + LoadJSONUnpacked func(context.Context, FileType, ID, interface{}) error + type Lister interface + List func(context.Context, FileType) <-chan string + type Lock struct + Exclusive bool + GID uint32 + Hostname string + PID int + Time time.Time + UID uint32 + Username string + func LoadLock(ctx context.Context, repo Repository, id ID) (*Lock, error) + func NewExclusiveLock(ctx context.Context, repo Repository) (*Lock, error) + func NewLock(ctx context.Context, repo Repository) (*Lock, error) + func (l *Lock) Refresh(ctx context.Context) error + func (l *Lock) Stale() bool + func (l *Lock) Unlock() error + func (l Lock) String() string + type Node struct + AccessTime time.Time + ChangeTime time.Time + Content IDs + Device uint64 + DeviceID uint64 + Error string + ExtendedAttributes []ExtendedAttribute + GID uint32 + Group string + Inode uint64 + LinkTarget string + Links uint64 + ModTime time.Time + Mode os.FileMode + Name string + Path string + Size uint64 + Subtree *ID + Type string + UID uint32 + User string + func NodeFromFileInfo(path string, fi os.FileInfo) (*Node, error) + func (node *Node) CreateAt(ctx context.Context, path string, repo Repository, idx *HardlinkIndex) error + func (node *Node) IsNewer(path string, fi os.FileInfo) bool + func (node *Node) UnmarshalJSON(data []byte) error + func (node Node) Equals(other Node) bool + func (node Node) GetExtendedAttribute(a string) []byte + func (node Node) MarshalJSON() ([]byte, error) + func (node Node) RestoreTimestamps(path string) error + func (node Node) String() string + type PackedBlob struct + PackID ID + type Progress struct + OnDone ProgressFunc + OnStart func() + OnUpdate ProgressFunc + func NewProgress() *Progress + func (p *Progress) Done() + func (p *Progress) Report(s Stat) + func (p *Progress) Reset() + func (p *Progress) Start() + type ProgressFunc func(s Stat, runtime time.Duration, ticker bool) + type RandReader struct + func (rd *RandReader) Read(p []byte) (int, error) + type Repository interface + Backend func() Backend + Config func() Config + Flush func() error + Index func() Index + Key func() *crypto.Key + List func(context.Context, FileType) <-chan ID + ListPack func(context.Context, ID) ([]Blob, int64, error) + LoadAndDecrypt func(context.Context, FileType, ID) ([]byte, error) + LoadBlob func(context.Context, BlobType, ID, []byte) (int, error) + LoadIndex func(context.Context) error + LoadJSONUnpacked func(context.Context, FileType, ID, interface{}) error + LoadTree func(context.Context, ID) (*Tree, error) + LookupBlobSize func(ID, BlobType) (uint, error) + SaveBlob func(context.Context, BlobType, []byte, ID) (ID, error) + SaveFullIndex func(context.Context) error + SaveIndex func(context.Context) error + SaveJSONUnpacked func(context.Context, FileType, interface{}) (ID, error) + SaveTree func(context.Context, *Tree) (ID, error) + SaveUnpacked func(context.Context, FileType, []byte) (ID, error) + SetIndex func(Index) + type Restorer struct + Error func(dir string, node *Node, err error) error + SelectFilter func(item string, dstpath string, node *Node) (selectedForRestore bool, childMayBeSelected bool) + func NewRestorer(repo Repository, id ID) (*Restorer, error) + func (res *Restorer) RestoreTo(ctx context.Context, dst string) error + func (res *Restorer) Snapshot() *Snapshot + type Snapshot struct + Excludes []string + GID uint32 + Hostname string + Original *ID + Parent *ID + Paths []string + Tags []string + Time time.Time + Tree *ID + UID uint32 + Username string + func LoadAllSnapshots(ctx context.Context, repo Repository) (snapshots []*Snapshot, err error) + func LoadSnapshot(ctx context.Context, repo Repository, id ID) (*Snapshot, error) + func NewSnapshot(paths []string, tags []string, hostname string, time time.Time) (*Snapshot, error) + func TestCreateSnapshot(t testing.TB, repo Repository, at time.Time, depth int, duplication float32) *Snapshot + func (sn *Snapshot) AddTags(addTags []string) (changed bool) + func (sn *Snapshot) HasPaths(paths []string) bool + func (sn *Snapshot) HasTagList(l []TagList) bool + func (sn *Snapshot) HasTags(l []string) bool + func (sn *Snapshot) RemoveTags(removeTags []string) (changed bool) + func (sn Snapshot) ID() *ID + func (sn Snapshot) String() string + type Snapshots []*Snapshot + func ApplyPolicy(list Snapshots, p ExpirePolicy) (keep, remove Snapshots) + func FindFilteredSnapshots(ctx context.Context, repo Repository, host string, tags []TagList, ...) Snapshots + func (sn Snapshots) Len() int + func (sn Snapshots) Less(i, j int) bool + func (sn Snapshots) Swap(i, j int) + type Stat struct + Blobs uint64 + Bytes uint64 + Dirs uint64 + Errors uint64 + Files uint64 + Trees uint64 + func (s *Stat) Add(other Stat) + func (s Stat) String() string + type TagList []string + func (TagList) Type() string + func (l *TagList) Set(s string) error + func (l TagList) String() string + type TagLists []TagList + func (TagLists) Type() string + func (l *TagLists) Set(s string) error + func (l TagLists) String() string + type Tree struct + Nodes []*Node + func NewTree() *Tree + func (t *Tree) Insert(node *Node) error + func (t Tree) Equals(other *Tree) bool + func (t Tree) String() string + func (t Tree) Subtrees() (trees IDs)