mirror of
https://github.com/gmemstr/sliproad.git
synced 2024-09-20 00:21:15 +01:00
Remove old file path function.
This commit is contained in:
parent
54fe5f9c5c
commit
b90abd8779
|
@ -140,10 +140,6 @@ func (bp *BackblazeProvider) GetDirectory(path string) Directory {
|
||||||
return finalDir
|
return finalDir
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bp *BackblazeProvider) FilePath(path string) string {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (bp *BackblazeProvider) SendFile(path string, w io.Writer) (stream io.Reader, contenttype string, err error) {
|
func (bp *BackblazeProvider) SendFile(path string, w io.Writer) (stream io.Reader, contenttype string, err error) {
|
||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
// Get bucket name >:(
|
// Get bucket name >:(
|
||||||
|
|
|
@ -38,7 +38,6 @@ type FileInfo struct {
|
||||||
type FileProviderInterface interface {
|
type FileProviderInterface interface {
|
||||||
Setup(args map[string]string) (ok bool)
|
Setup(args map[string]string) (ok bool)
|
||||||
GetDirectory(path string) (directory Directory)
|
GetDirectory(path string) (directory Directory)
|
||||||
FilePath(path string) (realpath string)
|
|
||||||
SendFile(path string, writer io.Writer) (stream io.Reader, contenttype string, err error)
|
SendFile(path string, writer io.Writer) (stream io.Reader, contenttype string, err error)
|
||||||
SaveFile(file io.Reader, filename string, path string) (ok bool)
|
SaveFile(file io.Reader, filename string, path string) (ok bool)
|
||||||
ObjectInfo(path string) (exists bool, isDir bool, location string)
|
ObjectInfo(path string) (exists bool, isDir bool, location string)
|
||||||
|
@ -58,11 +57,6 @@ func (f FileProvider) GetDirectory(path string) Directory {
|
||||||
return Directory{}
|
return Directory{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FilePath returns the path to the file, whether it be a URL or local file path.
|
|
||||||
func (f FileProvider) FilePath(path string) string {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
// RemoteFile will bypass http.ServeContent() and instead write directly to the response.
|
// RemoteFile will bypass http.ServeContent() and instead write directly to the response.
|
||||||
func (f FileProvider) SendFile(path string, writer io.Writer) (stream io.Reader, contenttype string, err error) {
|
func (f FileProvider) SendFile(path string, writer io.Writer) (stream io.Reader, contenttype string, err error) {
|
||||||
return
|
return
|
||||||
|
|
|
@ -24,10 +24,6 @@ func TestFileProvider(t *testing.T) {
|
||||||
t.Errorf("Default FileProvider GetDirectory() files returned %v, expected none.", getdirectory.Files)
|
t.Errorf("Default FileProvider GetDirectory() files returned %v, expected none.", getdirectory.Files)
|
||||||
}
|
}
|
||||||
|
|
||||||
filepath := fp.FilePath(""); if filepath != "" {
|
|
||||||
t.Errorf("Default FileProvider FilePath() %v, expected nothing.", filepath)
|
|
||||||
}
|
|
||||||
|
|
||||||
savefile := fp.SaveFile(nil, "", ""); if savefile != false {
|
savefile := fp.SaveFile(nil, "", ""); if savefile != false {
|
||||||
t.Errorf("Default FileProvider SaveFile() attempted to save a file.")
|
t.Errorf("Default FileProvider SaveFile() attempted to save a file.")
|
||||||
}
|
}
|
||||||
|
@ -87,10 +83,6 @@ func TestDiskProvider(t *testing.T) {
|
||||||
t.Errorf("DiskProvider GetDirectory() files returned %v, expected 1.", getdirectory.Files)
|
t.Errorf("DiskProvider GetDirectory() files returned %v, expected 1.", getdirectory.Files)
|
||||||
}
|
}
|
||||||
|
|
||||||
filepath := dp.FilePath("testing.txt"); if filepath != DISK_TESTING_GROUNDS + "/testing.txt"{
|
|
||||||
t.Errorf("DiskProvider FilePath() returned %v, expected path.", filepath)
|
|
||||||
}
|
|
||||||
|
|
||||||
testfile := bytes.NewReader([]byte("second test file!"))
|
testfile := bytes.NewReader([]byte("second test file!"))
|
||||||
savefile := dp.SaveFile(testfile, "second_test.txt", ""); if savefile != true {
|
savefile := dp.SaveFile(testfile, "second_test.txt", ""); if savefile != true {
|
||||||
t.Errorf("DiskProvider SaveFile() could not save a file.")
|
t.Errorf("DiskProvider SaveFile() could not save a file.")
|
||||||
|
|
Loading…
Reference in a new issue