Example #1
0
func TestBlobStore(t *testing.T) {
	dir, err := ioutil.TempDir("", tstprefix)
	if err != nil {
		t.Fatalf("error creating tempdir: %v", err)
	}
	defer os.RemoveAll(dir)
	ds := NewStore(dir)
	for _, valueStr := range []string{
		"I am a manually placed object",
	} {
		ds.stores[blobType].Write(types.NewHashSHA256([]byte(valueStr)).String(), []byte(valueStr))
	}

	ds.Dump(false)
}
Example #2
0
func (r Remote) Hash() string {
	return types.NewHashSHA256([]byte(r.Name)).String()
}