Documentation ¶
Overview ¶
Package awswrapper wraps over the AWS official GO SDK to simplify the usage.
Index ¶
- type By
- type ConcurrentDownloader
- type ConcurrentUploader
- type ECRService
- type S3Service
- func (o *S3Service) AbortMultipart(bucketName, path, uploadID string) error
- func (o *S3Service) CompleteMultipart(bucketName, path, uploadID string, parts map[string]interface{}) error
- func (o *S3Service) CopyWithInS3(sourceBucketName, sourcePath, destBucketName, destPath string, ...) (err error)
- func (o *S3Service) CreateBucket(bucketName, region string) error
- func (o *S3Service) DeleteBucket(bucketName string) error
- func (o *S3Service) Exists(bucketName string, path string) (exists bool, err error)
- func (o *S3Service) GetPreSignedURL(bucketName, path string, validFor time.Duration) (string, error)
- func (o *S3Service) InitMultiPartUpload(bucketName, path string) (string, error)
- func (o *S3Service) ListAllS3(bucketName string, path string) (objectPaths []string, err error)
- func (o *S3Service) ReadFromS3(bucketName string, path string) (content []byte, err error)
- func (o *S3Service) ReadFromS3Concurrently(bucketName string, path string) (content []byte, err error)
- func (o *S3Service) RemoveAllFromS3(bucketName string, path string) (err error)
- func (o *S3Service) RemoveFromS3(bucketName string, path string) (err error)
- func (o *S3Service) UploadMultipart(bucketName, path, uploadID string, partNumber int64, b []byte) (string, error)
- func (o *S3Service) UploadToS3(content []byte, bucketName string, path string, args ...interface{}) error
- func (o *S3Service) UploadToS3Concurrently(content []byte, bucketName string, path string, args ...interface{}) error
- type SESService
- type Signer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type By ¶
type By func(r1, r2 *ecr.ImageDetail) bool
By is the type of a "less" function that defines the ordering of its Planet arguments.
func (By) Sort ¶
func (by By) Sort(imageDetails []*ecr.ImageDetail)
Sort is a method on the function type, By, that sorts the argument slice according to the function.
type ConcurrentDownloader ¶
type ConcurrentDownloader struct { DownloadContent map[string][]byte DownloadComplete chan bool // contains filtered or unexported fields }
ConcurrentDownloader is used to download multiple files to S3 concurrently.
func NewConcurrentDownloader ¶
func NewConcurrentDownloader(bucketName, region string) (downloader *ConcurrentDownloader)
NewConcurrentDownloader creates a new downloader
func (*ConcurrentDownloader) Download ¶
func (downloader *ConcurrentDownloader) Download(path string)
Download marks to be downloaded path, it will not execute the actual downloading.
func (*ConcurrentDownloader) Execute ¶
func (downloader *ConcurrentDownloader) Execute()
Execute executes the downloading process.
type ConcurrentUploader ¶
type ConcurrentUploader struct { UploadComplete chan bool // contains filtered or unexported fields }
ConcurrentUploader is used to upload multiple files to S3 concurrently.
func NewConcurrentUploader ¶
func NewConcurrentUploader(bucketName, region string) (uploader *ConcurrentUploader)
NewConcurrentUploader creates a new uploader
func (*ConcurrentUploader) Execute ¶
func (uploader *ConcurrentUploader) Execute()
Execute executes the uploading process.
func (*ConcurrentUploader) Upload ¶
func (uploader *ConcurrentUploader) Upload(content []byte, path string)
Upload marks the content with the upload path, it will not execute the actual uploading.
type ECRService ¶
type ECRService struct {
// contains filtered or unexported fields
}
ECRService represents anecr service.
func GetECRService ¶
func GetECRService(region string) *ECRService
GetECRService gets a ecr service for a specific region
func (*ECRService) ListImages ¶
func (o *ECRService) ListImages(repoName string) (tags [][]string)
ListImages returns all tagged images for a given repo
type S3Service ¶
type S3Service struct {
// contains filtered or unexported fields
}
S3Service represents a S3 service.
func GetS3Service ¶
GetS3Service gets a s3 service for a specific region
func (*S3Service) AbortMultipart ¶
AbortMultipart aborts a multipart upload
func (*S3Service) CompleteMultipart ¶
func (o *S3Service) CompleteMultipart(bucketName, path, uploadID string, parts map[string]interface{}) error
CompleteMultipart marks a multi part upload as complete
func (*S3Service) CopyWithInS3 ¶
func (o *S3Service) CopyWithInS3(sourceBucketName, sourcePath, destBucketName, destPath string, deleteAfterCopy bool) (err error)
CopyWithInS3 copys a object from one place to another within a bucket on S3
func (*S3Service) CreateBucket ¶
CreateBucket creates a bucket with given name and in given region
func (*S3Service) DeleteBucket ¶
DeleteBucket delete a bucket with given name and in given region
func (*S3Service) GetPreSignedURL ¶
func (o *S3Service) GetPreSignedURL(bucketName, path string, validFor time.Duration) (string, error)
GetPreSignedURL gets pre-signed URL that are valid for specified duration.
func (*S3Service) InitMultiPartUpload ¶
InitMultiPartUpload inits a multiple parts upload
func (*S3Service) ReadFromS3 ¶
ReadFromS3 read the content in byte from S3 with a specific bucket and path
func (*S3Service) ReadFromS3Concurrently ¶
func (o *S3Service) ReadFromS3Concurrently(bucketName string, path string) (content []byte, err error)
ReadFromS3Concurrently reads content from S3 concurrently
func (*S3Service) RemoveAllFromS3 ¶
RemoveAllFromS3 removes a folder with bucketname and path
func (*S3Service) RemoveFromS3 ¶
RemoveFromS3 removes a object using its bucketname and path
func (*S3Service) UploadMultipart ¶
func (o *S3Service) UploadMultipart(bucketName, path, uploadID string, partNumber int64, b []byte) (string, error)
UploadMultipart uploads a part to S3
type SESService ¶
type SESService struct {
// contains filtered or unexported fields
}
SESService represents a SES service.
func GetSESService ¶
func GetSESService(region string) *SESService
GetSESService gets a SES service for a specific region
func (*SESService) SendSESEmail ¶
func (o *SESService) SendSESEmail(subject, fromName, fromAddr, toAddr, data, dataType string, tags ...string) error
SendSESEmail sends email using AWS SES api Parameters: subject: subject of the email fromAddr: email address it's from fromName: whom it's from toAddr: email address to send to data: the body of the email dataType: the type of the body, text or html tags: tags on the email, comes in as key value pair, e.g. "serviceName", "proceq", "env", "dev"
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer is a wrapper over aws's signers
func GetURLSigner ¶
func GetURLSigner(keyID string, privateKey *rsa.PrivateKey) *Signer
GetURLSigner gets URL signer by given keyID and private key
func (*Signer) SignURL ¶
func (o *Signer) SignURL(domain, objectPath string, validityTime time.Duration, fileName ...string) (string, error)
SignURL generates a signed cloudfront URL domain: the cloudfront domain objectPath: the S3 path to the object keyID: the cloudfront key ID privKey: the private key validityTime: the validity time of this url in seconds