Browse Source

Add storage provider open method

feature/add-authorization
Roman Zipp 3 years ago
committed by Fabian Vowie
parent
commit
e712b52e77
No known key found for this signature in database GPG Key ID: C27317C33B27C410
  1. 4
      storage/storage.go

4
storage/storage.go

@ -50,6 +50,10 @@ func (sp FileSystemStorageProvider) GetPath(bucketName string, objectName string
return filepath.Join(sp.wd, StorageFolderName, sp.basePath, bucketName, objectName) return filepath.Join(sp.wd, StorageFolderName, sp.basePath, bucketName, objectName)
} }
func (sp FileSystemStorageProvider) OpenFile(bucketName string, objectName string) (*os.File, error) {
return os.Open(sp.GetPath(bucketName, objectName))
}
func GetFileSystemStorageProvider(basePath string, wd string) FileSystemStorageProvider { func GetFileSystemStorageProvider(basePath string, wd string) FileSystemStorageProvider {
if wd == "" { if wd == "" {
wd, _ = os.Getwd() wd, _ = os.Getwd()

Loading…
Cancel
Save