feat: add database.s3 support

This commit is contained in:
loveuer
2025-01-06 23:38:49 -08:00
parent 3c0b7479a0
commit 534b9586f2
7 changed files with 460 additions and 1 deletions

View File

@ -0,0 +1,25 @@
package s3
import (
"context"
"io"
)
type meta struct {
ContentType string `json:"content_type"`
Size int64 `json:"size"`
ExpireAt int64 `json:"expire_at"`
}
type Object struct {
ContentType string
Body io.ReadCloser
Size int64
ExpireAt int64
}
type S3 interface {
Get(ctx context.Context, bucket, key string) (*Object, error)
Put(ctx context.Context, bucket, key string, obj *Object) error
Delete(ctx context.Context, bucket, key string) error
}