Rename backend subdir 'blobs' to 'data'

This commit is contained in:
Alexander Neumann
2014-11-16 13:22:19 +01:00
parent b403769ae8
commit 804cebde67
8 changed files with 22 additions and 31 deletions

View File

@@ -35,14 +35,14 @@ func commandCat(be backend.Server, key *khepri.Key, args []string) error {
switch tpe {
case "blob":
// try id
data, err := ch.Load(backend.Blob, id)
data, err := ch.Load(backend.Data, id)
if err == nil {
_, err = os.Stdout.Write(data)
return err
}
// try storage id
buf, err := be.Get(backend.Blob, id)
buf, err := be.Get(backend.Data, id)
if err != nil {
return err
}

View File

@@ -10,7 +10,7 @@ import (
func commandList(be backend.Server, key *khepri.Key, args []string) error {
if len(args) != 1 {
return errors.New("usage: list [blobs|trees|snapshots|keys|locks]")
return errors.New("usage: list [data|trees|snapshots|keys|locks]")
}
var (
@@ -18,8 +18,8 @@ func commandList(be backend.Server, key *khepri.Key, args []string) error {
each func(backend.Server, backend.Type, func(backend.ID, []byte, error)) error = backend.Each
)
switch args[0] {
case "blobs":
t = backend.Blob
case "data":
t = backend.Data
each = key.Each
case "trees":
t = backend.Tree
@@ -35,7 +35,7 @@ func commandList(be backend.Server, key *khepri.Key, args []string) error {
}
return each(be, t, func(id backend.ID, data []byte, err error) {
if t == backend.Blob || t == backend.Tree {
if t == backend.Data || t == backend.Tree {
fmt.Printf("%s %s\n", id, backend.Hash(data))
} else {
fmt.Printf("%s\n", id)