26 lines
620 B
Go
26 lines
620 B
Go
package attachment
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"io"
|
|
"time"
|
|
)
|
|
|
|
var ErrObjectMissing = errors.New("object missing")
|
|
|
|
type Object struct {
|
|
Key string
|
|
Size int64
|
|
Modified time.Time
|
|
}
|
|
|
|
type Blobs interface {
|
|
Put(ctx context.Context, key string, body io.Reader, size int64, mimeType string) error
|
|
Open(ctx context.Context, key string) (io.ReadCloser, error)
|
|
Stat(ctx context.Context, key string) (Object, error)
|
|
Copy(ctx context.Context, sourceKey, destinationKey string) error
|
|
Delete(ctx context.Context, key string) error
|
|
List(ctx context.Context, prefix, after string, limit int) ([]Object, error)
|
|
}
|