s3

package
Version: v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRegion = "ap-shanghai"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*s3.S3
}

func NewClient

func NewClient(endpoint, ak, sk string, insecure, forcedPathStyle bool) (*Client, error)

func (*Client) CopyObject added in v1.4.0

func (c *Client) CopyObject(bucketName, oldKey, newKey string) error

CopyObject copies an object to a new place in the same bucket.

func (*Client) DeleteObjects added in v1.4.0

func (c *Client) DeleteObjects(bucketName string, keys []string) error

DeleteObjects deletes all the objects listed in keys.

func (*Client) Download

func (c *Client) Download(bucketName, objectKey, dest string) error

Download the file to object storage

func (*Client) ListFiles

func (c *Client) ListFiles(bucketName, prefix string, recursive bool) ([]string, error)

ListFiles with given prefix

func (*Client) RemoveFiles

func (c *Client) RemoveFiles(bucketName string, prefixList []string)

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) Upload

func (c *Client) Upload(bucketName, src string, objectKey string) error

Upload uploads a file from src to the bucket with the specified objectKey

func (*Client) ValidateBucket

func (c *Client) ValidateBucket(bucketName string) error

Validate the existence of bucket

Source Files

Jump to

Keyboard shortcuts

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