Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
func Extension ¶ added in v0.4.1
func Extension(ct ContentType, ce ContentEncoding) string
Types ¶
type ContentEncoding ¶
type ContentEncoding int
const ( ContentEncodingPlain ContentEncoding = iota ContentEncodingGzip ContentEncodingZlib ContentEncodingFlate )
func ParseContentEncoding ¶
func ParseContentEncoding(compression string) (ContentEncoding, error)
func (ContentEncoding) FileExtension ¶ added in v0.4.1
func (ce ContentEncoding) FileExtension() string
func (ContentEncoding) FilePath ¶ added in v0.4.1
func (ce ContentEncoding) FilePath(key string) string
func (ContentEncoding) String ¶
func (ce ContentEncoding) String() string
type ContentType ¶
type ContentType int
const ( ContentTypeUnknown ContentType = iota ContentTypeText ContentTypeJSON ContentTypeProtobuf )
func ParseContentType ¶
func ParseContentType(contentType string) (ContentType, error)
func (ContentType) FileExtension ¶ added in v0.4.1
func (ct ContentType) FileExtension() string
func (ContentType) FilePath ¶ added in v0.4.1
func (ct ContentType) FilePath(key string) string
func (ContentType) String ¶
func (ct ContentType) String() string
type Headers ¶
type Headers struct { // ContentType is the type of the object ContentType ContentType // ContentEncoding is the compression algorithm used to store the object. ContentEncoding ContentEncoding // KeyValue is a map of key-value pairs to store/load with the object. KeyValue map[string]string }
Headers are optional metadata about an object to store/load
func (*Headers) GetContentEncoding ¶
func (h *Headers) GetContentEncoding() (ContentEncoding, error)
func (*Headers) GetContentType ¶
type Store ¶
type Store interface { // Store stores an object in the store. // // The key is the identifier for the object. // The reader is the object to store. // The headers are optional metadata about the object. Store(ctx context.Context, key string, reader io.Reader, headers *Headers) error // Load loads an object from the store. // // The key is the identifier for the object. // The headers are optional metadata about the object. // It is the responsibility of the caller to close the returned reader Load(ctx context.Context, key string) (io.ReadCloser, *Headers, error) // Delete deletes an object from the store. Delete(ctx context.Context, key string) error // Copy copies an object from one store to another. Copy(ctx context.Context, srcKey, dstKey string) error }
Store is an interface for storing and loading objects.
func NewNoOpStore ¶ added in v0.5.2
func NewNoOpStore() Store
NewNoOpStore returns a new no-op store.
func WithMetrics ¶ added in v0.3.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.