chore: tweak package name

This commit is contained in:
Steven
2024-05-06 07:18:54 +08:00
parent da535c8dc6
commit dfc0889a4f
9 changed files with 14 additions and 17 deletions

View File

@@ -15,10 +15,6 @@ import (
storepb "github.com/usememos/memos/proto/gen/store"
)
// presignLifetimeSecs is the lifetime of a presigned URL in seconds.
// The presigned URL is valid for 7 days.
const presignLifetimeSecs = 7 * 24 * 60 * 60
type Client struct {
Client *s3.Client
Bucket *string
@@ -74,7 +70,7 @@ func (c *Client) PresignGetObject(ctx context.Context, key string) (string, erro
Bucket: aws.String(*c.Bucket),
Key: aws.String(key),
}, func(opts *s3.PresignOptions) {
opts.Expires = time.Duration(presignLifetimeSecs * int64(time.Second))
opts.Expires = time.Duration(7 * 24 * time.Hour)
})
if err != nil {
return "", errors.Wrap(err, "failed to presign put object")