Documentation
¶
Index ¶
- func NewS3Client(opt Options) *s3.S3
- type ACL
- type Client
- type Interactor
- func (i *Interactor) Download(filepath string) (io.ReadCloser, *string, error)
- func (i *Interactor) FilePath(filename string) string
- func (i *Interactor) FileURL(filepath string) string
- func (i *Interactor) Remove(filepath string) error
- func (i *Interactor) Upload(file io.ReadSeeker, filepath string, acl ACL, contentType string) error
- type Options
- type S3Mock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewS3Client ¶
NewS3Client returns connfigured AWS S3 client
Types ¶
type Client ¶
type Client interface { PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error) GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error) DeleteObject(input *s3.DeleteObjectInput) (*s3.DeleteObjectOutput, error) }
Client interface
type Interactor ¶
type Interactor struct {
// contains filtered or unexported fields
}
Interactor struct
func New ¶
func New(c Client, opt Options) *Interactor
New is a factory function, returns a new instance of the storage interactor
func (*Interactor) Download ¶
func (i *Interactor) Download(filepath string) (io.ReadCloser, *string, error)
Download file from the cloud storage
func (*Interactor) FilePath ¶
func (i *Interactor) FilePath(filename string) string
FilePath returns absolute file path in the storage
func (*Interactor) FileURL ¶
func (i *Interactor) FileURL(filepath string) string
FileURL return public url for a file
func (*Interactor) Remove ¶
func (i *Interactor) Remove(filepath string) error
Remove file from the cloud storage
func (*Interactor) Upload ¶
func (i *Interactor) Upload(file io.ReadSeeker, filepath string, acl ACL, contentType string) error
Upload file to the cloud storage
type Options ¶
type Options struct { Key string Secret string Endpoint string Region string Bucket string URL string ForcePathStyle bool DisableSSL bool }
Options struct
type S3Mock ¶
S3Mock struct
func (*S3Mock) DeleteObject ¶
func (s *S3Mock) DeleteObject(input *s3.DeleteObjectInput) (*s3.DeleteObjectOutput, error)
DeleteObject ...
func (*S3Mock) GetObject ¶
func (s *S3Mock) GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error)
GetObject ...
func (*S3Mock) PutObject ¶
func (s *S3Mock) PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error)
PutObject ...
Click to show internal directories.
Click to hide internal directories.