Skip to content

Commit

Permalink
expose filemeta by authticket in wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
storybehind committed Feb 10, 2025
1 parent 1f77050 commit 3627608
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions wasmsdk/blobber.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,18 @@ func getFileMetaByName(allocationID, fileNameQuery string) ([]*sdk.ConsolidatedF
return fileMetas, nil
}

func getFileMetaByAuthTicket(allocationID, authTicket, lookupHash string) (*sdk.ConsolidatedFileMeta, error) {
allocationObj, err := getAllocation(allocationID)
if err != nil {
return nil, err
}
fileMeta, err := allocationObj.GetFileMetaFromAuthTicket(authTicket, lookupHash)
if err != nil {
return nil, err
}
return fileMeta, nil
}

// multiDownload - start multi-download operation.
// ## Inputs
// - allocationID
Expand Down
1 change: 1 addition & 0 deletions wasmsdk/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ func main() {
"terminateWorkers": terminateWorkers,
"createWorkers": createWorkers,
"getFileMetaByName": getFileMetaByName,
"getFileMetaByAuthTicket": getFileMetaByAuthTicket,
"downloadDirectory": downloadDirectory,
"cancelDownloadDirectory": cancelDownloadDirectory,
"cancelDownloadBlocks": cancelDownloadBlocks,
Expand Down

0 comments on commit 3627608

Please sign in to comment.