Documentation ¶
Index ¶
- func GetCreateBucketInputWithACL(bucketName string, acl string) *s3.CreateBucketInput
- type ConnectionInfo
- type S3Client
- func (client *S3Client) CreateBucketWithACL(bucketName string, acl string) (*s3.CreateBucketOutput, error)
- func (client *S3Client) DeleteObject(key string) (*s3.DeleteObjectOutput, error)
- func (client *S3Client) DeleteObjectInput(key string) *s3.DeleteObjectInput
- func (client *S3Client) GetObject(key string) (*s3.GetObjectOutput, error)
- func (client *S3Client) GetObjectInput(key string) *s3.GetObjectInput
- func (client *S3Client) GetURL(key string, expire time.Duration) (string, error)
- func (client *S3Client) PingBucket() error
- func (client *S3Client) PutFile(key string, file *os.File) (*s3.PutObjectOutput, error)
- func (client *S3Client) PutFileWithACL(key string, file *os.File, acl string) (*s3.PutObjectOutput, error)
- func (client *S3Client) PutObject(key string, payloadBytes []byte) (*s3.PutObjectOutput, error)
- func (client *S3Client) PutObjectInputBytes(key string, payloadBytes []byte) *s3.PutObjectInput
- func (client *S3Client) PutObjectInputFile(key string, file *os.File) *s3.PutObjectInput
- func (client *S3Client) PutObjectInputFileACL(key string, file *os.File, acl string) *s3.PutObjectInput
- func (client *S3Client) SetBucket(newBucket string)
- func (client *S3Client) UploadFileWithACL(key string, file *os.File, acl string) (*s3manager.UploadOutput, error)
- func (client *S3Client) UploadInputACL(key string, file *os.File, acl string) *s3manager.UploadInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCreateBucketInputWithACL ¶
func GetCreateBucketInputWithACL(bucketName string, acl string) *s3.CreateBucketInput
Types ¶
type ConnectionInfo ¶
type ConnectionInfo struct { AccessKey string SecretKey string Endpoint string Bucket string Region string }
func LoadConnectionInfoFromEnvVars ¶
func LoadConnectionInfoFromEnvVars() (info ConnectionInfo, err error)
func NewConnectionInfo ¶
func (*ConnectionInfo) Equals ¶
func (obj *ConnectionInfo) Equals(other ConnectionInfo) (equals bool)
func (*ConnectionInfo) Validate ¶
func (obj *ConnectionInfo) Validate() error
type S3Client ¶
type S3Client struct { Session *session.Session Uploader *s3manager.Uploader S3 *s3.S3 //Service service ConnInfo ConnectionInfo }
func NewS3Client ¶
func NewS3Client(info ConnectionInfo, httpClient *http.Client) (*S3Client, error)
NewS3Client only sets up the connection to S3, it *does not* test that connection. For that, call PingBucket().
func (*S3Client) CreateBucketWithACL ¶
func (client *S3Client) CreateBucketWithACL(bucketName string, acl string) (*s3.CreateBucketOutput, error)
CreateBucketWithACL creates a new bucket in S3 with the provided ACL.
func (*S3Client) DeleteObject ¶
func (client *S3Client) DeleteObject(key string) (*s3.DeleteObjectOutput, error)
func (*S3Client) DeleteObjectInput ¶
func (client *S3Client) DeleteObjectInput(key string) *s3.DeleteObjectInput
Delete
func (*S3Client) GetObject ¶
func (client *S3Client) GetObject(key string) (*s3.GetObjectOutput, error)
func (*S3Client) GetObjectInput ¶
func (client *S3Client) GetObjectInput(key string) *s3.GetObjectInput
func (*S3Client) PingBucket ¶
PingBucket will test the connection to S3 a single time. If you're using this as a measure for whether S3 is responsive, call it in a loop looking for nil err returned.
func (*S3Client) PutFileWithACL ¶
func (*S3Client) PutObjectInputBytes ¶
func (client *S3Client) PutObjectInputBytes(key string, payloadBytes []byte) *s3.PutObjectInput
func (*S3Client) PutObjectInputFile ¶
func (*S3Client) PutObjectInputFileACL ¶
func (*S3Client) SetBucket ¶
SetBucket updates the connection info to use the newly passed in bucket name.
func (*S3Client) UploadFileWithACL ¶ added in v1.10.0
func (*S3Client) UploadInputACL ¶ added in v1.10.0
Click to show internal directories.
Click to hide internal directories.