powergate: github.com/textileio/powergate/ffs/coreipfs Index | Files

package coreipfs

import "github.com/textileio/powergate/ffs/coreipfs"

Index

Package Files

coreipfs.go

type CoreIpfs Uses

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 Uses

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

New returns a new CoreIpfs instance.

func (*CoreIpfs) Add Uses

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 Uses

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

Get retrieves a cid from the IPFS node.

func (*CoreIpfs) IsStored Uses

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

IsStored return if a particular Cid is stored.

func (*CoreIpfs) Remove Uses

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

Remove removes a Cid from the Hot Storage.

func (*CoreIpfs) Replace Uses

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 Uses

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.

Package coreipfs imports 12 packages (graph) and is imported by 6 packages. Updated 2020-09-27. Refresh now. Tools for package owners.