Documentation ¶
Overview ¶
Package dspinner implements structures and methods to keep track of which objects a user wants to keep stored locally. This implementation stores pin data in a datastore.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCannotDeleteSomeBlocks = errors.New("garbage collection incomplete: could not delete some blocks")
ErrCannotDeleteSomeBlocks is returned when removing blocks marked for deletion fails as the last Result in GC output channel.
var ErrCannotFetchAllLinks = errors.New("garbage collection aborted: could not retrieve some links")
ErrCannotFetchAllLinks is returned as the last Result in the GC output channel when there was an error creating the marked set because of a problem when finding descendants.
Functions ¶
func New ¶
func New(ctx context.Context, dstore ds.Datastore, bs blockstore.Blockstore, dserv ipld.DAGService, bfOptions *ipfspinner.BloomFilterOptions) (*pinner, error)
New creates a new pinner and loads its keysets from the given datastore. If there is no data present in the datastore, then an empty pinner is returned.
By default, changes are automatically flushed to the datastore. This can be disabled by calling SetAutosync(false), which will require that Flush be called explicitly. bfOptions: bloom filter options, if nil, default options will be used,use for gc
func PrintMemUsage ¶ added in v0.2.7
func PrintMemUsage()
PrintMemUsage outputs the current, total and OS memory being used. As well as the number of garage collection cycles completed.
Types ¶
type CannotDeleteBlockError ¶
type CannotDeleteBlockError struct { Key cid.Cid Err error }
CannotDeleteBlockError provides detailed information about which blocks could not be deleted and can appear as a Result in the GC output channel.
func (*CannotDeleteBlockError) Error ¶
func (e *CannotDeleteBlockError) Error() string
Error implements the error interface for this type with a useful message.
type CannotFetchLinksError ¶
type CannotFetchLinksError struct { Key cid.Cid Err error }
CannotFetchLinksError provides detailed information about which links could not be fetched and can appear as a Result in the GC output channel.
func (*CannotFetchLinksError) Error ¶
func (e *CannotFetchLinksError) Error() string
Error implements the error interface for this type with a useful message.
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is a implementation of a set of Cids, that is, a structure to which holds a single copy of every Cids with encoded cid.Hash() with base58 that is added to it. use cid.Hash() with base58 to avoid collisions with different cid versions