From baaa9a77382c1726639b40ff6551a92e30d76575 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 26 Jul 2021 08:42:54 +0300 Subject: [PATCH] add BlockstoreSize trait for reporting size --- blockstore/blockstore.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blockstore/blockstore.go b/blockstore/blockstore.go index 97f9f5f7b..43e6cd1a4 100644 --- a/blockstore/blockstore.go +++ b/blockstore/blockstore.go @@ -40,6 +40,11 @@ type BlockstoreGC interface { CollectGarbage() error } +// BlockstoreSize is a trait for on-disk blockstores that can report their size +type BlockstoreSize interface { + Size() (int64, error) +} + // WrapIDStore wraps the underlying blockstore in an "identity" blockstore. // The ID store filters out all puts for blocks with CIDs using the "identity" // hash function. It also extracts inlined blocks from CIDs using the identity