Documentation ¶
Overview ¶
Package s3 handles interactions with aws-sdk-go/service/s3
Index ¶
- Constants
- func NewCreateBucketInput(bucketName string) (*s3.CreateBucketInput, error)
- func NewGetObjectInput(bucketName, source string) (*s3.GetObjectInput, error)
- func NewPutObjectInput(bucketName, fileName, contentType string, image []byte, size int64) (*s3.PutObjectInput, error)
- func UnmarshalGetObjectOutput(input *s3.GetObjectOutput) ([]byte, error)
- func UnmarshalIOReadCloser(input io.ReadCloser) ([]byte, error)
- type ReadImageOutput
- type S3
Constants ¶
const ( // ErrEmptyParameter is used when a required parameter is empty ErrEmptyParameter = "EmptyParameter" // ErrEmptyBody is used when an empty body has been found ErrEmptyBody = "EmptyBody" // ErrEmptyContentLength is used when no content length has been passed ErrEmptyContentLength = "EmptyContentLength" )
const ( // InputContentLength represents the parameter named inputContentLength InputContentLength = "inputContentLength" // Body represents the parameter named body Body = "body" // ContentType represents the parameter named contentType ContentType = "contentType" // FileName represents the parameter named fileName FileName = "fileName" // Image represents the parameter named image Image = "image" // Path represents the parameter named path Path = "path" // BucketName represents the parameter named bucketName BucketName = "bucketName" // Source represents the parameter named source Source = "source" )
Variables ¶
This section is empty.
Functions ¶
func NewCreateBucketInput ¶ added in v1.0.1
func NewCreateBucketInput(bucketName string) (*s3.CreateBucketInput, error)
NewCreateBucketInput returns a new *s3.CreateBucketInput
func NewGetObjectInput ¶
func NewGetObjectInput(bucketName, source string) (*s3.GetObjectInput, error)
NewGetObjectInput returns a new *s3.GetObjectInput given a bucket and a source image
func NewPutObjectInput ¶ added in v1.0.1
func NewPutObjectInput(bucketName, fileName, contentType string, image []byte, size int64) (*s3.PutObjectInput, error)
NewPutObjectInput returns a new *s3.PutObjectInput
func UnmarshalGetObjectOutput ¶ added in v1.0.1
func UnmarshalGetObjectOutput(input *s3.GetObjectOutput) ([]byte, error)
UnmarshalGetObjectOutput extracts bytes from *s3.GetObjectOutput
func UnmarshalIOReadCloser ¶
func UnmarshalIOReadCloser(input io.ReadCloser) ([]byte, error)
UnmarshalIOReadCloser extracts []byte from input.Body
Types ¶
type ReadImageOutput ¶ added in v1.0.1
type ReadImageOutput struct { // Body is the encoded body of the output Body []byte // ContentType is the content type of the output ContentType string // ContentSize is the body size ContentSize int64 }
ReadImageOutput embeds the result of opening an image and getting its metadata
func ReadImage ¶ added in v1.0.1
func ReadImage(path string) (*ReadImageOutput, error)
ReadImage reads an image given its path and returns a *ReadImageOutput containing its body and metadata
func (*ReadImageOutput) SetBody ¶ added in v1.0.1
func (img *ReadImageOutput) SetBody(body []byte) *ReadImageOutput
SetBody sets ReadImageOutput.Body to the passed body
func (*ReadImageOutput) SetContentSize ¶ added in v1.0.1
func (img *ReadImageOutput) SetContentSize(contentSize int64) *ReadImageOutput
SetContentSize sets ReadImageOutput.ContentSize to the passed contentSize
func (*ReadImageOutput) SetContentType ¶ added in v1.0.1
func (img *ReadImageOutput) SetContentType(contentType string) *ReadImageOutput
SetContentType sets ReadImageOutput.ContentType to the passed contentType
type S3 ¶
S3 embeds *s3.S3 to be used to call New
func (*S3) S3CreateBucket ¶ added in v1.0.1
S3CreateBucket creates a new bucket given a bucketName
func (*S3) S3GetObject ¶
S3GetObject retrieves an object from S3 given a bucket name and a source image
func (*S3) S3PutObject ¶ added in v1.0.1
S3PutObject puts a given object on S3