diff --git a/cmd/oci-storage/container.go b/cmd/oci-storage/container.go index 17420d179..d13f4dd47 100644 --- a/cmd/oci-storage/container.go +++ b/cmd/oci-storage/container.go @@ -6,8 +6,8 @@ import ( "io/ioutil" "os" + "github.com/containers/storage" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) var ( @@ -22,7 +22,7 @@ func container(flags *mflag.FlagSet, action string, m storage.Store, args []stri } matches := []*storage.Container{} for _, arg := range args { - if container, err := m.GetContainer(arg); err == nil { + if container, err := m.Container(arg); err == nil { matches = append(matches, container) } } @@ -56,7 +56,7 @@ func container(flags *mflag.FlagSet, action string, m storage.Store, args []stri } func listContainerBigData(flags *mflag.FlagSet, action string, m storage.Store, args []string) int { - container, err := m.GetContainer(args[0]) + container, err := m.Container(args[0]) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 @@ -73,7 +73,7 @@ func listContainerBigData(flags *mflag.FlagSet, action string, m storage.Store, } func getContainerBigData(flags *mflag.FlagSet, action string, m storage.Store, args []string) int { - container, err := m.GetContainer(args[0]) + container, err := m.Container(args[0]) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 @@ -87,7 +87,7 @@ func getContainerBigData(flags *mflag.FlagSet, action string, m storage.Store, a } output = f } - b, err := m.GetContainerBigData(container.ID, args[1]) + b, err := m.ContainerBigData(container.ID, args[1]) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 @@ -98,7 +98,7 @@ func getContainerBigData(flags *mflag.FlagSet, action string, m storage.Store, a } func setContainerBigData(flags *mflag.FlagSet, action string, m storage.Store, args []string) int { - container, err := m.GetContainer(args[0]) + container, err := m.Container(args[0]) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 @@ -126,7 +126,7 @@ func setContainerBigData(flags *mflag.FlagSet, action string, m storage.Store, a } func getContainerDir(flags *mflag.FlagSet, action string, m storage.Store, args []string) int { - path, err := m.GetContainerDirectory(args[0]) + path, err := m.ContainerDirectory(args[0]) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 @@ -136,7 +136,7 @@ func getContainerDir(flags *mflag.FlagSet, action string, m storage.Store, args } func getContainerRunDir(flags *mflag.FlagSet, action string, m storage.Store, args []string) int { - path, err := m.GetContainerRunDirectory(args[0]) + path, err := m.ContainerRunDirectory(args[0]) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 diff --git a/cmd/oci-storage/containers.go b/cmd/oci-storage/containers.go index cd7d8acb2..a27121556 100644 --- a/cmd/oci-storage/containers.go +++ b/cmd/oci-storage/containers.go @@ -5,8 +5,8 @@ import ( "fmt" "os" + "github.com/containers/storage" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) func containers(flags *mflag.FlagSet, action string, m storage.Store, args []string) int { diff --git a/cmd/oci-storage/create.go b/cmd/oci-storage/create.go index 560426102..97bed1084 100644 --- a/cmd/oci-storage/create.go +++ b/cmd/oci-storage/create.go @@ -7,9 +7,9 @@ import ( "io/ioutil" "os" + "github.com/containers/storage" "github.com/containers/storage/opts" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) var ( @@ -51,13 +51,13 @@ func importLayer(flags *mflag.FlagSet, action string, m storage.Store, args []st } diffStream := io.Reader(os.Stdin) if applyDiffFile != "" { - if f, err := os.Open(applyDiffFile); err != nil { + f, err := os.Open(applyDiffFile) + if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 - } else { - diffStream = f - defer f.Close() } + diffStream = f + defer f.Close() } layer, _, err := m.PutLayer(paramID, parent, paramNames, paramMountLabel, !paramCreateRO, diffStream) if err != nil { diff --git a/cmd/oci-storage/delete.go b/cmd/oci-storage/delete.go index f338af509..fe42af7e3 100644 --- a/cmd/oci-storage/delete.go +++ b/cmd/oci-storage/delete.go @@ -5,8 +5,8 @@ import ( "fmt" "os" + "github.com/containers/storage" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) var testDeleteImage = false diff --git a/cmd/oci-storage/diff.go b/cmd/oci-storage/diff.go index 232e34d8a..28cc38fe6 100644 --- a/cmd/oci-storage/diff.go +++ b/cmd/oci-storage/diff.go @@ -6,9 +6,9 @@ import ( "io" "os" + "github.com/containers/storage" "github.com/containers/storage/pkg/archive" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) var ( @@ -63,13 +63,13 @@ func diff(flags *mflag.FlagSet, action string, m storage.Store, args []string) i } diffStream := io.Writer(os.Stdout) if diffFile != "" { - if f, err := os.Create(diffFile); err != nil { + f, err := os.Create(diffFile) + if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 - } else { - diffStream = f - defer f.Close() } + diffStream = f + defer f.Close() } reader, err := m.Diff(from, to) if err != nil { @@ -108,13 +108,13 @@ func applyDiff(flags *mflag.FlagSet, action string, m storage.Store, args []stri } diffStream := io.Reader(os.Stdin) if applyDiffFile != "" { - if f, err := os.Open(applyDiffFile); err != nil { + f, err := os.Open(applyDiffFile) + if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 - } else { - diffStream = f - defer f.Close() } + diffStream = f + defer f.Close() } _, err := m.ApplyDiff(args[0], diffStream) if err != nil { diff --git a/cmd/oci-storage/exists.go b/cmd/oci-storage/exists.go index f3930cafc..fab1aec57 100644 --- a/cmd/oci-storage/exists.go +++ b/cmd/oci-storage/exists.go @@ -5,8 +5,8 @@ import ( "fmt" "os" + "github.com/containers/storage" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) var ( @@ -26,17 +26,17 @@ func exist(flags *mflag.FlagSet, action string, m storage.Store, args []string) exists := m.Exists(what) existDict[what] = exists if existContainer { - if c, err := m.GetContainer(what); c == nil || err != nil { + if c, err := m.Container(what); c == nil || err != nil { exists = false } } if existImage { - if i, err := m.GetImage(what); i == nil || err != nil { + if i, err := m.Image(what); i == nil || err != nil { exists = false } } if existLayer { - if l, err := m.GetLayer(what); l == nil || err != nil { + if l, err := m.Layer(what); l == nil || err != nil { exists = false } } diff --git a/cmd/oci-storage/image.go b/cmd/oci-storage/image.go index ba17191ed..79c45587e 100644 --- a/cmd/oci-storage/image.go +++ b/cmd/oci-storage/image.go @@ -6,8 +6,8 @@ import ( "io/ioutil" "os" + "github.com/containers/storage" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) var ( @@ -17,7 +17,7 @@ var ( func image(flags *mflag.FlagSet, action string, m storage.Store, args []string) int { matched := []*storage.Image{} for _, arg := range args { - if image, err := m.GetImage(arg); err == nil { + if image, err := m.Image(arg); err == nil { matched = append(matched, image) } } @@ -42,7 +42,7 @@ func image(flags *mflag.FlagSet, action string, m storage.Store, args []string) } func listImageBigData(flags *mflag.FlagSet, action string, m storage.Store, args []string) int { - image, err := m.GetImage(args[0]) + image, err := m.Image(args[0]) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 @@ -59,7 +59,7 @@ func listImageBigData(flags *mflag.FlagSet, action string, m storage.Store, args } func getImageBigData(flags *mflag.FlagSet, action string, m storage.Store, args []string) int { - image, err := m.GetImage(args[0]) + image, err := m.Image(args[0]) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 @@ -73,7 +73,7 @@ func getImageBigData(flags *mflag.FlagSet, action string, m storage.Store, args } output = f } - b, err := m.GetImageBigData(image.ID, args[1]) + b, err := m.ImageBigData(image.ID, args[1]) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 @@ -84,7 +84,7 @@ func getImageBigData(flags *mflag.FlagSet, action string, m storage.Store, args } func setImageBigData(flags *mflag.FlagSet, action string, m storage.Store, args []string) int { - image, err := m.GetImage(args[0]) + image, err := m.Image(args[0]) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 diff --git a/cmd/oci-storage/images.go b/cmd/oci-storage/images.go index cc326d894..0d895ac88 100644 --- a/cmd/oci-storage/images.go +++ b/cmd/oci-storage/images.go @@ -5,8 +5,8 @@ import ( "fmt" "os" + "github.com/containers/storage" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) func images(flags *mflag.FlagSet, action string, m storage.Store, args []string) int { diff --git a/cmd/oci-storage/layers.go b/cmd/oci-storage/layers.go index 152011a05..26b6041fa 100644 --- a/cmd/oci-storage/layers.go +++ b/cmd/oci-storage/layers.go @@ -5,8 +5,8 @@ import ( "fmt" "os" + "github.com/containers/storage" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) var listLayersTree = false diff --git a/cmd/oci-storage/main.go b/cmd/oci-storage/main.go index fb4249f18..1ba6017b0 100644 --- a/cmd/oci-storage/main.go +++ b/cmd/oci-storage/main.go @@ -5,10 +5,10 @@ import ( "os" "github.com/Sirupsen/logrus" + "github.com/containers/storage" "github.com/containers/storage/opts" "github.com/containers/storage/pkg/mflag" "github.com/containers/storage/pkg/reexec" - "github.com/containers/storage/storage" ) type command struct { diff --git a/cmd/oci-storage/metadata.go b/cmd/oci-storage/metadata.go index ddbf9f5f6..655d1df3a 100644 --- a/cmd/oci-storage/metadata.go +++ b/cmd/oci-storage/metadata.go @@ -7,8 +7,8 @@ import ( "os" "strings" + "github.com/containers/storage" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) var metadataQuiet = false @@ -20,7 +20,7 @@ func metadata(flags *mflag.FlagSet, action string, m storage.Store, args []strin metadataDict := make(map[string]string) missingAny := false for _, what := range args { - if metadata, err := m.GetMetadata(what); err == nil { + if metadata, err := m.Metadata(what); err == nil { metadataDict[what] = strings.TrimSuffix(metadata, "\n") } else { missingAny = true diff --git a/cmd/oci-storage/mount.go b/cmd/oci-storage/mount.go index 33e85b442..70075b2f7 100644 --- a/cmd/oci-storage/mount.go +++ b/cmd/oci-storage/mount.go @@ -5,8 +5,8 @@ import ( "fmt" "os" + "github.com/containers/storage" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) type mountPointOrError struct { diff --git a/cmd/oci-storage/name.go b/cmd/oci-storage/name.go index de68e0bd8..3c35e6a8b 100644 --- a/cmd/oci-storage/name.go +++ b/cmd/oci-storage/name.go @@ -5,9 +5,9 @@ import ( "fmt" "os" + "github.com/containers/storage" "github.com/containers/storage/opts" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) func addNames(flags *mflag.FlagSet, action string, m storage.Store, args []string) int { @@ -19,7 +19,7 @@ func addNames(flags *mflag.FlagSet, action string, m storage.Store, args []strin fmt.Fprintf(os.Stderr, "%v\n", err) return 1 } - oldnames, err := m.GetNames(id) + oldnames, err := m.Names(id) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 @@ -35,7 +35,7 @@ func addNames(flags *mflag.FlagSet, action string, m storage.Store, args []strin fmt.Fprintf(os.Stderr, "%v\n", err) return 1 } - names, err := m.GetNames(id) + names, err := m.Names(id) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 @@ -59,7 +59,7 @@ func setNames(flags *mflag.FlagSet, action string, m storage.Store, args []strin fmt.Fprintf(os.Stderr, "%v\n", err) return 1 } - names, err := m.GetNames(id) + names, err := m.Names(id) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) return 1 diff --git a/cmd/oci-storage/shutdown.go b/cmd/oci-storage/shutdown.go index b6387269c..595ca634e 100644 --- a/cmd/oci-storage/shutdown.go +++ b/cmd/oci-storage/shutdown.go @@ -5,8 +5,8 @@ import ( "fmt" "os" + "github.com/containers/storage" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) var ( diff --git a/cmd/oci-storage/status.go b/cmd/oci-storage/status.go index cf3f9bb82..9b7669320 100644 --- a/cmd/oci-storage/status.go +++ b/cmd/oci-storage/status.go @@ -5,8 +5,8 @@ import ( "fmt" "os" + "github.com/containers/storage" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) func status(flags *mflag.FlagSet, action string, m storage.Store, args []string) int { diff --git a/cmd/oci-storage/version.go b/cmd/oci-storage/version.go index 9afc2ed6b..fceef747b 100644 --- a/cmd/oci-storage/version.go +++ b/cmd/oci-storage/version.go @@ -5,8 +5,8 @@ import ( "fmt" "os" + "github.com/containers/storage" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) func version(flags *mflag.FlagSet, action string, m storage.Store, args []string) int { diff --git a/cmd/oci-storage/wipe.go b/cmd/oci-storage/wipe.go index d464cc283..8a0c709fb 100644 --- a/cmd/oci-storage/wipe.go +++ b/cmd/oci-storage/wipe.go @@ -5,8 +5,8 @@ import ( "fmt" "os" + "github.com/containers/storage" "github.com/containers/storage/pkg/mflag" - "github.com/containers/storage/storage" ) func wipe(flags *mflag.FlagSet, action string, m storage.Store, args []string) int { diff --git a/storage/containers.go b/containers.go similarity index 97% rename from storage/containers.go rename to containers.go index a3ab9c093..90a0bc0be 100644 --- a/storage/containers.go +++ b/containers.go @@ -264,7 +264,7 @@ func (r *containerStore) Create(id string, names []string, image, layer, metadat return container, err } -func (r *containerStore) GetMetadata(id string) (string, error) { +func (r *containerStore) Metadata(id string) (string, error) { if container, ok := r.lookup(id); ok { return container.Metadata, nil } @@ -347,7 +347,7 @@ func (r *containerStore) Exists(id string) bool { return ok } -func (r *containerStore) GetBigData(id, key string) ([]byte, error) { +func (r *containerStore) BigData(id, key string) ([]byte, error) { c, ok := r.lookup(id) if !ok { return nil, ErrContainerUnknown @@ -355,7 +355,7 @@ func (r *containerStore) GetBigData(id, key string) ([]byte, error) { return ioutil.ReadFile(r.datapath(c.ID, key)) } -func (r *containerStore) GetBigDataSize(id, key string) (int64, error) { +func (r *containerStore) BigDataSize(id, key string) (int64, error) { c, ok := r.lookup(id) if !ok { return -1, ErrContainerUnknown @@ -366,7 +366,7 @@ func (r *containerStore) GetBigDataSize(id, key string) (int64, error) { return -1, ErrSizeUnknown } -func (r *containerStore) GetBigDataNames(id string) ([]string, error) { +func (r *containerStore) BigDataNames(id string) ([]string, error) { c, ok := r.lookup(id) if !ok { return nil, ErrContainerUnknown diff --git a/drivers/aufs/aufs.go b/drivers/aufs/aufs.go index 71ed559a3..8caa91fe9 100644 --- a/drivers/aufs/aufs.go +++ b/drivers/aufs/aufs.go @@ -185,8 +185,8 @@ func (a *Driver) Status() [][2]string { } } -// GetMetadata not implemented -func (a *Driver) GetMetadata(id string) (map[string]string, error) { +// Metadata not implemented +func (a *Driver) Metadata(id string) (map[string]string, error) { return nil, nil } diff --git a/drivers/btrfs/btrfs.go b/drivers/btrfs/btrfs.go index 97e417683..5bcee11f7 100644 --- a/drivers/btrfs/btrfs.go +++ b/drivers/btrfs/btrfs.go @@ -143,8 +143,8 @@ func (d *Driver) Status() [][2]string { return status } -// GetMetadata returns empty metadata for this driver. -func (d *Driver) GetMetadata(id string) (map[string]string, error) { +// Metadata returns empty metadata for this driver. +func (d *Driver) Metadata(id string) (map[string]string, error) { return nil, nil } diff --git a/drivers/devmapper/driver.go b/drivers/devmapper/driver.go index 1fc3a7b39..a11742402 100644 --- a/drivers/devmapper/driver.go +++ b/drivers/devmapper/driver.go @@ -94,8 +94,8 @@ func (d *Driver) Status() [][2]string { return status } -// GetMetadata returns a map of information about the device. -func (d *Driver) GetMetadata(id string) (map[string]string, error) { +// Metadata returns a map of information about the device. +func (d *Driver) Metadata(id string) (map[string]string, error) { m, err := d.DeviceSet.exportDeviceMetadata(id) if err != nil { diff --git a/drivers/driver.go b/drivers/driver.go index e267f6184..cdf91d02d 100644 --- a/drivers/driver.go +++ b/drivers/driver.go @@ -69,7 +69,7 @@ type ProtoDriver interface { Status() [][2]string // Returns a set of key-value pairs which give low level information // about the image/container driver is managing. - GetMetadata(id string) (map[string]string, error) + Metadata(id string) (map[string]string, error) // Cleanup performs necessary tasks to release resources // held by the driver, e.g., unmounting all layered filesystems // known to this driver. diff --git a/drivers/overlay/overlay.go b/drivers/overlay/overlay.go index 7b9cff566..6c1642cbf 100644 --- a/drivers/overlay/overlay.go +++ b/drivers/overlay/overlay.go @@ -226,9 +226,9 @@ func (d *Driver) Status() [][2]string { } } -// GetMetadata returns meta data about the overlay driver such as +// Metadata returns meta data about the overlay driver such as // LowerDir, UpperDir, WorkDir and MergeDir used to store data. -func (d *Driver) GetMetadata(id string) (map[string]string, error) { +func (d *Driver) Metadata(id string) (map[string]string, error) { dir := d.dir(id) if _, err := os.Stat(dir); err != nil { return nil, err diff --git a/drivers/proxy.go b/drivers/proxy.go index 1bab2ef32..0e4a5b8ef 100644 --- a/drivers/proxy.go +++ b/drivers/proxy.go @@ -144,12 +144,12 @@ func (d *graphDriverProxy) Status() [][2]string { return ret.Status } -func (d *graphDriverProxy) GetMetadata(id string) (map[string]string, error) { +func (d *graphDriverProxy) Metadata(id string) (map[string]string, error) { args := &graphDriverRequest{ ID: id, } var ret graphDriverResponse - if err := d.client.Call("GraphDriver.GetMetadata", args, &ret); err != nil { + if err := d.client.Call("GraphDriver.Metadata", args, &ret); err != nil { return nil, err } if ret.Err != "" { diff --git a/drivers/vfs/driver.go b/drivers/vfs/driver.go index 42d95ba04..5dd934fd5 100644 --- a/drivers/vfs/driver.go +++ b/drivers/vfs/driver.go @@ -58,8 +58,8 @@ func (d *Driver) Status() [][2]string { return nil } -// GetMetadata is used for implementing the graphdriver.ProtoDriver interface. VFS does not currently have any meta data. -func (d *Driver) GetMetadata(id string) (map[string]string, error) { +// Metadata is used for implementing the graphdriver.ProtoDriver interface. VFS does not currently have any meta data. +func (d *Driver) Metadata(id string) (map[string]string, error) { return nil, nil } diff --git a/drivers/windows/windows.go b/drivers/windows/windows.go index 764fd7df8..d87fb197b 100644 --- a/drivers/windows/windows.go +++ b/drivers/windows/windows.go @@ -133,7 +133,7 @@ func (d *Driver) create(id, parent, mountLabel string, readOnly bool, storageOpt var layerChain []string if rPId != "" { - parentPath, err := hcsshim.GetLayerMountPath(d.info, rPId) + parentPath, err := hcsshim.LayerMountPath(d.info, rPId) if err != nil { return err } @@ -248,7 +248,7 @@ func (d *Driver) Get(id, mountLabel string) (string, error) { return "", err } - mountPath, err := hcsshim.GetLayerMountPath(d.info, rID) + mountPath, err := hcsshim.LayerMountPath(d.info, rID) if err != nil { d.ctr.Decrement(rID) if err2 := hcsshim.DeactivateLayer(d.info, rID); err2 != nil { @@ -403,7 +403,7 @@ func (d *Driver) ApplyDiff(id, parent string, diff archive.Reader) (int64, error if err != nil { return 0, err } - parentPath, err := hcsshim.GetLayerMountPath(d.info, rPId) + parentPath, err := hcsshim.LayerMountPath(d.info, rPId) if err != nil { return 0, err } @@ -446,8 +446,8 @@ func (d *Driver) DiffSize(id, parent string) (size int64, err error) { return archive.ChangesSize(layerFs, changes), nil } -// GetMetadata returns custom driver information. -func (d *Driver) GetMetadata(id string) (map[string]string, error) { +// Metadata returns custom driver information. +func (d *Driver) Metadata(id string) (map[string]string, error) { m := make(map[string]string) m["dir"] = d.dir(id) return m, nil diff --git a/drivers/zfs/zfs.go b/drivers/zfs/zfs.go index 3a36131cf..8fd17e6cb 100644 --- a/drivers/zfs/zfs.go +++ b/drivers/zfs/zfs.go @@ -210,8 +210,8 @@ func (d *Driver) Status() [][2]string { } } -// GetMetadata returns image/container metadata related to graph driver -func (d *Driver) GetMetadata(id string) (map[string]string, error) { +// Metadata returns image/container metadata related to graph driver +func (d *Driver) Metadata(id string) (map[string]string, error) { return nil, nil } diff --git a/storage/images.go b/images.go similarity index 97% rename from storage/images.go rename to images.go index 8476445bd..6d9a7b580 100644 --- a/storage/images.go +++ b/images.go @@ -249,7 +249,7 @@ func (r *imageStore) Create(id string, names []string, layer, metadata string) ( return image, err } -func (r *imageStore) GetMetadata(id string) (string, error) { +func (r *imageStore) Metadata(id string) (string, error) { if image, ok := r.lookup(id); ok { return image.Metadata, nil } @@ -331,7 +331,7 @@ func (r *imageStore) Exists(id string) bool { return ok } -func (r *imageStore) GetBigData(id, key string) ([]byte, error) { +func (r *imageStore) BigData(id, key string) ([]byte, error) { image, ok := r.lookup(id) if !ok { return nil, ErrImageUnknown @@ -339,7 +339,7 @@ func (r *imageStore) GetBigData(id, key string) ([]byte, error) { return ioutil.ReadFile(r.datapath(image.ID, key)) } -func (r *imageStore) GetBigDataSize(id, key string) (int64, error) { +func (r *imageStore) BigDataSize(id, key string) (int64, error) { image, ok := r.lookup(id) if !ok { return -1, ErrImageUnknown @@ -350,7 +350,7 @@ func (r *imageStore) GetBigDataSize(id, key string) (int64, error) { return -1, ErrSizeUnknown } -func (r *imageStore) GetBigDataNames(id string) ([]string, error) { +func (r *imageStore) BigDataNames(id string) ([]string, error) { image, ok := r.lookup(id) if !ok { return nil, ErrImageUnknown diff --git a/storage/layers.go b/layers.go similarity index 99% rename from storage/layers.go rename to layers.go index 0a50d7ade..1910de617 100644 --- a/storage/layers.go +++ b/layers.go @@ -520,7 +520,7 @@ func (r *layerStore) SetNames(id string, names []string) error { return ErrLayerUnknown } -func (r *layerStore) GetMetadata(id string) (string, error) { +func (r *layerStore) Metadata(id string) (string, error) { if layer, ok := r.lookup(id); ok { return layer.Metadata, nil } diff --git a/storage/lockfile.go b/lockfile.go similarity index 100% rename from storage/lockfile.go rename to lockfile.go diff --git a/storage/stat_mtim.go b/stat_mtim.go similarity index 100% rename from storage/stat_mtim.go rename to stat_mtim.go diff --git a/storage/stat_mtimespec.go b/stat_mtimespec.go similarity index 100% rename from storage/stat_mtimespec.go rename to stat_mtimespec.go diff --git a/storage/store.go b/store.go similarity index 84% rename from storage/store.go rename to store.go index 61e0f84e0..d297097f6 100644 --- a/storage/store.go +++ b/store.go @@ -74,8 +74,8 @@ type FileBasedStore interface { // MetadataStore wraps up methods for getting and setting metadata associated with IDs. type MetadataStore interface { - // GetMetadata reads metadata associated with an item with the specified ID. - GetMetadata(id string) (string, error) + // Metadata reads metadata associated with an item with the specified ID. + Metadata(id string) (string, error) // SetMetadata updates the metadata associated with the item with the specified ID. SetMetadata(id, metadata string) error @@ -88,17 +88,17 @@ type BigDataStore interface { // ID. SetBigData(id, key string, data []byte) error - // GetBigData retrieves a (potentially large) piece of data associated with + // BigData retrieves a (potentially large) piece of data associated with // this ID, if it has previously been set. - GetBigData(id, key string) ([]byte, error) + BigData(id, key string) ([]byte, error) - // GetBigDataSize retrieves the size of a (potentially large) piece of + // BigDataSize retrieves the size of a (potentially large) piece of // data associated with this ID, if it has previously been set. - GetBigDataSize(id, key string) (int64, error) + BigDataSize(id, key string) (int64, error) - // GetBigDataNames() returns a list of the names of previously-stored pieces of + // BigDataNames() returns a list of the names of previously-stored pieces of // data. - GetBigDataNames(id string) ([]string, error) + BigDataNames(id string) ([]string, error) } // A FlaggableStore can have flags set and cleared on items which it manages. @@ -136,28 +136,28 @@ type StoreOptions struct { // Store wraps up the various types of file-based stores that we use into a // singleton object that initializes and manages them all together. type Store interface { - // GetRunRoot, GetGraphRoot, GetGraphDriverName, and GetGraphOptions retrieve + // RunRoot, GraphRoot, GraphDriverName, and GraphOptions retrieve // settings that were passed to GetStore() when the object was created. - GetRunRoot() string - GetGraphRoot() string - GetGraphDriverName() string - GetGraphOptions() []string + RunRoot() string + GraphRoot() string + GraphDriverName() string + GraphOptions() []string - // GetGraphDriver obtains and returns a handle to the graph Driver object used + // GraphDriver obtains and returns a handle to the graph Driver object used // by the Store. - GetGraphDriver() (drivers.Driver, error) + GraphDriver() (drivers.Driver, error) - // GetLayerStore obtains and returns a handle to the layer store object used by + // LayerStore obtains and returns a handle to the layer store object used by // the Store. - GetLayerStore() (LayerStore, error) + LayerStore() (LayerStore, error) - // GetImageStore obtains and returns a handle to the image store object used by + // ImageStore obtains and returns a handle to the image store object used by // the Store. - GetImageStore() (ImageStore, error) + ImageStore() (ImageStore, error) - // GetContainerStore obtains and returns a handle to the container store object + // ContainerStore obtains and returns a handle to the container store object // used by the Store. - GetContainerStore() (ContainerStore, error) + ContainerStore() (ContainerStore, error) // CreateLayer creates a new layer in the underlying storage driver, optionally // having the specified ID (one will be assigned if none is specified), with @@ -186,14 +186,14 @@ type Store interface { // library stores for the convenience of its caller. CreateContainer(id string, names []string, image, layer, metadata string, options *ContainerOptions) (*Container, error) - // GetMetadata retrieves the metadata which is associated with a layer, image, + // Metadata retrieves the metadata which is associated with a layer, image, // or container (whichever the passed-in ID refers to). - GetMetadata(id string) (string, error) + Metadata(id string) (string, error) // SetMetadata updates the metadata which is associated with a layer, image, or // container (whichever the passed-in ID refers to) to match the specified - // value. The metadata value can be retrieved at any time using GetMetadata, - // or using GetLayer, GetImage, or GetContainer and reading the object directly. + // value. The metadata value can be retrieved at any time using Metadata, + // or using Layer, Image, or Container and reading the object directly. SetMetadata(id, metadata string) error // Exists checks if there is a layer, image, or container which has the @@ -273,8 +273,8 @@ type Store interface { // Containers returns a list of the currently known containers. Containers() ([]Container, error) - // GetNames returns the list of names for a layer, image, or container. - GetNames(id string) ([]string, error) + // Names returns the list of names for a layer, image, or container. + Names(id string) ([]string, error) // SetNames changes the list of names for a layer, image, or container. SetNames(id string, names []string) error @@ -283,13 +283,13 @@ type Store interface { // data associated with an image. ListImageBigData(id string) ([]string, error) - // GetImageBigData retrieves a (possibly large) chunk of named data associated + // ImageBigData retrieves a (possibly large) chunk of named data associated // with an image. - GetImageBigData(id, key string) ([]byte, error) + ImageBigData(id, key string) ([]byte, error) - // GetImageBigDataSize retrieves the size of a (possibly large) chunk + // ImageBigDataSize retrieves the size of a (possibly large) chunk // of named data associated with an image. - GetImageBigDataSize(id, key string) (int64, error) + ImageBigDataSize(id, key string) (int64, error) // SetImageBigData stores a (possibly large) chunk of named data associated // with an image. @@ -299,67 +299,67 @@ type Store interface { // named data associated with a container. ListContainerBigData(id string) ([]string, error) - // GetContainerBigData retrieves a (possibly large) chunk of named data + // ContainerBigData retrieves a (possibly large) chunk of named data // associated with a container. - GetContainerBigData(id, key string) ([]byte, error) + ContainerBigData(id, key string) ([]byte, error) - // GetContainerBigDataSize retrieves the size of a (possibly large) + // ContainerBigDataSize retrieves the size of a (possibly large) // chunk of named data associated with a container. - GetContainerBigDataSize(id, key string) (int64, error) + ContainerBigDataSize(id, key string) (int64, error) // SetContainerBigData stores a (possibly large) chunk of named data // associated with a container. SetContainerBigData(id, key string, data []byte) error - // GetLayer returns a specific layer. - GetLayer(id string) (*Layer, error) + // Layer returns a specific layer. + Layer(id string) (*Layer, error) - // GetImage returns a specific image. - GetImage(id string) (*Image, error) + // Image returns a specific image. + Image(id string) (*Image, error) - // GetImagesByTopLayer returns a list of images which reference the specified + // ImagesByTopLayer returns a list of images which reference the specified // layer as their top layer. They will have different IDs and names // and may have different metadata, big data items, and flags. - GetImagesByTopLayer(id string) ([]*Image, error) + ImagesByTopLayer(id string) ([]*Image, error) - // GetContainer returns a specific container. - GetContainer(id string) (*Container, error) + // Container returns a specific container. + Container(id string) (*Container, error) - // GetContainerByLayer returns a specific container based on its layer ID or + // ContainerByLayer returns a specific container based on its layer ID or // name. - GetContainerByLayer(id string) (*Container, error) + ContainerByLayer(id string) (*Container, error) - // GetContainerDirectory returns a path of a directory which the caller + // ContainerDirectory returns a path of a directory which the caller // can use to store data, specific to the container, which the library // does not directly manage. The directory will be deleted when the // container is deleted. - GetContainerDirectory(id string) (string, error) + ContainerDirectory(id string) (string, error) // SetContainerDirectoryFile is a convenience function which stores // a piece of data in the specified file relative to the container's // directory. SetContainerDirectoryFile(id, file string, data []byte) error - // GetFromContainerDirectory is a convenience function which reads + // FromContainerDirectory is a convenience function which reads // the contents of the specified file relative to the container's // directory. - GetFromContainerDirectory(id, file string) ([]byte, error) + FromContainerDirectory(id, file string) ([]byte, error) - // GetContainerRunDirectory returns a path of a directory which the + // ContainerRunDirectory returns a path of a directory which the // caller can use to store data, specific to the container, which the // library does not directly manage. The directory will be deleted // when the host system is restarted. - GetContainerRunDirectory(id string) (string, error) + ContainerRunDirectory(id string) (string, error) // SetContainerRunDirectoryFile is a convenience function which stores // a piece of data in the specified file relative to the container's // run directory. SetContainerRunDirectoryFile(id, file string, data []byte) error - // GetFromContainerRunDirectory is a convenience function which reads + // FromContainerRunDirectory is a convenience function which reads // the contents of the specified file relative to the container's run // directory. - GetFromContainerRunDirectory(id, file string) ([]byte, error) + FromContainerRunDirectory(id, file string) ([]byte, error) // Lookup returns the ID of a layer, image, or container with the specified // name or ID. @@ -482,24 +482,24 @@ func copyIDMap(idmap []idtools.IDMap) []idtools.IDMap { return nil } -func (s *store) GetRunRoot() string { +func (s *store) RunRoot() string { return s.runRoot } -func (s *store) GetGraphDriverName() string { +func (s *store) GraphDriverName() string { return s.graphDriverName } -func (s *store) GetGraphRoot() string { +func (s *store) GraphRoot() string { return s.graphRoot } -func (s *store) GetGraphOptions() []string { +func (s *store) GraphOptions() []string { return s.graphOptions } func (s *store) load() error { - driver, err := s.GetGraphDriver() + driver, err := s.GraphDriver() if err != nil { return err } @@ -507,7 +507,7 @@ func (s *store) load() error { s.graphDriverName = driver.String() driverPrefix := s.graphDriverName + "-" - rls, err := s.GetLayerStore() + rls, err := s.LayerStore() if err != nil { return err } @@ -551,7 +551,7 @@ func (s *store) getGraphDriver() (drivers.Driver, error) { return driver, nil } -func (s *store) GetGraphDriver() (drivers.Driver, error) { +func (s *store) GraphDriver() (drivers.Driver, error) { s.graphLock.Lock() defer s.graphLock.Unlock() if s.graphLock.TouchedSince(s.lastLoaded) { @@ -562,7 +562,7 @@ func (s *store) GetGraphDriver() (drivers.Driver, error) { return s.getGraphDriver() } -func (s *store) GetLayerStore() (LayerStore, error) { +func (s *store) LayerStore() (LayerStore, error) { s.graphLock.Lock() defer s.graphLock.Unlock() if s.graphLock.TouchedSince(s.lastLoaded) { @@ -594,14 +594,14 @@ func (s *store) GetLayerStore() (LayerStore, error) { return s.layerStore, nil } -func (s *store) GetImageStore() (ImageStore, error) { +func (s *store) ImageStore() (ImageStore, error) { if s.imageStore != nil { return s.imageStore, nil } return nil, ErrLoadError } -func (s *store) GetContainerStore() (ContainerStore, error) { +func (s *store) ContainerStore() (ContainerStore, error) { if s.containerStore != nil { return s.containerStore, nil } @@ -609,15 +609,15 @@ func (s *store) GetContainerStore() (ContainerStore, error) { } func (s *store) PutLayer(id, parent string, names []string, mountLabel string, writeable bool, diff archive.Reader) (*Layer, int64, error) { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, -1, err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return nil, -1, err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return nil, -1, err } @@ -668,15 +668,15 @@ func (s *store) CreateLayer(id, parent string, names []string, mountLabel string } func (s *store) CreateImage(id string, names []string, layer, metadata string, options *ImageOptions) (*Image, error) { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return nil, err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return nil, err } @@ -714,15 +714,15 @@ func (s *store) CreateImage(id string, names []string, layer, metadata string, o } func (s *store) CreateContainer(id string, names []string, image, layer, metadata string, options *ContainerOptions) (*Container, error) { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return nil, err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return nil, err } @@ -775,15 +775,15 @@ func (s *store) CreateContainer(id string, names []string, image, layer, metadat } func (s *store) SetMetadata(id, metadata string) error { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return err } @@ -819,16 +819,16 @@ func (s *store) SetMetadata(id, metadata string) error { return ErrNotAnID } -func (s *store) GetMetadata(id string) (string, error) { - rlstore, err := s.GetLayerStore() +func (s *store) Metadata(id string) (string, error) { + rlstore, err := s.LayerStore() if err != nil { return "", err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return "", err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return "", err } @@ -850,23 +850,23 @@ func (s *store) GetMetadata(id string) (string, error) { } if rlstore.Exists(id) { - return rlstore.GetMetadata(id) + return rlstore.Metadata(id) } if ristore.Exists(id) { - return ristore.GetMetadata(id) + return ristore.Metadata(id) } if rcstore.Exists(id) { - return rcstore.GetMetadata(id) + return rcstore.Metadata(id) } return "", ErrNotAnID } func (s *store) ListImageBigData(id string) ([]string, error) { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return nil, err } @@ -882,15 +882,15 @@ func (s *store) ListImageBigData(id string) ([]string, error) { ristore.Load() } - return ristore.GetBigDataNames(id) + return ristore.BigDataNames(id) } -func (s *store) GetImageBigDataSize(id, key string) (int64, error) { - rlstore, err := s.GetLayerStore() +func (s *store) ImageBigDataSize(id, key string) (int64, error) { + rlstore, err := s.LayerStore() if err != nil { return -1, err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return -1, err } @@ -906,15 +906,15 @@ func (s *store) GetImageBigDataSize(id, key string) (int64, error) { ristore.Load() } - return ristore.GetBigDataSize(id, key) + return ristore.BigDataSize(id, key) } -func (s *store) GetImageBigData(id, key string) ([]byte, error) { - rlstore, err := s.GetLayerStore() +func (s *store) ImageBigData(id, key string) ([]byte, error) { + rlstore, err := s.LayerStore() if err != nil { return nil, err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return nil, err } @@ -930,15 +930,15 @@ func (s *store) GetImageBigData(id, key string) ([]byte, error) { ristore.Load() } - return ristore.GetBigData(id, key) + return ristore.BigData(id, key) } func (s *store) SetImageBigData(id, key string, data []byte) error { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return err } @@ -958,15 +958,15 @@ func (s *store) SetImageBigData(id, key string, data []byte) error { } func (s *store) ListContainerBigData(id string) ([]string, error) { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return nil, err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return nil, err } @@ -987,19 +987,19 @@ func (s *store) ListContainerBigData(id string) ([]string, error) { rcstore.Load() } - return rcstore.GetBigDataNames(id) + return rcstore.BigDataNames(id) } -func (s *store) GetContainerBigDataSize(id, key string) (int64, error) { - rlstore, err := s.GetLayerStore() +func (s *store) ContainerBigDataSize(id, key string) (int64, error) { + rlstore, err := s.LayerStore() if err != nil { return -1, err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return -1, err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return -1, err } @@ -1020,19 +1020,19 @@ func (s *store) GetContainerBigDataSize(id, key string) (int64, error) { rcstore.Load() } - return rcstore.GetBigDataSize(id, key) + return rcstore.BigDataSize(id, key) } -func (s *store) GetContainerBigData(id, key string) ([]byte, error) { - rlstore, err := s.GetLayerStore() +func (s *store) ContainerBigData(id, key string) ([]byte, error) { + rlstore, err := s.LayerStore() if err != nil { return nil, err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return nil, err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return nil, err } @@ -1053,19 +1053,19 @@ func (s *store) GetContainerBigData(id, key string) ([]byte, error) { rcstore.Load() } - return rcstore.GetBigData(id, key) + return rcstore.BigData(id, key) } func (s *store) SetContainerBigData(id, key string, data []byte) error { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return err } @@ -1090,15 +1090,15 @@ func (s *store) SetContainerBigData(id, key string, data []byte) error { } func (s *store) Exists(id string) bool { - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return false } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return false } - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return false } @@ -1129,15 +1129,15 @@ func (s *store) Exists(id string) bool { } func (s *store) SetNames(id string, names []string) error { - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return err } - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return err } @@ -1179,16 +1179,16 @@ func (s *store) SetNames(id string, names []string) error { return ErrLayerUnknown } -func (s *store) GetNames(id string) ([]string, error) { - rcstore, err := s.GetContainerStore() +func (s *store) Names(id string) ([]string, error) { + rcstore, err := s.ContainerStore() if err != nil { return nil, err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return nil, err } - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } @@ -1222,15 +1222,15 @@ func (s *store) GetNames(id string) ([]string, error) { } func (s *store) Lookup(name string) (string, error) { - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return "", err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return "", err } - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return "", err } @@ -1264,15 +1264,15 @@ func (s *store) Lookup(name string) (string, error) { } func (s *store) DeleteLayer(id string) error { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return err } @@ -1332,15 +1332,15 @@ func (s *store) DeleteLayer(id string) error { } func (s *store) DeleteImage(id string, commit bool) (layers []string, err error) { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return nil, err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return nil, err } @@ -1452,15 +1452,15 @@ func (s *store) DeleteImage(id string, commit bool) (layers []string, err error) } func (s *store) DeleteContainer(id string) error { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return err } @@ -1493,11 +1493,11 @@ func (s *store) DeleteContainer(id string) error { return err } middleDir := s.graphDriverName + "-containers" - gcpath := filepath.Join(s.GetGraphRoot(), middleDir, container.ID) + gcpath := filepath.Join(s.GraphRoot(), middleDir, container.ID) if err = os.RemoveAll(gcpath); err != nil { return err } - rcpath := filepath.Join(s.GetRunRoot(), middleDir, container.ID) + rcpath := filepath.Join(s.RunRoot(), middleDir, container.ID) if err = os.RemoveAll(rcpath); err != nil { return err } @@ -1510,15 +1510,15 @@ func (s *store) DeleteContainer(id string) error { } func (s *store) Delete(id string) error { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return err } @@ -1551,11 +1551,11 @@ func (s *store) Delete(id string) error { return err } middleDir := s.graphDriverName + "-containers" - gcpath := filepath.Join(s.GetGraphRoot(), middleDir, container.ID, "userdata") + gcpath := filepath.Join(s.GraphRoot(), middleDir, container.ID, "userdata") if err = os.RemoveAll(gcpath); err != nil { return err } - rcpath := filepath.Join(s.GetRunRoot(), middleDir, container.ID, "userdata") + rcpath := filepath.Join(s.RunRoot(), middleDir, container.ID, "userdata") if err = os.RemoveAll(rcpath); err != nil { return err } @@ -1576,15 +1576,15 @@ func (s *store) Delete(id string) error { } func (s *store) Wipe() error { - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return err } - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return err } @@ -1618,7 +1618,7 @@ func (s *store) Wipe() error { } func (s *store) Status() ([][2]string, error) { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } @@ -1634,11 +1634,11 @@ func (s *store) Version() ([][2]string, error) { } func (s *store) Mount(id, mountLabel string) (string, error) { - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return "", err } - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return "", err } @@ -1662,11 +1662,11 @@ func (s *store) Mount(id, mountLabel string) (string, error) { } func (s *store) Unmount(id string) error { - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return err } - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return err } @@ -1690,7 +1690,7 @@ func (s *store) Unmount(id string) error { } func (s *store) Changes(from, to string) ([]archive.Change, error) { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } @@ -1705,7 +1705,7 @@ func (s *store) Changes(from, to string) ([]archive.Change, error) { } func (s *store) DiffSize(from, to string) (int64, error) { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return -1, err } @@ -1720,7 +1720,7 @@ func (s *store) DiffSize(from, to string) (int64, error) { } func (s *store) Diff(from, to string) (io.ReadCloser, error) { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } @@ -1735,7 +1735,7 @@ func (s *store) Diff(from, to string) (io.ReadCloser, error) { } func (s *store) ApplyDiff(to string, diff archive.Reader) (int64, error) { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return -1, err } @@ -1750,7 +1750,7 @@ func (s *store) ApplyDiff(to string, diff archive.Reader) (int64, error) { } func (s *store) Layers() ([]Layer, error) { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } @@ -1765,11 +1765,11 @@ func (s *store) Layers() ([]Layer, error) { } func (s *store) Images() ([]Image, error) { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return nil, err } @@ -1789,15 +1789,15 @@ func (s *store) Images() ([]Image, error) { } func (s *store) Containers() ([]Container, error) { - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return nil, err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return nil, err } @@ -1821,8 +1821,8 @@ func (s *store) Containers() ([]Container, error) { return rcstore.Containers() } -func (s *store) GetLayer(id string) (*Layer, error) { - rlstore, err := s.GetLayerStore() +func (s *store) Layer(id string) (*Layer, error) { + rlstore, err := s.LayerStore() if err != nil { return nil, err } @@ -1836,12 +1836,12 @@ func (s *store) GetLayer(id string) (*Layer, error) { return rlstore.Get(id) } -func (s *store) GetImage(id string) (*Image, error) { - ristore, err := s.GetImageStore() +func (s *store) Image(id string) (*Image, error) { + ristore, err := s.ImageStore() if err != nil { return nil, err } - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } @@ -1860,12 +1860,12 @@ func (s *store) GetImage(id string) (*Image, error) { return ristore.Get(id) } -func (s *store) GetImagesByTopLayer(id string) ([]*Image, error) { - ristore, err := s.GetImageStore() +func (s *store) ImagesByTopLayer(id string) ([]*Image, error) { + ristore, err := s.ImageStore() if err != nil { return nil, err } - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } @@ -1899,16 +1899,16 @@ func (s *store) GetImagesByTopLayer(id string) ([]*Image, error) { return images, nil } -func (s *store) GetContainer(id string) (*Container, error) { - ristore, err := s.GetImageStore() +func (s *store) Container(id string) (*Container, error) { + ristore, err := s.ImageStore() if err != nil { return nil, err } - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return nil, err } @@ -1932,16 +1932,16 @@ func (s *store) GetContainer(id string) (*Container, error) { return rcstore.Get(id) } -func (s *store) GetContainerByLayer(id string) (*Container, error) { - ristore, err := s.GetImageStore() +func (s *store) ContainerByLayer(id string) (*Container, error) { + ristore, err := s.ImageStore() if err != nil { return nil, err } - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return nil, err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return nil, err } @@ -1979,16 +1979,16 @@ func (s *store) GetContainerByLayer(id string) (*Container, error) { return nil, ErrContainerUnknown } -func (s *store) GetContainerDirectory(id string) (string, error) { - rlstore, err := s.GetLayerStore() +func (s *store) ContainerDirectory(id string) (string, error) { + rlstore, err := s.LayerStore() if err != nil { return "", err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return "", err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return "", err } @@ -2015,23 +2015,23 @@ func (s *store) GetContainerDirectory(id string) (string, error) { } middleDir := s.graphDriverName + "-containers" - gcpath := filepath.Join(s.GetGraphRoot(), middleDir, id, "userdata") + gcpath := filepath.Join(s.GraphRoot(), middleDir, id, "userdata") if err := os.MkdirAll(gcpath, 0700); err != nil { return "", err } return gcpath, nil } -func (s *store) GetContainerRunDirectory(id string) (string, error) { - rlstore, err := s.GetLayerStore() +func (s *store) ContainerRunDirectory(id string) (string, error) { + rlstore, err := s.LayerStore() if err != nil { return "", err } - ristore, err := s.GetImageStore() + ristore, err := s.ImageStore() if err != nil { return "", err } - rcstore, err := s.GetContainerStore() + rcstore, err := s.ContainerStore() if err != nil { return "", err } @@ -2058,7 +2058,7 @@ func (s *store) GetContainerRunDirectory(id string) (string, error) { } middleDir := s.graphDriverName + "-containers" - rcpath := filepath.Join(s.GetRunRoot(), middleDir, id, "userdata") + rcpath := filepath.Join(s.RunRoot(), middleDir, id, "userdata") if err := os.MkdirAll(rcpath, 0700); err != nil { return "", err } @@ -2066,7 +2066,7 @@ func (s *store) GetContainerRunDirectory(id string) (string, error) { } func (s *store) SetContainerDirectoryFile(id, file string, data []byte) error { - dir, err := s.GetContainerDirectory(id) + dir, err := s.ContainerDirectory(id) if err != nil { return err } @@ -2077,8 +2077,8 @@ func (s *store) SetContainerDirectoryFile(id, file string, data []byte) error { return ioutils.AtomicWriteFile(filepath.Join(dir, file), data, 0600) } -func (s *store) GetFromContainerDirectory(id, file string) ([]byte, error) { - dir, err := s.GetContainerDirectory(id) +func (s *store) FromContainerDirectory(id, file string) ([]byte, error) { + dir, err := s.ContainerDirectory(id) if err != nil { return nil, err } @@ -2086,7 +2086,7 @@ func (s *store) GetFromContainerDirectory(id, file string) ([]byte, error) { } func (s *store) SetContainerRunDirectoryFile(id, file string, data []byte) error { - dir, err := s.GetContainerRunDirectory(id) + dir, err := s.ContainerRunDirectory(id) if err != nil { return err } @@ -2097,8 +2097,8 @@ func (s *store) SetContainerRunDirectoryFile(id, file string, data []byte) error return ioutils.AtomicWriteFile(filepath.Join(dir, file), data, 0600) } -func (s *store) GetFromContainerRunDirectory(id, file string) ([]byte, error) { - dir, err := s.GetContainerRunDirectory(id) +func (s *store) FromContainerRunDirectory(id, file string) ([]byte, error) { + dir, err := s.ContainerRunDirectory(id) if err != nil { return nil, err } @@ -2109,7 +2109,7 @@ func (s *store) Shutdown(force bool) ([]string, error) { mounted := []string{} modified := false - rlstore, err := s.GetLayerStore() + rlstore, err := s.LayerStore() if err != nil { return mounted, err }