Feat: auth for remote callback / Modify: use map to store hooks in filesystem

This commit is contained in:
HFO4
2019-12-30 19:08:38 +08:00
parent ca9f44c06c
commit d29b7ef6f8
15 changed files with 158 additions and 59 deletions

View File

@@ -94,7 +94,7 @@ func (fs *FileSystem) GetDownloadContent(ctx context.Context, path string) (resp
// GetContent 获取文件内容path为虚拟路径
func (fs *FileSystem) GetContent(ctx context.Context, path string) (response.RSCloser, error) {
// 触发`下载前`钩子
err := fs.Trigger(ctx, fs.BeforeFileDownload)
err := fs.Trigger(ctx, "BeforeFileDownload")
if err != nil {
util.Log().Debug("BeforeFileDownload 钩子执行失败,%s", err)
return nil, err