Documentation
¶
Index ¶
- type Client
- func (c *Client) GeneratePresignedURL(ctx context.Context, key string, expire time.Duration, requestType RequestType) (string, error)
- func (c *Client) GeneratePresignedURLForPost(ctx context.Context, keyPrefix string, expire time.Duration) (*s3.PresignedPostRequest, error)
- func (c *Client) ListObjectsPages(ctx context.Context, prefix string) (*s3.ListObjectsV2Output, error)
- type RequestType
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
}
Client is a client for S3.
func (*Client) GeneratePresignedURL ¶
func (c *Client) GeneratePresignedURL(ctx context.Context, key string, expire time.Duration, requestType RequestType) (string, error)
GeneratePresignedURL generates a pre-signed URL.
func (*Client) GeneratePresignedURLForPost ¶ added in v0.219.0
func (c *Client) GeneratePresignedURLForPost(ctx context.Context, keyPrefix string, expire time.Duration) (*s3.PresignedPostRequest, error)
GeneratePresignedURLForPost generates a pre-signed URL for a POST request. It allows uploading files with given key prefix. For example, when a file 'myfile' is uploaded, the key will be keyPrefix/myfile.
func (*Client) ListObjectsPages ¶
func (c *Client) ListObjectsPages( ctx context.Context, prefix string, ) (*s3.ListObjectsV2Output, error)
ListObjectsPages returns S3 objects with pagination.
type RequestType ¶
type RequestType string
RequestType is the type of the request.
const ( // RequestTypeGetObject is the type for getting an object. RequestTypeGetObject RequestType = "GetObject" // RequestTypePutObject is the type for putting an object. RequestTypePutObject RequestType = "PutObject" )
Click to show internal directories.
Click to hide internal directories.