Documentation ¶
Index ¶
- Variables
- type FileSystemStorageProvider
- func (s *FileSystemStorageProvider) Delete(file rocketchat.File, permanentelyDelete bool) error
- func (f *FileSystemStorageProvider) Download(fileCollection string, file rocketchat.File) (string, error)
- func (f *FileSystemStorageProvider) SetTempDirectory(dir string)
- func (f *FileSystemStorageProvider) StoreType() string
- func (f *FileSystemStorageProvider) Upload(path string, filePath string, contentType string) error
- type GoogleStorageProvider
- func (s *GoogleStorageProvider) Delete(file rocketchat.File, permanentelyDelete bool) error
- func (g *GoogleStorageProvider) Download(fileCollection string, file rocketchat.File) (string, error)
- func (g *GoogleStorageProvider) SetTempDirectory(dir string)
- func (g *GoogleStorageProvider) StoreType() string
- func (g *GoogleStorageProvider) Upload(path string, filePath string, contentType string) error
- type GridFSProvider
- func (s *GridFSProvider) Delete(file rocketchat.File, permanentelyDelete bool) error
- func (g *GridFSProvider) Download(fileCollection string, file rocketchat.File) (string, error)
- func (g *GridFSProvider) SetTempDirectory(dir string)
- func (g *GridFSProvider) StoreType() string
- func (g *GridFSProvider) Upload(path string, filePath string, contentType string) error
- type Provider
- type S3Provider
- func (s *S3Provider) Delete(file rocketchat.File, permanentelyDelete bool) error
- func (s *S3Provider) Download(fileCollection string, file rocketchat.File) (string, error)
- func (s *S3Provider) SetTempDirectory(dir string)
- func (s *S3Provider) StoreType() string
- func (s *S3Provider) Upload(objectPath string, filePath string, contentType string) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is returned when a file is not found ErrNotFound = errors.New("not found") )
Functions ¶
This section is empty.
Types ¶
type FileSystemStorageProvider ¶
FileSystemStorageProvider provides methods to use the local file system as a storage provider.
func (*FileSystemStorageProvider) Delete ¶
func (s *FileSystemStorageProvider) Delete(file rocketchat.File, permanentelyDelete bool) error
func (*FileSystemStorageProvider) Download ¶
func (f *FileSystemStorageProvider) Download(fileCollection string, file rocketchat.File) (string, error)
Download downloads a file from the storage provider and moves it to the temporary file store
func (*FileSystemStorageProvider) SetTempDirectory ¶
func (f *FileSystemStorageProvider) SetTempDirectory(dir string)
SetTempDirectory allows for the setting of the directory that will be used for temporary file store during operations
func (*FileSystemStorageProvider) StoreType ¶
func (f *FileSystemStorageProvider) StoreType() string
StoreType returns the name of the store
type GoogleStorageProvider ¶
GoogleStorageProvider provides methods to use the Google Cloud Storage offering as a storage provider.
func (*GoogleStorageProvider) Delete ¶
func (s *GoogleStorageProvider) Delete(file rocketchat.File, permanentelyDelete bool) error
func (*GoogleStorageProvider) Download ¶
func (g *GoogleStorageProvider) Download(fileCollection string, file rocketchat.File) (string, error)
Download downloads a file from the storage provider and moves it to the temporary file store
func (*GoogleStorageProvider) SetTempDirectory ¶
func (g *GoogleStorageProvider) SetTempDirectory(dir string)
SetTempDirectory allows for the setting of the directory that will be used for temporary file store during operations
func (*GoogleStorageProvider) StoreType ¶
func (g *GoogleStorageProvider) StoreType() string
StoreType returns the name of the store
type GridFSProvider ¶
type GridFSProvider struct { Database string Session mongo.Session TempFileLocation string Buckets map[string]*gridfs.Bucket }
GridFSProvider provides methods to use GridFS as a storage provider.
func (*GridFSProvider) Delete ¶
func (s *GridFSProvider) Delete(file rocketchat.File, permanentelyDelete bool) error
func (*GridFSProvider) Download ¶
func (g *GridFSProvider) Download(fileCollection string, file rocketchat.File) (string, error)
Download downloads a file from the storage provider and moves it to the temporary file store
func (*GridFSProvider) SetTempDirectory ¶
func (g *GridFSProvider) SetTempDirectory(dir string)
SetTempDirectory allows for the setting of the directory that will be used for temporary file store during operations
func (*GridFSProvider) StoreType ¶
func (g *GridFSProvider) StoreType() string
StoreType returns the name of the store
type Provider ¶
type Provider interface { // StoreType returns the name of the store StoreType() string // Upload uploads a file from given path to the storage provider Upload(objectPath string, filePath string, contentType string) error // Download downloads a file from the storage provider and moves it to the temporary file store Download(fileCollection string, file rocketchat.File) (string, error) // SetTempDirectory allows for the setting of the directory that will be used for temporary file store during operations SetTempDirectory(subdir string) Delete(file rocketchat.File, permanentelyDelete bool) error }
Provider describes the basic contract provided to access a static content storage provider.
type S3Provider ¶
type S3Provider struct { Endpoint string Bucket string AccessID string AccessKey string Region string UseSSL bool TempFileLocation string }
S3Provider provides methods to use any S3 complaint provider as a storage provider.
func (*S3Provider) Delete ¶
func (s *S3Provider) Delete(file rocketchat.File, permanentelyDelete bool) error
Delete permanentely permanentely destroys an object specified by the rocketFile.Amazons3.filepath
func (*S3Provider) Download ¶
func (s *S3Provider) Download(fileCollection string, file rocketchat.File) (string, error)
Download will download the file to temp file store
func (*S3Provider) SetTempDirectory ¶
func (s *S3Provider) SetTempDirectory(dir string)
SetTempDirectory allows for the setting of the directory that will be used for temporary file store during operations
func (*S3Provider) StoreType ¶
func (s *S3Provider) StoreType() string
StoreType returns the name of the store