Move storage package to use Digest type

Mostly, we've made superficial changes to the storage package to start using
the Digest type. Many of the exported interface methods have been changed to
reflect this in addition to changes in the way layer uploads will be initiated.

Further work here is necessary but will come with a separate PR.
This commit is contained in:
Stephen J Day 2014-11-19 14:39:32 -08:00
parent 3cfe9aede5
commit 1a508d67d9
8 changed files with 156 additions and 309 deletions

View file

@ -1,6 +1,10 @@
package storage
import "testing"
import (
"testing"
"github.com/docker/docker-registry/digest"
)
func TestPathMapper(t *testing.T) {
pm := &pathMapper{
@ -15,13 +19,13 @@ func TestPathMapper(t *testing.T) {
{
spec: layerLinkPathSpec{
name: "foo/bar",
tarSum: "tarsum.v1+test:abcdef",
digest: digest.Digest("tarsum.v1+test:abcdef"),
},
expected: "/pathmapper-test/repositories/foo/bar/layers/tarsum/v1/test/abcdef",
},
{
spec: layerIndexLinkPathSpec{
tarSum: "tarsum.v1+test:abcdef",
digest: digest.Digest("tarsum.v1+test:abcdef"),
},
expected: "/pathmapper-test/layerindex/tarsum/v1/test/abcdef",
},