// RemoveBlob removes a blob from the filesystem
437821
func (v Vacuum) RemoveBlob(dgst string) error {
	d, err := digest.Parse(dgst)
	if err != nil {
		return err
	}

	blobPath, err := pathFor(blobPathSpec{digest: d})
	if err != nil {
		return err
	}

	dcontext.GetLogger(v.ctx).Infof("Deleting blob: %s", blobPath)

	err = v.driver.Delete(v.ctx, blobPath)
	if err != nil {
		return err
	}

	return nil
}
526383
func RemoveFile(fp string) {
	if err := os.Remove(fp); err != nil {
		glog.Warningf("unable to remove file %s: %v", fp, err)
	}
}
846986
func (s *Snapshotter) Remove(ctx context.Context, key string) error {
	_, blob, err := s.GetBlob(ctx, key)
	if err != nil {
		return err
	}

	blobs, err := s.opt.MetadataStore.Search(index(blob))
	if err != nil {
		return err
	}

	if err := s.SnapshotterBase.Remove(ctx, key); err != nil {
		return err
	}

	if len(blobs) == 1 && blobs[0].ID() == key { // last snapshot
		if err := s.opt.Content.Delete(ctx, blob); err != nil {
			logrus.Errorf("failed to delete blob %v: %+v", blob, err)
		}
	}
	return nil
}
101262
func (w *filePoller) Remove(name string) error {
	w.mu.Lock()
	defer w.mu.Unlock()
	return w.remove(name)
}
1200206
func (s *PutFileOutput) SetBlobId(v string) *PutFileOutput {
	s.BlobId = &v
	return s
}
1091271
func (ss *Snapshot) remove() error {
	if err := os.Remove(ss.Path); err != nil {
		return err
	}
	return nil
}
1172811
func (s *Snapshotter) SetBlob(ctx context.Context, key string, diffID, blobsum digest.Digest) error {
	info, err := s.opt.Content.Info(ctx, blobsum)
	if err != nil {
		return err
	}
	if _, ok := info.Labels["containerd.io/uncompressed"]; !ok {
		labels := map[string]string{
			"containerd.io/uncompressed": diffID.String(),
		}
		if _, err := s.opt.Content.Update(ctx, content.Info{
			Digest: blobsum,
			Labels: labels,
		}, "labels.containerd.io/uncompressed"); err != nil {
			return err
		}
	}
	md, _ := s.opt.MetadataStore.Get(key)

	v, err := metadata.NewValue(DiffPair{DiffID: diffID, Blobsum: blobsum})
	if err != nil {
		return err
	}
	v.Index = index(blobsum)

	return md.Update(func(b *bolt.Bucket) error {
		return md.SetValue(b, blobKey, v)
	})
}
467871
func (c container) Blob(name string) Blob {
	return blob{c.Container.GetBlobReference(name)}
}
1294848
func AzureBlobstoreDelete(config AzureBlobstoreConfig, blobs []azblob.BlobItem) error {
	if *DryRunFlag {
		for _, blob := range blobs {
			fmt.Printf("would delete %s (%s) from %s/%s\n", blob.Name, blob.Properties.LastModified, config.Account, config.Container)
		}
		return nil
	}
	// Create an authenticated client against the Azure cloud
	credential := azblob.NewSharedKeyCredential(config.Account, config.Token)
	pipeline := azblob.NewPipeline(credential, azblob.PipelineOptions{})

	u, _ := url.Parse(fmt.Sprintf("https://%s.blob.core.windows.net", config.Account))
	service := azblob.NewServiceURL(*u, pipeline)

	container := service.NewContainerURL(config.Container)

	// Iterate over the blobs and delete them
	for _, blob := range blobs {
		blockblob := container.NewBlockBlobURL(blob.Name)
		if _, err := blockblob.Delete(context.Background(), azblob.DeleteSnapshotsOptionInclude, azblob.BlobAccessConditions{}); err != nil {
			return err
		}
	}
	return nil
}
1325789
func (fs *FS) Remove(filename string) (err error) {
	fs.log.CDebugf(fs.ctx, "Remove %s", filename)
	defer func() {
		fs.deferLog.CDebugf(fs.ctx, "Remove done: %+v", err)
		err = translateErr(err)
	}()

	if err := fs.requireNonEmpty(); err != nil {
		return err
	}

	parent, _, base, err := fs.lookupParent(filename)
	if err != nil {
		return err
	}

	_, ei, err := fs.config.KBFSOps().Lookup(fs.ctx, parent, base)
	if err != nil {
		return err
	}

	if ei.Type == data.Dir {
		return fs.config.KBFSOps().RemoveDir(fs.ctx, parent, base)
	}
	return fs.config.KBFSOps().RemoveEntry(fs.ctx, parent, base)
}
1023318
func (c *xContext) JSONBlob(b []byte, codes ...int) (err error) {
	c.response.Header().Set(HeaderContentType, MIMEApplicationJSONCharsetUTF8)
	err = c.Blob(b, codes...)
	return
}
685244
func (c *IO) ResolveBlob(objectId string) (string, error) {
	var v IOResolveBlobParams
	v.ObjectId = objectId
	return c.ResolveBlobWithParams(&v)
}
124683
func (sto *unionStorage) ReceiveBlob(ctx context.Context, br blob.Ref, src io.Reader) (sb blob.SizedRef, err error) {
	return blob.SizedRef{}, blobserver.ErrReadonly
}
469037
func (r *Rollsum32Base) RemoveByte(b byte, length int) {
	r.a -= uint32(b)
	r.b -= uint32(uint(length) * uint(b))
}
36563
func (l *Literal) Blob() ([]byte, error) {
	if l.t != Blob {
		return nil, fmt.Errorf("literal.Blob: literal is of type %v; cannot be converted to a []byte", l.t)
	}
	return l.v.([]byte), nil
}
880287
func (c *Client) RemoveVolume(name string) error {
	return c.RemoveVolumeWithOptions(RemoveVolumeOptions{Name: name})
}
795876
func (v *RsyncVolume) RemoveSnapshot(label string) error {
	v.Lock()
	defer v.Unlock()
	label = v.rawSnapshotLabel(label)
	dest := v.snapshotPath(label)
	if exists, _ := volume.IsDir(dest); !exists {
		return volume.ErrSnapshotDoesNotExist
	}
	if err := os.RemoveAll(filepath.Join(v.driver.MetadataDir(), label)); err != nil {
		return err
	} else if err := os.RemoveAll(dest); err != nil {
		glog.Errorf("Could not remove snapshot %s: %s", label, err)
		return volume.ErrRemovingSnapshot
	}
	return nil
}