Documentation
¶
Index ¶
- type Client
- func (c *Client) ListObjectsPrefix(ctx context.Context, prefix string, max int64) ([]ObjectInfo, error)
- func (c *Client) MakeUploadAttachment(ctx context.Context, channelId, objectId, fileSize int64, objectName string) (string, error)
- func (c *Client) RemoveAttachment(ctx context.Context, key string) error
- func (c *Client) StatObject(ctx context.Context, key string) (int64, *string, error)
- func (c *Client) UploadObject(ctx context.Context, key string, body io.ReadSeeker, contentType string) error
- type ObjectInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(endpoint, accessKeyId, secretAccessKey, region, bucket string, useSSL bool) (*Client, error)
NewClient creates S3 client
func (*Client) ListObjectsPrefix ¶ added in v1.5.0
func (c *Client) ListObjectsPrefix(ctx context.Context, prefix string, max int64) ([]ObjectInfo, error)
ListObjectsPrefix lists object keys under a given prefix
func (*Client) MakeUploadAttachment ¶
func (c *Client) MakeUploadAttachment(ctx context.Context, channelId, objectId, fileSize int64, objectName string) (string, error)
MakeUploadAttachment returns a presigned PUT URL to upload the object with one-minute duration.
func (*Client) RemoveAttachment ¶
func (*Client) StatObject ¶ added in v1.5.0
StatObject performs a HEAD request to retrieve object size and content type
func (*Client) UploadObject ¶ added in v1.5.0
func (c *Client) UploadObject(ctx context.Context, key string, body io.ReadSeeker, contentType string) error
UploadObject uploads an object from a byte stream to S3 at the given key.
type ObjectInfo ¶ added in v1.5.0
ObjectInfo contains minimal info returned from listing
Click to show internal directories.
Click to hide internal directories.