Files
drive/apps/backend/internal/blob/store.go

27 lines
693 B
Go
Raw Normal View History

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-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
}