pin

package
v0.4.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2016 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

package pin implements 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

This section is empty.

Types

type PinMode added in v0.2.2

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

type Pinner

type Pinner interface {
	IsPinned(key.Key) (string, bool, error)
	IsPinnedWithType(key.Key, string) (string, bool, error)
	Pin(context.Context, *mdag.Node, bool) error
	Unpin(context.Context, key.Key, bool) error

	// PinWithMode is for manually editing the pin structure. Use with
	// care! If used improperly, garbage collection may not be
	// successful.
	PinWithMode(key.Key, PinMode)
	// RemovePinWithMode is for manually editing the pin structure.
	// Use with care! If used improperly, garbage collection may not
	// be successful.
	RemovePinWithMode(key.Key, PinMode)

	Flush() error
	DirectKeys() []key.Key
	RecursiveKeys() []key.Key
	InternalPins() []key.Key
}

func LoadPinner

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

LoadPinner loads a pinner and its keysets from the given datastore

func NewPinner

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

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

Directories

Path Synopsis
internal
pb
Package pb is a generated protocol buffer package.
Package pb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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