qipfs_http

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const FilestoreType = "ipfs"

FilestoreType uniquely identifies this filestore

Variables

This section is empty.

Functions

func NewFilesystem

func NewFilesystem(cfgMap map[string]interface{}) (cafs.Filestore, error)

NewFilesystem creates a new ipfs http path resolver from a config map with no options

Types

type FSConfig

type FSConfig struct {
	URL string // url to the ipfs api
}

FSConfig adjusts the behaviour of an FS instance

type Filestore

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

func (*Filestore) AddFile

func (fst *Filestore) AddFile(ctx context.Context, file qfs.File, pin bool) (hash string, err error)

AddFile adds a file to the top level IPFS Node

func (*Filestore) Delete

func (fst *Filestore) Delete(ctx context.Context, key string) error

func (*Filestore) Fetch

func (fst *Filestore) Fetch(ctx context.Context, source cafs.Source, key string) (qfs.File, error)

func (*Filestore) Get

func (fst *Filestore) Get(ctx context.Context, key string) (qfs.File, error)

func (*Filestore) Has

func (fst *Filestore) Has(ctx context.Context, key string) (exists bool, err error)

func (*Filestore) IPFSCoreAPI

func (fst *Filestore) IPFSCoreAPI() coreiface.CoreAPI

func (*Filestore) NewAdder

func (fst *Filestore) NewAdder(pin, wrap bool) (cafs.Adder, error)

func (*Filestore) Online

func (fst *Filestore) Online() bool

Online always returns true TODO (b5): the answer to this is more nuanced. The IPFS api may be available but not connected to p2p

func (*Filestore) Pin

func (fst *Filestore) Pin(ctx context.Context, cid string, recursive bool) error

func (*Filestore) Put

func (fst *Filestore) Put(ctx context.Context, file qfs.File) (string, error)

func (Filestore) Type

func (fst Filestore) Type() string

Type distinguishes this filesystem from others by a unique string prefix

func (*Filestore) Unpin

func (fst *Filestore) Unpin(ctx context.Context, cid string, recursive bool) error

Jump to

Keyboard shortcuts

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