All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m50s
18 lines
624 B
Go
18 lines
624 B
Go
package storage
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
"time"
|
|
)
|
|
|
|
type Provider interface {
|
|
Upload(ctx context.Context, key string, reader io.Reader, contentType string) error
|
|
Download(ctx context.Context, key string) (io.ReadCloser, error)
|
|
DownloadToTemp(ctx context.Context, key string) (localPath string, cleanup func(), err error)
|
|
Delete(ctx context.Context, key string) error
|
|
Exists(ctx context.Context, key string) (bool, error)
|
|
GetUploadURL(ctx context.Context, key string, contentType string, expires time.Duration) (string, error)
|
|
GetDownloadURL(ctx context.Context, key string, expires time.Duration) (string, error)
|
|
}
|