Example #1
0
func (f *ManifestFile) Read() error {
	if f.Ref == "" {
		return fmt.Errorf("No reference to read.")
	}

	i, err := data.NewMainDataIndex()
	if err != nil {
		return err
	}

	rdr, err := i.BlobStore.Get(data.BlobKey(f.Ref))
	if err != nil {
		return err
	}

	// read the blob
	f.buffer, err = ioutil.ReadAll(rdr)
	if err != nil {
		return err
	}

	return nil
}
Example #2
0
func blobUrl(ref string) string {
	return mainDataIndex.BlobStore.Url(data.BlobKey(ref))
}