Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
func FileExists(c *FileRequest) bool
FileExists takes a *FileRequest c and checks if the requested file exists or not. It returns true if the file exists.
func GetFile ¶
func GetFile(c *FileRequest) (string, error)
GetFile takes a *FileRequest c and tries to download the requested file from s3. It returns the content of the requested file as a string and any download / read errors.
func PutFile ¶
func PutFile(c *PutFileRequest) error
PutFile takes an *PutFileRequest c and tries to send the requested file to s3. It returns any file upload errors.
func RemoveFile ¶
func RemoveFile(c *FileRequest) error
RemoveFile takes a *FileRequest c and tries to remove the requested file from s3. It returns any errors that might occure.
Types ¶
type FileRequest ¶
type FileRequest struct { S3Bucket string // Bucket to upload file to S3Prefix string // Prefix to use for upload S3Filename string // Filename to use on S3 }
FileRequest is used by the FileExists, GetFile and RemoveFile functions. You specify the necessary parameters for the file upload.
type PutFileRequest ¶
type PutFileRequest struct { S3Bucket string // Bucket to upload file to S3Prefix string // Prefix to use for upload S3Filename string // Filename to use on S3 LocalFile string // Local file on filesystem (whole path) PartSize int64 // Size of parts (multi-part upload) in bytes, will default to 1gb ContentType string // Set the content type, will default to text/plain; charset=utf-8 }
PutFileRequest is used by the PutFile function. You specify the necessary parameters for the file upload.