ObjectDescription is now more exact, only exposes necessary details.

master
Frederick F. Kautz IV 10 years ago
parent 8ff7fea4ac
commit dd7cd11c9c
  1. 3
      pkgs/storage/appendstorage/append_storage.go
  2. 5
      pkgs/storage/encodedstorage/encoded_storage.go
  3. 3
      pkgs/storage/fsstorage/fs_storage.go
  4. 3
      pkgs/storage/storage.go

@ -139,8 +139,7 @@ func (aStorage *appendStorage) List() ([]storage.ObjectDescription, error) {
var objectDescription storage.ObjectDescription
objectDescription.Name = objectName
objectDescription.Md5sum = ""
objectDescription.Hash = ""
objectDescription.Protectionlevel = ""
objectDescription.Murmur3 = ""
objectDescList = append(objectDescList, objectDescription)
}
if len(objectDescList) == 0 {

@ -120,11 +120,10 @@ func (eStorage *encodedStorage) List() ([]storage.ObjectDescription, error) {
var objectDescList []storage.ObjectDescription
for objectName, objectEntry := range eStorage.objects {
var objectDescription storage.ObjectDescription
protectionLevel := strconv.Itoa(objectEntry.Encoderparams.K) + "," + strconv.Itoa(objectEntry.Encoderparams.M)
//protectionLevel := strconv.Itoa(objectEntry.Encoderparams.K) + "," + strconv.Itoa(objectEntry.Encoderparams.M)
objectDescription.Name = objectName
objectDescription.Md5sum = hex.EncodeToString(objectEntry.Md5sum)
objectDescription.Hash = strconv.FormatUint(objectEntry.Murmurhash, 16)
objectDescription.Protectionlevel = protectionLevel
objectDescription.Murmur3 = strconv.FormatUint(objectEntry.Murmurhash, 16)
objectDescList = append(objectDescList, objectDescription)
}
if len(objectDescList) == 0 {

@ -84,8 +84,7 @@ func (fsStorage *fileSystemStorage) List() ([]storage.ObjectDescription, error)
var objectDescription storage.ObjectDescription
objectDescription.Name = objectName
objectDescription.Md5sum = hex.EncodeToString(objectEntry.Md5sum)
objectDescription.Hash = strconv.FormatUint(objectEntry.Murmurhash, 16)
objectDescription.Protectionlevel = ""
objectDescription.Murmur3 = strconv.FormatUint(objectEntry.Murmurhash, 16)
objectDescList = append(objectDescList, objectDescription)
}
if len(objectDescList) == 0 {

@ -12,6 +12,5 @@ type ObjectStorage interface {
type ObjectDescription struct {
Name string
Md5sum string
Protectionlevel string
Hash string
Murmur3 string
}

Loading…
Cancel
Save