Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) CopyObject(bucketName, oldKey, newKey string) error
- func (c *Client) DeleteObjects(bucketName string, keys []string) error
- func (c *Client) Download(bucketName, objectKey, dest string) error
- func (c *Client) DownloadWithOption(bucketName, objectKey, dest string, option *DownloadOption) error
- func (c *Client) GetFile(bucketName, objectKey string, option *DownloadOption) (*s3.GetObjectOutput, error)
- func (c *Client) ListFiles(bucketName, prefix string, recursive bool) ([]string, error)
- func (c *Client) RemoveFiles(bucketName string, prefixList []string)
- func (c *Client) Upload(bucketName, src string, objectKey string) error
- func (c *Client) UploadDir(bucketName, srcdir string, s3dir string) error
- func (c *Client) ValidateBucket(bucketName string) error
- type DownloadOption
Constants ¶
View Source
const (
DefaultRegion = "ap-shanghai"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func (*Client) CopyObject ¶ added in v1.4.0
CopyObject copies an object to a new place in the same bucket.
func (*Client) DeleteObjects ¶ added in v1.4.0
DeleteObjects deletes all the objects listed in keys.
func (*Client) DownloadWithOption ¶ added in v1.7.0
func (c *Client) DownloadWithOption(bucketName, objectKey, dest string, option *DownloadOption) error
func (*Client) GetFile ¶ added in v1.9.9
func (c *Client) GetFile(bucketName, objectKey string, option *DownloadOption) (*s3.GetObjectOutput, error)
func (*Client) RemoveFiles ¶
RemoveFiles removes the files with a specific list of prefixes and delete ALL of them for NOW, if an error is encountered, nothing will happen except for a line of error log.
func (*Client) UploadDir ¶ added in v1.9.9
Upload upload all files in a directory to a S3 path recursively
func (*Client) ValidateBucket ¶
Validate the existence of bucket
type DownloadOption ¶ added in v1.7.0
Click to show internal directories.
Click to hide internal directories.