Modify: split hooks into small modules

This commit is contained in:
HFO4
2019-11-26 11:42:26 +08:00
parent 451bdb4ee1
commit 0cb80f69f5
11 changed files with 191 additions and 53 deletions

View File

@@ -12,7 +12,7 @@ import (
type Handler struct{}
// Put 将文件流保存到指定目录
func (handler Handler) Put(ctx context.Context, file io.ReadCloser, dst string) error {
func (handler Handler) Put(ctx context.Context, file io.ReadCloser, dst string, size uint64) error {
defer file.Close()
// 如果目标目录不存在,创建

View File

@@ -34,7 +34,7 @@ func TestHandler_Put(t *testing.T) {
}
for _, testCase := range testCases {
err := handler.Put(ctx, testCase.file, testCase.dst)
err := handler.Put(ctx, testCase.file, testCase.dst, 15)
if testCase.err {
asserts.Error(err)
} else {