Documentation
¶
Index ¶
- func Del(c context.Context, path string) error
- func Get(c context.Context, path string) ([]byte, error)
- func GetReader(c context.Context, path string) (io.ReadCloser, error)
- func NewContext(parent context.Context, store Blobstore) context.Context
- func Put(c context.Context, path string, data []byte) error
- func PutReader(c context.Context, path string, r io.Reader) error
- type Blobstore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetReader ¶
GetReader retrieves an object from the blobstore. It is the caller's responsibility to call Close on the ReadCloser when finished reading.
func NewContext ¶
NewContext returns a Context whose Value method returns the application's Blobstore data.
Types ¶
type Blobstore ¶
type Blobstore interface {
// Del removes an object from the blobstore.
Del(path string) error
// Get retrieves an object from the blobstore.
Get(path string) ([]byte, error)
// GetReader retrieves an object from the blobstore.
// It is the caller's responsibility to call Close on
// the ReadCloser when finished reading.
GetReader(path string) (io.ReadCloser, error)
// Put inserts an object into the blobstore.
Put(path string, data []byte) error
// PutReader inserts an object into the blobstore by
// consuming data from r until EOF.
PutReader(path string, r io.Reader) error
}
func FromContext ¶
FromContext returns the Blobstore associated with this context.
Click to show internal directories.
Click to hide internal directories.