feat: add database.s3 support
This commit is contained in:
25
internal/database/s3/s3.go
Normal file
25
internal/database/s3/s3.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user