snapshot: specify View function on snapshot manager

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2016-12-07 19:58:26 -08:00
parent 5a86eae247
commit f7850ccd68
No known key found for this signature in database
GPG key ID: FB5F6B2905D7ECF3

View file

@ -1,7 +1,6 @@
package snapshot
import (
"errors"
"fmt"
"io/ioutil"
"os"
@ -11,10 +10,6 @@ import (
"github.com/docker/containerd"
)
var (
errNotImplemented = errors.New("not implemented")
)
// Manager provides an API for allocating, snapshotting and mounting
// abstract, layer-based filesytems. The model works by building up sets of
// directories with parent-child relationships.
@ -204,6 +199,18 @@ func (lm *Manager) Prepare(dst, parent string) ([]containerd.Mount, error) {
}, nil
}
// View behaves identically to Prepare except the result may not be commited
// back to the snappshot manager.
//
// Whether or not these are readonly mounts is implementation specific, but the
// caller may write to dst freely.
//
// Calling Commit on dst will result in an error. Calling Rollback on dst
// should be done to cleanup resources.
func (lm *Manager) View(dst, parent string) ([]containerd.Mount, error) {
panic("not implemented")
}
// Commit captures the changes between dst and its parent into the path
// provided by diff. The path diff can then be used with the layer
// manipulator's other methods to access the diff content.
@ -292,5 +299,5 @@ type Change struct {
// Changes returns the list of changes from the diff's parent.
func (lm *Manager) Changes(diff string) ([]Change, error) {
return nil, errNotImplemented
panic("not implemented")
}