2025-11-26 20:11:12 +00:00
|
|
|
package blob
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"io"
|
2025-11-28 22:31:00 +00:00
|
|
|
"time"
|
2025-11-26 20:11:12 +00:00
|
|
|
)
|
|
|
|
|
|
2025-11-28 22:31:00 +00:00
|
|
|
type UploadURLOptions struct {
|
|
|
|
|
Duration time.Duration
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type UpdateOptions struct {
|
|
|
|
|
ContentType string
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-26 20:11:12 +00:00
|
|
|
type Store interface {
|
2025-11-29 18:39:21 +00:00
|
|
|
Initialize(ctx context.Context) error
|
2025-11-28 22:31:00 +00:00
|
|
|
GenerateUploadURL(ctx context.Context, key Key, opts UploadURLOptions) (string, error)
|
2025-11-26 20:11:12 +00:00
|
|
|
Put(ctx context.Context, key Key, reader io.Reader) error
|
2025-11-28 22:31:00 +00:00
|
|
|
Update(ctx context.Context, key Key, opts UpdateOptions) error
|
2025-11-26 20:11:12 +00:00
|
|
|
Delete(ctx context.Context, key Key) error
|
|
|
|
|
Move(ctx context.Context, srcKey, dstKey Key) error
|
2025-11-28 22:31:00 +00:00
|
|
|
Read(ctx context.Context, key Key) (io.ReadCloser, error)
|
|
|
|
|
ReadRange(ctx context.Context, key Key, offset, length int64) (io.ReadCloser, error)
|
|
|
|
|
ReadSize(ctx context.Context, key Key) (int64, error)
|
2025-11-26 20:11:12 +00:00
|
|
|
}
|