Documentation ¶
Index ¶
- Variables
- type CoreIpfs
- func (ci *CoreIpfs) GCStaged(ctx context.Context, exclude []cid.Cid, olderThan time.Time) ([]cid.Cid, error)
- func (ci *CoreIpfs) Get(ctx context.Context, c cid.Cid) (io.Reader, error)
- func (ci *CoreIpfs) IsPinned(ctx context.Context, iid ffs.APIID, c cid.Cid) (bool, error)
- func (ci *CoreIpfs) Pin(ctx context.Context, iid ffs.APIID, c cid.Cid) (int, error)
- func (ci *CoreIpfs) PinnedCids(ctx context.Context) ([]ffs.PinnedCid, error)
- func (ci *CoreIpfs) Replace(ctx context.Context, iid ffs.APIID, c1 cid.Cid, c2 cid.Cid) (int, error)
- func (ci *CoreIpfs) Stage(ctx context.Context, iid ffs.APIID, r io.Reader) (cid.Cid, error)
- func (ci *CoreIpfs) StageCid(ctx context.Context, iid ffs.APIID, c cid.Cid) error
- func (ci *CoreIpfs) Unpin(ctx context.Context, iid ffs.APIID, c cid.Cid) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnpinnedCid indicates that the operation failed because // the provided cid is unpinned. ErrUnpinnedCid = errors.New("can't unpin an unpinned cid") // ErrReplaceFromNotPinned indicates that the source cid to be replaced // isn't pinned. ErrReplaceFromNotPinned = errors.New("c1 isn't pinned") )
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 (*CoreIpfs) GCStaged ¶ added in v1.2.2
func (ci *CoreIpfs) GCStaged(ctx context.Context, exclude []cid.Cid, olderThan time.Time) ([]cid.Cid, error)
GCStaged unpins Cids that are only pinned by Stage() calls and all pins satisfy the filters.
func (*CoreIpfs) Pin ¶ added in v1.2.2
Pin a cid for an APIID. If the cid was already pinned by a stage from APIID, the Cid is considered fully-pinned and not a candidate to be unpinned by GCStaged().
func (*CoreIpfs) PinnedCids ¶ added in v1.2.2
PinnedCids return detailed information about pinned cids.
func (*CoreIpfs) Replace ¶
func (ci *CoreIpfs) Replace(ctx context.Context, iid ffs.APIID, c1 cid.Cid, c2 cid.Cid) (int, error)
Replace moves the pin from c1 to c2. If c2 was already pinned from a stage, it's considered fully-pinned and not GCable.
func (*CoreIpfs) Stage ¶ added in v1.2.2
Stage adds the data of io.Reader in the storage, and creates a stage-pin on the resulting cid.
Click to show internal directories.
Click to hide internal directories.