s3

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewS3Client

func NewS3Client(opt Options) *s3.S3

Types

type ACL

type ACL string
const (
	Public  ACL = "public-read"
	Private ACL = "private"
)

func (ACL) String

func (a ACL) String() string

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)
}

type Interactor

type Interactor struct {
	// contains filtered or unexported fields
}

func New

func New(c Client, opt Options) *Interactor

func (*Interactor) Download

func (i *Interactor) Download(filepath string) (io.ReadCloser, *string, error)

func (*Interactor) GetFullURL

func (i *Interactor) GetFullURL(path string) string

func (*Interactor) Remove

func (i *Interactor) Remove(filepath string) error

func (*Interactor) Upload

func (i *Interactor) Upload(file io.ReadSeeker, filepath string, acl ACL, contentType string) error

type Options

type Options struct {
	Key            string
	Secret         string
	Endpoint       string
	Region         string
	Bucket         string
	URL            string
	ForcePathStyle bool
	DisableSSL     bool
}

type S3mock

type S3mock struct {
	Error       error
	Filepath    string
	ContentType string
}

func (*S3mock) DeleteObject

func (s *S3mock) DeleteObject(input *s3.DeleteObjectInput) (*s3.DeleteObjectOutput, error)

func (*S3mock) GetObject

func (s *S3mock) GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error)

func (*S3mock) PutObject

func (s *S3mock) PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL