20 lines
536 B
Go
20 lines
536 B
Go
// Package media provides file storage and image thumbnail generation
|
|
// for attachments shared in conversations.
|
|
package media
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"io"
|
|
)
|
|
|
|
// ErrNotFound is returned when a stored object does not exist.
|
|
var ErrNotFound = errors.New("media: not found")
|
|
|
|
// Storage is an S3-like object store for attachment bytes.
|
|
type Storage interface {
|
|
Save(ctx context.Context, key string, r io.Reader) error
|
|
Open(ctx context.Context, key string) (io.ReadCloser, error)
|
|
Delete(ctx context.Context, key string) error
|
|
}
|