Documentation ¶
Index ¶
- Variables
- type Store
- func (store *Store) EnsureIndex(ctx context.Context) (err error)
- func (store *Store) Read(ctx context.Context, blobID string) (io.ReadCloser, error)
- func (store *Store) Remove(ctx context.Context, blobIDs ...string) error
- func (store *Store) Size(ctx context.Context, blobID string) (int64, error)
- func (store *Store) Write(ctx context.Context, blobID string, data io.Reader) error
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultChunkSize = 2048 * 1024 // 2MB chunks
View Source
var ErrNotFound = errors.New("Not found")
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct { Collection *mongo.Collection ChunkSize int // contains filtered or unexported fields }
func (*Store) EnsureIndex ¶
EnsureIndex ensures that the collection has an index on id and seq. This can be called multiple times on a store object.
func (*Store) Read ¶
Read blob data. To stop reading, close the returned readCloser. You must close the returned stream, otherwise the goroutine streaming the data will leak.
Click to show internal directories.
Click to hide internal directories.