local

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Overview

Package local implements a ClusterDAGService that chunks and adds content to a local peer, before pinning it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAGService

type DAGService struct {
	adder.BaseDAGService
	// contains filtered or unexported fields
}

DAGService is an implementation of an adder.ClusterDAGService which puts the added blocks directly in the peers allocated to them (without sharding).

func New

func New(rpc *rpc.Client, opts api.PinOptions) *DAGService

New returns a new Adder with the given rpc Client. The client is used to perform calls to IPFS.BlockPut and Pin content on Cluster.

func (*DAGService) Add

func (dgs *DAGService) Add(ctx context.Context, node ipld.Node) error

Add puts the given node in the destination peers.

func (*DAGService) AddMany

func (dgs *DAGService) AddMany(ctx context.Context, nodes []ipld.Node) error

AddMany calls Add for every given node.

func (*DAGService) Finalize

func (dgs *DAGService) Finalize(ctx context.Context, root cid.Cid) (cid.Cid, error)

Finalize pins the last Cid added to this DAGService.

Jump to

Keyboard shortcuts

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