func isTip(b *blob.Blob) bool { objref := b.ObjectRef() tip, err := cl.ObjectTip(objref) if err != nil { return false } return b.Ref() == tip.Ref() }
func (db *Dbase) writeBlob(b *blob.Blob) (err error) { ref := b.Ref() p := path.Join(db.location, ref) f, err := os.Create(p) if err != nil { return err } defer f.Close() _, err = f.Write(b.Content()) return err }
func IsJson(b *blob.Blob) bool { if b.Type() == "" { return false } return true }
func verifyBlob(sum string, b *blob.Blob) (err error) { if hex.EncodeToString(b.Sum()) != sum { err = errors.New("blobdb: blob name does not match hash of its content.") } return }
func (o *object) Add(b *blob.Blob) { o.versions = append(o.versions, b.Ref()) t, err := b.Timestamp() util.Check(err) o.tms = append(o.tms, t) }