memory

package
v0.0.0-...-21f2861 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2014 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package memory registers the "memory" blobserver storage type, storing blobs in an in-memory map.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage is an in-memory implementation of the blobserver Storage interface. It also includes other convenience methods used by tests.

func (*Storage) BlobContents

func (s *Storage) BlobContents(br blob.Ref) (contents string, ok bool)

BlobContents returns as a string the contents of the blob br.

func (*Storage) BlobrefStrings

func (s *Storage) BlobrefStrings() []string

BlobrefStrings returns the sorted stringified blobrefs stored in s.

func (*Storage) EnumerateBlobs

func (s *Storage) EnumerateBlobs(ctx *context.Context, dest chan<- blob.SizedRef, after string, limit int) error

func (*Storage) Fetch

func (s *Storage) Fetch(ref blob.Ref) (file io.ReadCloser, size uint32, err error)

func (*Storage) NumBlobs

func (s *Storage) NumBlobs() int

NumBlobs returns the number of blobs stored in s.

func (*Storage) ReceiveBlob

func (s *Storage) ReceiveBlob(br blob.Ref, source io.Reader) (blob.SizedRef, error)

func (*Storage) RemoveBlobs

func (s *Storage) RemoveBlobs(blobs []blob.Ref) error

func (*Storage) StatBlobs

func (s *Storage) StatBlobs(dest chan<- blob.SizedRef, blobs []blob.Ref) error

func (*Storage) Stats

func (s *Storage) Stats() (blobsFetched, bytesFetched int64)

Stats returns the number of blobs and number of bytes that were fetched from s.

func (*Storage) SubFetch

func (s *Storage) SubFetch(ref blob.Ref, offset, length int64) (io.ReadCloser, error)

func (*Storage) SumBlobSize

func (s *Storage) SumBlobSize() int64

SumBlobSize returns the total size in bytes of all the blobs in s.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL