package storage

import (
	"context"
	"errors"
	"io"
	"time"
)

var (
	ErrObjectNotFound     = errors.New("object not found")
	ErrPresignUnsupported = errors.New("presigned URLs not supported by this storage provider")
)

type PutObjectOptions struct {
	ContentType   string
	ContentLength *int64
}

type ObjectMetadata struct {
	Key          string
	Size         int64
	ContentType  string
	LastModified time.Time
}

type ObjectStore interface {
	PutObject(ctx context.Context, key string, body io.Reader, opts PutObjectOptions) (ObjectMetadata, error)
	GetObject(ctx context.Context, key string) (io.ReadCloser, ObjectMetadata, error)
	HeadObject(ctx context.Context, key string) (ObjectMetadata, error)
	DeleteObject(ctx context.Context, key string) error
	GeneratePresignedGetURL(ctx context.Context, key string, expiry time.Duration) (string, error)
}
