pin

package
v0.3.8-dev-trailers Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2015 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

package pin implemnts structures and methods to keep track of which objects a user wants to keep stored locally.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIndirectPin

func NewIndirectPin(dstore ds.Datastore) *indirectPin

Types

type ManualPinner

type ManualPinner interface {
	PinWithMode(key.Key, PinMode)
	RemovePinWithMode(key.Key, PinMode)
	Pinner
}

ManualPinner is for manually editing the pin structure Use with care! If used improperly, garbage collection may not be successful

type PinMode

type PinMode int
const (
	Recursive PinMode = iota
	Direct
	Indirect
	NotPinned
)

type Pinner

type Pinner interface {
	IsPinned(key.Key) bool
	Pin(context.Context, *mdag.Node, bool) error
	Unpin(context.Context, key.Key, bool) error
	Flush() error
	GetManual() ManualPinner
	DirectKeys() []key.Key
	IndirectKeys() map[key.Key]int
	RecursiveKeys() []key.Key
}

func LoadPinner

func LoadPinner(d ds.ThreadSafeDatastore, dserv mdag.DAGService) (Pinner, error)

LoadPinner loads a pinner and its keysets from the given datastore

func NewPinner

func NewPinner(dstore ds.ThreadSafeDatastore, serv mdag.DAGService) Pinner

NewPinner creates a new pinner using the given datastore as a backend

Jump to

Keyboard shortcuts

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