Documentation ¶
Index ¶
- Constants
- type Bucket
- func (b *Bucket) AddObject(obj *PutObject, path string)
- func (b *Bucket) AddPrivateObject(obj *PutObject, path string)
- func (b *Bucket) AddSecretObject(obj *PutObject, path string)
- func (b *Bucket) CopyFrom(srcBucket, srcPath, destPath string, opt ...CopyObjectRequest) (CopyObjectResponse, error)
- func (b *Bucket) CopyTo(srcPath, destBucket, destPath string, opt ...CopyObjectRequest) (CopyObjectResponse, error)
- func (b *Bucket) DeleteObject(path string) error
- func (b *Bucket) DeleteObjectWithVersionID(path string, versionID string) error
- func (b *Bucket) GetObjectByte(path string) ([]byte, error)
- func (b *Bucket) GetObjectVersionID(path string) (string, error)
- func (b *Bucket) GetSecretURL(path string) (string, error)
- func (b *Bucket) GetSecretURLWithExpire(path string, expire int) (string, error)
- func (b *Bucket) GetURL(path string) string
- func (b *Bucket) HeadObject(path string) (*SDK.HeadObjectOutput, error)
- func (b *Bucket) IsExists(path string) bool
- func (b *Bucket) ListAllObjects(prefix string) ([]Object, error)
- func (b *Bucket) ListObjectsV2(opt ...ListObjectsRequest) (ListObjectsResponse, error)
- func (b *Bucket) PutAll() error
- func (b *Bucket) PutOne(obj *PutObject, path, acl string) error
- func (b *Bucket) SetExpire(sec int)
- type CopyObjectRequest
- type CopyObjectResponse
- type ListObjectsRequest
- type ListObjectsResponse
- type Object
- type PutObject
- type S3
- func (svc *S3) CopyObject(req CopyObjectRequest) (CopyObjectResponse, error)
- func (svc *S3) CreateBucket(in *SDK.CreateBucketInput) error
- func (svc *S3) CreateBucketWithName(name string) error
- func (svc *S3) Errorf(format string, v ...interface{})
- func (svc *S3) ForceDeleteBucket(name string) error
- func (svc *S3) GetBucket(bucket string) (*Bucket, error)
- func (svc *S3) GetClient() *SDK.S3
- func (svc *S3) Infof(format string, v ...interface{})
- func (svc *S3) IsExistBucket(name string) (bool, error)
- func (svc *S3) SetEndpoint(endpoint string)
- func (svc *S3) SetLogger(logger log.Logger)
- func (svc *S3) SetPrefix(prefix string)
Constants ¶
const ( ACLAuthenticatedRead = "authenticated-read" ACLPrivate = "private" ACLPublicRead = "public-read" ACLPublicReadWrite = "public-read-write" )
ACL settings
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
Bucket is S3 Bucket wrapper struct.
func (*Bucket) AddPrivateObject ¶ added in v1.16.5
AddPrivateObject adds object to write spool (w/ Private).
func (*Bucket) AddSecretObject ¶
AddSecretObject adds object to write spool (w/ ACL permission).
func (*Bucket) CopyFrom ¶ added in v1.14.1
func (b *Bucket) CopyFrom(srcBucket, srcPath, destPath string, opt ...CopyObjectRequest) (CopyObjectResponse, error)
CopyFrom copies an object from source buckwt and path.
func (*Bucket) CopyTo ¶ added in v1.14.1
func (b *Bucket) CopyTo(srcPath, destBucket, destPath string, opt ...CopyObjectRequest) (CopyObjectResponse, error)
CopyTo copies an object to destination bucket and path.
func (*Bucket) DeleteObject ¶
DeleteObject deletes the object of target path.
func (*Bucket) DeleteObjectWithVersionID ¶ added in v1.16.3
DeleteObjectWithVersionID deletes the object of target path and versionId.
func (*Bucket) GetObjectByte ¶
GetObjectByte returns bytes of object from given S3 path.
func (*Bucket) GetObjectVersionID ¶ added in v1.16.4
GetObjectVersionID returns versionID of object from given S3 path.
func (*Bucket) GetSecretURL ¶
GetSecretURL fetches a url of target S3 object w/ ACL permission.
func (*Bucket) GetSecretURLWithExpire ¶
GetSecretURLWithExpire fetches a url of target S3 object w/ ACL permission (url expires in `expire` value seconds) ** this isn't work **
func (*Bucket) HeadObject ¶ added in v1.4.2
func (b *Bucket) HeadObject(path string) (*SDK.HeadObjectOutput, error)
HeadObject executes HeadObject operation.
func (*Bucket) ListAllObjects ¶ added in v1.14.1
ListAllObjects fetches a list of all of the objects in the bucket and prefix.
func (*Bucket) ListObjectsV2 ¶ added in v1.14.1
func (b *Bucket) ListObjectsV2(opt ...ListObjectsRequest) (ListObjectsResponse, error)
ListObjectsV2 executes ListObjectsV2 operation.
type CopyObjectRequest ¶ added in v1.14.1
type CopyObjectRequest struct { SrcBucket string SrcPath string DestBucket string DestPath string // if true, add prefix to bucket name UseSamePrefix bool // optional params // ref: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html ACL string CacheControl string ContentDisposition string ContentEncoding string ContentLanguage string ContentType string CopySourceIfMatch string CopySourceIfModifiedSince time.Time CopySourceIfNoneMatch string CopySourceIfUnmodifiedSince time.Time CopySourceSSECustomerAlgorithm string CopySourceSSECustomerKey string CopySourceSSECustomerKeyMD5 string Expires time.Time GrantFullControl string GrantRead string GrantReadACP string GrantWriteACP string Metadata map[string]string MetadataDirective string ObjectLockLegalHoldStatus string ObjectLockMode string ObjectLockRetainUntilDate time.Time RequestPayer string SSECustomerAlgorithm string SSECustomerKey string SSECustomerKeyMD5 string SSEKMSEncryptionContext string SSEKMSKeyID string ServerSideEncryption string StorageClass string Tagging string TaggingDirective string WebsiteRedirectLocation string }
CopyObjectRequest has parameters for `CopyObject` operation.
func (CopyObjectRequest) ToInput ¶ added in v1.14.1
func (r CopyObjectRequest) ToInput() *SDK.CopyObjectInput
type CopyObjectResponse ¶ added in v1.14.1
type CopyObjectResponse struct { ETag string LastModified time.Time CopySourceVersionID string Expiration string RequestCharged string SSECustomerAlgorithm string SSECustomerKeyMD5 string SSEKMSEncryptionContext string SSEKMSKeyID string ServerSideEncryption string VersionID string }
CopyObjectResponse contains data from CopyObject.
func NewCopyObjectResponse ¶ added in v1.14.1
func NewCopyObjectResponse(out *SDK.CopyObjectOutput) CopyObjectResponse
type ListObjectsRequest ¶ added in v1.14.1
type ListObjectsRequest struct { Bucket string // optional ContinuationToken string Delimiter string EncodingType string FetchOwner bool MaxKeys int64 Prefix string RequestPayer string StartAfter string }
ListObjectsRequest has parameters for `ListObjectsV2` operation.
func (ListObjectsRequest) ToInput ¶ added in v1.14.1
func (r ListObjectsRequest) ToInput() *SDK.ListObjectsV2Input
type ListObjectsResponse ¶ added in v1.14.1
type ListObjectsResponse struct { CommonPrefixes []string Contents []Object ContinuationToken string Delimiter string EncodingType string IsTruncated bool KeyCount int64 MaxKeys int64 Name string NextContinuationToken string Prefix string StartAfter string }
ListObjectsResponse contains data from ListObjectsV2.
func NewListObjectsResponse ¶ added in v1.14.1
func NewListObjectsResponse(out *SDK.ListObjectsV2Output) ListObjectsResponse
type Object ¶ added in v1.14.1
type PutObject ¶ added in v1.0.0
type PutObject struct {
// contains filtered or unexported fields
}
PutObject is wrapper struct for the object to upload S3.
func NewPutObject ¶ added in v1.0.0
NewPutObject returns initialized *PutObject from File.
func NewPutObjectBytes ¶ added in v1.13.1
NewPutObjectBytes returns initialized *PutObject from bytes.
func NewPutObjectCopy ¶ added in v1.0.0
NewPutObjectCopy returns initialized *PutObject from File and copy byte data.
func NewPutObjectString ¶ added in v1.0.0
NewPutObjectString returns initialized *PutObject from string.
func (*PutObject) Content ¶ added in v1.0.0
func (o *PutObject) Content() io.ReadSeeker
Content returns the content of the Object.
func (*PutObject) SetTypeAsText ¶ added in v1.0.0
func (o *PutObject) SetTypeAsText()
SetTypeAsText sets MIME type as text file.
type S3 ¶ added in v1.0.0
type S3 struct {
// contains filtered or unexported fields
}
S3 has S3 client and bucket list.
func NewFromSession ¶ added in v1.17.0
NewFromSession returns initialized *S3 from aws.Session.
func (*S3) CopyObject ¶ added in v1.14.1
func (svc *S3) CopyObject(req CopyObjectRequest) (CopyObjectResponse, error)
CopyObject executes `CopyObject` operation.
func (*S3) CreateBucket ¶ added in v1.0.0
func (svc *S3) CreateBucket(in *SDK.CreateBucketInput) error
CreateBucket creates new S3 bucket.
func (*S3) CreateBucketWithName ¶ added in v1.0.0
CreateBucketWithName creates new S3 bucket by given name.
func (*S3) ForceDeleteBucket ¶ added in v1.0.0
ForceDeleteBucket deletes S3 bucket by given name.
func (*S3) IsExistBucket ¶ added in v1.0.0
IsExistBucket checks if the Bucket already exists or not.
func (*S3) SetEndpoint ¶ added in v1.17.1
SetEndpoint sets endpoint.