s3

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorNilOption = errors.New("the option is not set")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	S3Client      *s3.Client
	PreSignClient *s3.PresignClient
	Bucket        string
	CDNHost       string
}

func NewS3Client

func NewS3Client(opt *Option) (*Client, error)

func (*Client) ConstructDownloadURL

func (c *Client) ConstructDownloadURL(_ context.Context, objectID string) string

FIXME: this is a simple solution for public bucket.

type Option

type Option struct {
	Endpoint       string
	AccessID       string
	AccessSecret   string
	BucketName     string
	Region         string
	CDNHost        string
	PreSignExpires time.Duration
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL