feat: support refreshing hash

This commit is contained in:
hexxa 2021-09-26 10:41:25 +08:00 committed by Hexxa
parent f8bb187c89
commit ec1bb36c21
11 changed files with 99 additions and 36 deletions

View file

@ -205,3 +205,12 @@ func (cl *FilesClient) ListSharings() (*http.Response, *fileshdr.SharingResp, []
}
return resp, shResp, nil
}
func (cl *FilesClient) GenerateHash(filepath string) (*http.Response, string, []error) {
return cl.r.Post(cl.url("/v1/fs/hashes/sha1")).
AddCookie(cl.token).
Send(fileshdr.GenerateHashReq{
FilePath: filepath,
}).
End()
}