Documentation ¶
Index ¶
- Constants
- func Add(node StoragePeer, k []byte, r io.Reader, cb cid.Builder, l layout) (ipld.Node, error)
- func AddStream(node StoragePeer, k []byte, r io.Reader, hfunc string) (ipld.Node, error)
- func ConfigureCrdt(sp StoragePeer, topicName string, crdtOpts *crdt.Options) (*crdt.Datastore, error)
- func CreateDagServices(base core.LibP2PPeer) (ipld.DAGService, blockservice.BlockService, blockstore.Blockstore, error)
- func CreateOfflineDagServices(base core.LibP2PPeer) (ipld.DAGService, blockservice.BlockService, blockstore.Blockstore, error)
- func Get(node StoragePeer, c cid.Cid) (ufsio.ReadSeekCloser, error)
- func GetBytes(node StoragePeer, c cid.Cid) ([]byte, error)
- func NewDagSyncer(base ipld.DAGService, bs blockstore.Blockstore) *dagSyncer
- func Session(sp StoragePeer) ipld.NodeGetter
- func SetupReprovider(base core.LibP2PPeer, bstore blockstore.Blockstore, ...) (provider.System, error)
- type StoragePeer
Constants ¶
View Source
const ( Chunker string = "" DefaultHashFunc = "sha2-256" )
Variables ¶
This section is empty.
Functions ¶
func Add ¶
Add chunks and adds content to the DAGService from a reader. Data is stored as a UnixFS DAG (default for IPFS). returs the root ipld.Node
func ConfigureCrdt ¶
func CreateDagServices ¶
func CreateDagServices(base core.LibP2PPeer) (ipld.DAGService, blockservice.BlockService, blockstore.Blockstore, error)
func CreateOfflineDagServices ¶
func CreateOfflineDagServices(base core.LibP2PPeer) (ipld.DAGService, blockservice.BlockService, blockstore.Blockstore, error)
func Get ¶
func Get(node StoragePeer, c cid.Cid) (ufsio.ReadSeekCloser, error)
Get returns a reader to a file (must be a UnixFS DAG) as identified by its root CID.
func GetBytes ¶
func GetBytes(node StoragePeer, c cid.Cid) ([]byte, error)
Get returns a reader to a file (must be a UnixFS DAG) as identified by its root CID.
func NewDagSyncer ¶
func NewDagSyncer(base ipld.DAGService, bs blockstore.Blockstore) *dagSyncer
func Session ¶
func Session(sp StoragePeer) ipld.NodeGetter
Session returns a session-based NodeGetter.
func SetupReprovider ¶
func SetupReprovider(base core.LibP2PPeer, bstore blockstore.Blockstore, reprovideInterval time.Duration) (provider.System, error)
Types ¶
type StoragePeer ¶
type StoragePeer interface { core.LibP2PPeer DagService() ipld.DAGService BlockService() blockservice.BlockService Reprovider() provider.System }
func NewStoragePeer ¶
func NewStoragePeer(base *core.BasePeer, offline bool) StoragePeer
Click to show internal directories.
Click to hide internal directories.