Documentation
¶
Index ¶
- Variables
- func CleanupDirty(st transaction.Storage) error
- func DeletePin(ctx context.Context, st transaction.Storage, root swarm.Address) error
- func GetCollectionUUIDs(st storage.Reader) ([][]byte, error)
- func HasPin(st storage.Reader, root swarm.Address) (bool, error)
- func IsChunkPinnedInCollection(st storage.Reader, chunkAddr swarm.Address, uuid []byte) (bool, error)
- func IterateCollection(st storage.Reader, root swarm.Address, ...) error
- func IterateCollectionStats(st storage.Reader, iterateFn func(st CollectionStat) (bool, error)) error
- func NewCollection(st storage.IndexStore) (internal.PutterCloserWithReference, error)
- func Pins(st storage.Reader) ([]swarm.Address, error)
- type CollectionStat
Constants ¶
This section is empty.
Variables ¶
var ( // ErrDuplicatePinCollection is returned when attempted to pin the same file repeatedly ErrDuplicatePinCollection = errors.New("pin store: duplicate pin collection") )
Functions ¶
func CleanupDirty ¶
func CleanupDirty(st transaction.Storage) error
CleanupDirty will iterate over all the dirty collections and delete them.
func DeletePin ¶
DeletePin will delete the root pin and all the chunks that are part of this collection.
func GetCollectionUUIDs ¶ added in v2.7.0
GetCollectionUUIDs returns all collection UUIDs from pin collections.
func IsChunkPinnedInCollection ¶ added in v2.7.0
func IsChunkPinnedInCollection(st storage.Reader, chunkAddr swarm.Address, uuid []byte) (bool, error)
IsChunkPinnedInCollection checks if a chunk address is pinned under the given collection uuid.
func IterateCollection ¶
func IterateCollectionStats ¶
func NewCollection ¶
func NewCollection(st storage.IndexStore) (internal.PutterCloserWithReference, error)
NewCollection returns a putter wrapped around the passed storage. The putter will add the chunk to Chunk store if it doesn't exists within this collection. It will create a new UUID for the collection which can be used to iterate on all the chunks that are part of this collection. The root pin is only updated on successful close of this. Calls to the Putter MUST be mutex locked to prevent concurrent upload data races.
Types ¶
type CollectionStat ¶
CollectionStat is used to store some basic stats about the pinning collection