-
-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update the service to improve the test coverage && support …
- Loading branch information
Showing
15 changed files
with
662 additions
and
428 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package disk | ||
|
||
import ( | ||
"fmt" | ||
"net/http" | ||
) | ||
|
||
type MockProvider struct { | ||
} | ||
|
||
func (m MockProvider) SignedPutURL(key, filetype string, public bool) (url string, headers http.Header, err error) { | ||
headers = make(http.Header) | ||
headers.Add("", "") | ||
return fmt.Sprintf("http://dl.test.com/%s", key), headers, nil | ||
} | ||
|
||
func (m MockProvider) SignedGetURL(key, filename string) (url string, err error) { | ||
return fmt.Sprintf("http://dl.test.com/%s", key), nil | ||
} | ||
|
||
func (m MockProvider) PublicURL(key string) (url string) { | ||
return fmt.Sprintf("http://dl.test.com/%s", key) | ||
} | ||
|
||
func (m MockProvider) ObjectDelete(key string) error { | ||
return nil | ||
} | ||
|
||
func (m MockProvider) ObjectsDelete(keys []string) error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package fakefs | ||
|
||
import "github.com/saltbo/zpan/service" | ||
|
||
type FakeFS struct { | ||
service.Folder | ||
service.File | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.