coreipfs

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoreIpfs

type CoreIpfs struct {
	// contains filtered or unexported fields
}

CoreIpfs is an implementation of HotStorage interface which saves data into a remote go-ipfs using the HTTP API.

func New

func New(ipfs iface.CoreAPI, l ffs.JobLogger) (*CoreIpfs, error)

New returns a new CoreIpfs instance.

func (*CoreIpfs) Add

func (ci *CoreIpfs) Add(ctx context.Context, r io.Reader) (cid.Cid, error)

Add adds an io.Reader data as file in the IPFS node.

func (*CoreIpfs) Get

func (ci *CoreIpfs) Get(ctx context.Context, c cid.Cid) (io.Reader, error)

Get retrieves a cid from the IPFS node.

func (*CoreIpfs) IsStored

func (ci *CoreIpfs) IsStored(ctx context.Context, c cid.Cid) (bool, error)

IsStored return if a particular Cid is stored.

func (*CoreIpfs) Remove

func (ci *CoreIpfs) Remove(ctx context.Context, c cid.Cid) error

Remove removes a Cid from the Hot Storage.

func (*CoreIpfs) Replace

func (ci *CoreIpfs) Replace(ctx context.Context, c1 cid.Cid, c2 cid.Cid) (int, error)

Replace replaces a stored Cid with other Cid.

func (*CoreIpfs) Store

func (ci *CoreIpfs) Store(ctx context.Context, c cid.Cid) (int, error)

Store stores a Cid in the HotStorage. At the IPFS level, it also mark the Cid as pinned.

Jump to

Keyboard shortcuts

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