Documentation
¶
Index ¶
- Constants
- Variables
- func B2Endpoint(region string) string
- func DeleteObjectsInputFromKeys(bucket string, keys []string, quiet bool) *s3.DeleteObjectsInput
- func MSSToObjectIdentifiers(m map[string]string) []*s3.ObjectIdentifier
- func NewS3Client(cm config.AWSConfig) (*s3.S3, *session.Session, error)
- func ObjectInputFile(filename string) (*s3.PutObjectInput, error)
- func ObjectInputFileMore(bucket, key, filename string) (*s3.PutObjectInput, error)
- func ObjectInputHTTPResponseMore(bucket, key string, resp *http.Response) (*s3.PutObjectInput, error)
- func ObjectKeyNameIsSafe(name string) bool
- func UploadInputFile(bucket, key, filename string) (*s3manager.UploadInput, error)
- type S3ClientMore
- func (cm *S3ClientMore) CreateBucketSimple(bucket string) (*s3.CreateBucketOutput, error)
- func (cm *S3ClientMore) DeleteObjectsByKeys(bucket string, keys []string, quiet bool) (*s3.DeleteObjectsOutput, error)
- func (cm *S3ClientMore) ObjectFilePut(bucket, key, filename string) (*s3.PutObjectOutput, error)
- func (cm *S3ClientMore) ObjectFileUpload(bucket, key, filename string) (*s3manager.UploadOutput, error)
- func (cm *S3ClientMore) ObjectFileUploadOld(bucket, key, filename string) (*s3manager.UploadOutput, error)
- func (cm *S3ClientMore) ObjectGetSimple(bucket, key string) (*s3.GetObjectOutput, error)
- func (cm *S3ClientMore) ObjectGetToFile(bucket, key, filename string) (int64, error)
- func (cm *S3ClientMore) ObjectHTTPRequestPut(bucket, key string, sreq httpsimple.Request, sclient *httpsimple.Client) (*s3.PutObjectOutput, error)
- func (cm *S3ClientMore) ObjectHTTPRequestUpload(bucket, key string, sreq httpsimple.Request, sclient *httpsimple.Client) (*s3manager.UploadOutput, error)
- func (cm *S3ClientMore) ObjectHTTPResponsePut(bucket, key string, resp *http.Response) (*s3.PutObjectOutput, error)
- func (cm *S3ClientMore) ObjectReaderUpload(bucket, key, contentType string, r io.Reader) (*s3manager.UploadOutput, error)
- func (cm *S3ClientMore) ObjectStringPut(bucket, key, strBody string) (*s3.PutObjectOutput, error)
- func (cm *S3ClientMore) ObjectsKeys(bucket, keypath string) ([]string, error)
- func (cm *S3ClientMore) ObjectsKeysPrint(bucket, keypath string) ([]string, error)
- func (cm *S3ClientMore) ObjectsSize(bucket, keypath string) (int64, error)
- func (cm *S3ClientMore) SetSession(sess *session.Session) error
Constants ¶
const ( CredentialsTypeStatic = "static" DatacenterUSWest000 = "us-west-000" // https://github.com/peak/s5cmd/issues/269 DatacenterUSWest002 = "us-west-002" BasePublicURL = "https://f000.backblazeb2.com/file" )
Variables ¶
Functions ¶
func B2Endpoint ¶
func DeleteObjectsInputFromKeys ¶
func DeleteObjectsInputFromKeys(bucket string, keys []string, quiet bool) *s3.DeleteObjectsInput
func MSSToObjectIdentifiers ¶
func MSSToObjectIdentifiers(m map[string]string) []*s3.ObjectIdentifier
MSSToObjectIdentifiers accepts a `map[string]string` of object info where keys are `ObjectIdentifier.Key` and the values are `ObjectIdentifier.VersionId`.`
func ObjectInputFile ¶
func ObjectInputFile(filename string) (*s3.PutObjectInput, error)
func ObjectInputFileMore ¶
func ObjectInputFileMore(bucket, key, filename string) (*s3.PutObjectInput, error)
func ObjectKeyNameIsSafe ¶
ObjectKeyNameIsSafe checks to see if all chars are within the safe characgter set. See more here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
func UploadInputFile ¶
func UploadInputFile(bucket, key, filename string) (*s3manager.UploadInput, error)
Types ¶
type S3ClientMore ¶
type S3ClientMore struct { Session *session.Session S3Client *s3.S3 Downloader *s3manager.Downloader Uploader *s3manager.Uploader }
func NewS3ClientMore ¶
func NewS3ClientMore(cm config.AWSConfig) (*S3ClientMore, error)
func NewS3ClientMoreSession ¶
func NewS3ClientMoreSession(sess *session.Session) (*S3ClientMore, error)
func (*S3ClientMore) CreateBucketSimple ¶
func (cm *S3ClientMore) CreateBucketSimple(bucket string) (*s3.CreateBucketOutput, error)
func (*S3ClientMore) DeleteObjectsByKeys ¶
func (cm *S3ClientMore) DeleteObjectsByKeys(bucket string, keys []string, quiet bool) (*s3.DeleteObjectsOutput, error)
func (*S3ClientMore) ObjectFilePut ¶
func (cm *S3ClientMore) ObjectFilePut(bucket, key, filename string) (*s3.PutObjectOutput, error)
func (*S3ClientMore) ObjectFileUpload ¶
func (cm *S3ClientMore) ObjectFileUpload(bucket, key, filename string) (*s3manager.UploadOutput, error)
func (*S3ClientMore) ObjectFileUploadOld ¶
func (cm *S3ClientMore) ObjectFileUploadOld(bucket, key, filename string) (*s3manager.UploadOutput, error)
func (*S3ClientMore) ObjectGetSimple ¶
func (cm *S3ClientMore) ObjectGetSimple(bucket, key string) (*s3.GetObjectOutput, error)
ObjectGetSimple returns an object given a bucket and key. For more complex usage, usage a custom `s3.GetObjectInput`.
func (*S3ClientMore) ObjectGetToFile ¶
func (cm *S3ClientMore) ObjectGetToFile(bucket, key, filename string) (int64, error)
func (*S3ClientMore) ObjectHTTPRequestPut ¶
func (cm *S3ClientMore) ObjectHTTPRequestPut(bucket, key string, sreq httpsimple.Request, sclient *httpsimple.Client) (*s3.PutObjectOutput, error)
func (*S3ClientMore) ObjectHTTPRequestUpload ¶
func (cm *S3ClientMore) ObjectHTTPRequestUpload(bucket, key string, sreq httpsimple.Request, sclient *httpsimple.Client) (*s3manager.UploadOutput, error)
func (*S3ClientMore) ObjectHTTPResponsePut ¶
func (cm *S3ClientMore) ObjectHTTPResponsePut(bucket, key string, resp *http.Response) (*s3.PutObjectOutput, error)
func (*S3ClientMore) ObjectReaderUpload ¶
func (cm *S3ClientMore) ObjectReaderUpload(bucket, key, contentType string, r io.Reader) (*s3manager.UploadOutput, error)
func (*S3ClientMore) ObjectStringPut ¶
func (cm *S3ClientMore) ObjectStringPut(bucket, key, strBody string) (*s3.PutObjectOutput, error)
func (*S3ClientMore) ObjectsKeys ¶
func (cm *S3ClientMore) ObjectsKeys(bucket, keypath string) ([]string, error)
iterate all objects in a given S3 bucket and prefix, sum up objects' total size in bytes use: size, err := S3ObjectsSize("example-bucket-name", "/a/b/c") this works if (a) keypath is empty, (b) keypath is a prefix, (c) keypath is a full key.
func (*S3ClientMore) ObjectsKeysPrint ¶
func (cm *S3ClientMore) ObjectsKeysPrint(bucket, keypath string) ([]string, error)
func (*S3ClientMore) ObjectsSize ¶
func (cm *S3ClientMore) ObjectsSize(bucket, keypath string) (int64, error)
ObjectsSize iterates all objects in a given S3 bucket and prefix to sum up objects' total size in bytes use: size, err := S3ObjectsSize("example-bucket-name", "/a/b/c")
func (*S3ClientMore) SetSession ¶
func (cm *S3ClientMore) SetSession(sess *session.Session) error