Documentation ¶
Index ¶
- type FileManager
- func (fm *FileManager) DeleteFile(fileLocation *Location) error
- func (fm *FileManager) GetFile(fileLocation *Location) (io.Reader, error)
- func (fm *FileManager) Mock()
- func (fm *FileManager) NewLocationFromKey(key string) *Location
- func (fm *FileManager) ReleaseMock()
- func (fm *FileManager) UploadFile(uploadFile io.Reader, fileType FileType) (*Location, error)
- func (fm *FileManager) UploadFileToBucket(bucket string, uploadFile io.Reader, fileType FileType) (*Location, error)
- type FileType
- type Location
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileManager ¶
type FileManager struct {
// contains filtered or unexported fields
}
FileManager is a helper for s3 related operations.
func New ¶
func New(s3Bucket string, cfg awsutil.Config) *FileManager
New returns a new filemanager.
func (*FileManager) DeleteFile ¶
func (fm *FileManager) DeleteFile(fileLocation *Location) error
DeleteFile deletes a file from s3.
func (*FileManager) GetFile ¶
func (fm *FileManager) GetFile(fileLocation *Location) (io.Reader, error)
GetFile gets a file.
func (*FileManager) NewLocationFromKey ¶
func (fm *FileManager) NewLocationFromKey(key string) *Location
NewLocationFromKey makes a new location from a key.
func (*FileManager) ReleaseMock ¶
func (fm *FileManager) ReleaseMock()
ReleaseMock releases file upload mocking.
func (*FileManager) UploadFile ¶
UploadFile uploads a file.
func (*FileManager) UploadFileToBucket ¶
func (fm *FileManager) UploadFileToBucket(bucket string, uploadFile io.Reader, fileType FileType) (*Location, error)
UploadFileToBucket uploads a file to a given location.
Click to show internal directories.
Click to hide internal directories.