Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBoundaryValueMissing = errors.New("request contained no boundary value in the Content-Type header")
View Source
var ErrContentTypeHeaderMissing = errors.New("request contained no Content-Type header")
View Source
var ErrDownloadingS3File = errors.New("unable to download the given file from S3")
View Source
var ErrEmptyFileDownloaded = errors.New("the provided S3 file to download is empty")
View Source
var ErrNewAWSSession = errors.New("error creating new AWS Session")
View Source
var ErrOpeningMultiPartFile = errors.New("unable to open *multipart.FileHeader")
View Source
var ErrParameterBucketEmpty = errors.New("required parameter bucket is empty")
View Source
var ErrParameterNameEmpty = errors.New("required parameter name is empty")
View Source
var ErrParameterRegionEmpty = errors.New("required parameter region is empty")
View Source
var ErrParsingMediaType = errors.New("error parsing media type from Content-Type header. Make sure your request is formatted correctly")
View Source
var ErrReadingMultiPartFile = errors.New("unable to read *multipart.FileHeader")
View Source
var ErrReadingMultiPartForm = errors.New("reading of multipart form failed. verify input size is <= maxFileSizeBytes")
View Source
var ErrUploadingMultiPartFileToS3 = errors.New("unable to upload *multipart.FileHeader bytes to S3")
Functions ¶
func DownloadFileFromS3 ¶
func GetFileHeadersFromLambdaReq ¶
func GetFileHeadersFromLambdaReq(lambdaReq events.APIGatewayProxyRequest, maxFileSizeBytes int64) ([]*multipart.FileHeader, error)
GetFileHeadersFromLambdaReq accepts a lambda request directly from AWS Lambda after it has been proxied through API Gateway. It returns an array of *multipart.FileHeader values. One for each file uploaded to Lambda.
Types ¶
type UploadRes ¶
func UploadFileHeaderToS3 ¶
func UploadFileHeaderToS3(fileHeader *multipart.FileHeader, region, bucket, name string) (*UploadRes, error)
UploadFileHeaderToS3 takes a single *multipart.FileHeader from the Lambda request and uploads it to S3. It the upload is successful it returns the full path to the file in S3 as well as the URL for web access.
Click to show internal directories.
Click to hide internal directories.