pinstore

package
v1.18.0-rc5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2023 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupDirty

func CleanupDirty(tx internal.TxExecutor) error

CleanupDirty will iterate over all the dirty collections and delete them.

func DeletePin

func DeletePin(ctx context.Context, tx internal.TxExecutor, root swarm.Address) error

DeletePin will delete the root pin and all the chunks that are part of this collection.

func HasPin

func HasPin(st storage.Store, root swarm.Address) (bool, error)

HasPin function will check if the address represents a valid pin collection.

func IterateCollection

func IterateCollection(st storage.Store, root swarm.Address, fn func(addr swarm.Address) (bool, error)) error

func IterateCollectionStats

func IterateCollectionStats(st storage.Store, iterateFn func(st CollectionStat) (bool, error)) error

func NewCollection

NewCollection returns a putter wrapped around the passed storage. The putter will add the chunk to Chunk store if it doesnt 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 Putter.

func Pins

func Pins(st storage.Store) ([]swarm.Address, error)

Pins lists all the added pinning collections.

Types

type CollectionStat

type CollectionStat struct {
	Total           uint64
	DupInCollection uint64
}

CollectionStat is used to store some basic stats about the pinning collection

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL