[#416] Use tree service to list objects

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-05-20 11:26:35 +03:00 committed by Alex Vanin
parent 7e8b57605a
commit 25477cdaf8
6 changed files with 342 additions and 35 deletions

View file

@ -33,8 +33,9 @@ type (
// ObjectsListKey is a key to find a ObjectsListCache's entry.
ObjectsListKey struct {
cid string
prefix string
cid string
prefix string
latestOnly bool
}
)
@ -103,11 +104,12 @@ func (l *ObjectsListCache) CleanCacheEntriesContainingObject(objectName string,
}
}
// CreateObjectsListCacheKey returns ObjectsListKey with the given CID and prefix.
func CreateObjectsListCacheKey(cnr cid.ID, prefix string) ObjectsListKey {
// CreateObjectsListCacheKey returns ObjectsListKey with the given CID, prefix and latestOnly flag.
func CreateObjectsListCacheKey(cnr *cid.ID, prefix string, latestOnly bool) ObjectsListKey {
p := ObjectsListKey{
cid: cnr.EncodeToString(),
prefix: prefix,
cid: cnr.EncodeToString(),
prefix: prefix,
latestOnly: latestOnly,
}
return p