Documentation ¶
Index ¶
- Constants
- type Bucket
- func (b *Bucket) AddObject(obj *PutObject, path string)
- func (b *Bucket) AddSecretObject(obj *PutObject, path string)
- func (b *Bucket) DeleteObject(path string) error
- func (b *Bucket) GetObjectByte(path string) ([]byte, 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) PutAll() error
- func (b *Bucket) PutOne(obj *PutObject, path, acl string) error
- func (b *Bucket) SetExpire(sec int)
- type PutObject
- type S3
- 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) Infof(format string, v ...interface{})
- func (svc *S3) IsExistBucket(name string) (bool, error)
- func (svc *S3) SetLogger(logger log.Logger)
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) AddSecretObject ¶
AddSecretObject adds object to write spool (w/ ACL permission).
func (*Bucket) DeleteObject ¶
DeleteObject deletes the object of target path.
func (*Bucket) GetObjectByte ¶
GetObjectByte returns bytes 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.
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 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 (*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.