diff --git a/archiver.go b/archiver.go index 31d4966aa..ca8542b65 100644 --- a/archiver.go +++ b/archiver.go @@ -530,7 +530,8 @@ func (j archiveJob) Copy() pipe.Job { } // Snapshot creates a snapshot of the given paths. If parentID is set, this is -// used to compare the files with. +// used to compare the files to the ones archived at the time this snapshot was +// taken. func (arch *Archiver) Snapshot(p *Progress, paths []string, parentID backend.ID) (*Snapshot, backend.ID, error) { debug.Log("Archiver.Snapshot", "start for %v", paths) diff --git a/cache.go b/cache.go index fb02024b3..24f7a17fd 100644 --- a/cache.go +++ b/cache.go @@ -13,7 +13,7 @@ import ( "github.com/restic/restic/server" ) -// Cache is used to handle the local cache. +// Cache is used to locally cache items from a server. type Cache struct { base string } @@ -53,7 +53,9 @@ func (c *Cache) Has(t backend.Type, subtype string, id backend.ID) (bool, error) return true, nil } -// Store returns an io.WriteCloser that is used to save new information to. +// Store returns an io.WriteCloser that is used to save new information to the +// cache. The returned io.WriteCloser must be closed by the caller after all +// data has been written. func (c *Cache) Store(t backend.Type, subtype string, id backend.ID) (io.WriteCloser, error) { filename, err := c.filename(t, subtype, id) if err != nil { @@ -76,7 +78,8 @@ func (c *Cache) Store(t backend.Type, subtype string, id backend.ID) (io.WriteCl return file, nil } -// Load returns information from the cache. +// Load returns information from the cache. The returned io.ReadCloser must be +// closed by the caller. func (c *Cache) Load(t backend.Type, subtype string, id backend.ID) (io.ReadCloser, error) { filename, err := c.filename(t, subtype, id) if err != nil { diff --git a/chunker/chunker.go b/chunker/chunker.go index 9d19a2e2a..9e016e4dd 100644 --- a/chunker/chunker.go +++ b/chunker/chunker.go @@ -53,7 +53,7 @@ func (c Chunk) Reader(r io.ReaderAt) io.Reader { return io.NewSectionReader(r, int64(c.Start), int64(c.Length)) } -// Chunker split content with Rabin Fingerprints. +// Chunker splits content with Rabin Fingerprints. type Chunker struct { pol Pol polShift uint