feat: add NewHashRequest

This commit is contained in:
Derrick Hammer 2024-01-09 06:57:06 -05:00
parent 47847ea124
commit 6e34f052f3
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 10 additions and 0 deletions

View File

@ -26,6 +26,16 @@ func NewHashQuery() *HashQuery {
return &HashQuery{}
}
func NewHashRequest(hash *encoding.Multihash, kinds []types.StorageLocationType) *HashQuery {
if len(kinds) == 0 {
kinds = []types.StorageLocationType{types.StorageLocationTypeFile}
}
return &HashQuery{
hash: hash,
kinds: kinds,
}
}
func (h HashQuery) Hash() *encoding.Multihash {
return h.hash
}