Documentation
¶
Overview ¶
Package pinning provides a simple set of operations for tracking pinned references.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTraversal = errors.New("traversal iteration failed")
ErrTraversal signals that errors occurred during nodes traversal.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface {
// CreatePin creates a new pin for the given reference.
// The boolean arguments specifies whether all nodes
// in the tree should also be traversed and pinned.
// Repeating calls of this method are idempotent.
CreatePin(context.Context, swarm.Address, bool) error
// DeletePin deletes given reference. All the existing
// nodes in the tree will also be traversed and un-pinned.
// Repeating calls of this method are idempotent.
DeletePin(context.Context, swarm.Address) error
// HasPin returns true if the given reference has root pin.
HasPin(swarm.Address) (bool, error)
// Pins return all pinned references.
Pins() ([]swarm.Address, error)
}
Interface defines pinning operations.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is implementation of the pinning.Interface.
func NewService ¶
func NewService( pinStorage storage.Storer, rhStorage storage.StateStorer, traverser traversal.Traverser, ) *Service
NewService is a convenient constructor for Service.
Click to show internal directories.
Click to hide internal directories.