Documentation ¶
Index ¶
- Constants
- Variables
- func InitRepo(repoPath, configPath string) error
- func InternalizeIPFSRepo(ipfsRepoPath, newRepoPath string) error
- func LoadIPFSPluginsOnce(path string) error
- func Migrate() error
- func NewFilesystem(ctx context.Context, cfgMap map[string]interface{}) (qfs.Filesystem, error)
- func NewFilesystemFromNode(ctx context.Context, node *core.IpfsNode) (qfs.Filesystem, error)
- type Adder
- type Filestore
- func (fst *Filestore) AddFile(file qfs.File, pin bool) (hash string, err error)
- func (fst *Filestore) Delete(ctx context.Context, key string) error
- func (fst *Filestore) Done() <-chan struct{}
- func (fst *Filestore) DoneErr() error
- func (fst *Filestore) Fetch(ctx context.Context, source cafs.Source, key string) (qfs.File, error)
- func (fst *Filestore) Get(ctx context.Context, key string) (qfs.File, error)
- func (fst *Filestore) GoOnline(ctx context.Context) error
- func (fst *Filestore) Has(ctx context.Context, key string) (exists bool, err error)
- func (fst *Filestore) IPFSCoreAPI() coreiface.CoreAPI
- func (fst Filestore) IsContentAddressedFilesystem()
- func (fst *Filestore) NewAdder(ctx context.Context, pin, wrap bool) (qfs.Adder, error)
- func (fst *Filestore) Node() *core.IpfsNodedeprecated
- func (fst *Filestore) Online() bool
- func (fst *Filestore) Pin(ctx context.Context, cid string, recursive bool) error
- func (fst *Filestore) PinsetDifference(ctx context.Context, set map[string]struct{}) (<-chan string, error)
- func (fst *Filestore) Put(ctx context.Context, file qfs.File) (key string, err error)
- func (fst Filestore) Type() string
- func (fst *Filestore) Unpin(ctx context.Context, cid string, recursive bool) error
- type StoreCfg
Constants ¶
const FilestoreType = "ipfs"
FilestoreType uniquely identifies this filestore
Variables ¶
var ErrNeedMigration = fmt.Errorf(`ipfs: need datastore migration`)
ErrNeedMigration indicates a migration must be run before qipfs can be used
var ( // ErrNoRepoPath is returned when no repo path is provided in the config ErrNoRepoPath = errors.New("must provide a repo path ('path') to initialize an ipfs filesystem") )
Functions ¶
func InitRepo ¶
InitRepo is a more specific version of the init command: github.com/ipfs/go-ipfs/cmd/ipfs/init.go it's adapted to let qri initialize a repo. This func should be maintained to reflect the ipfs master branch.
func InternalizeIPFSRepo ¶
InternalizeIPFSRepo takes an ipfsRepoPath and newRepoPath it creates a copy of the ipfs repo, moves it to the new repo path and migrates that repo it cleans up any tmp directories made, and removes the new repo if any errors occur IT DOES NOT REMOVE THE ORIGINAL REPO
func LoadIPFSPluginsOnce ¶
LoadIPFSPluginsOnce runs IPFS plugin initialization. we need to load plugins before attempting to configure IPFS, flatfs is specified as part of the default IPFS configuration, but all flatfs code is loaded as a plugin. ¯\_(ツ)_/¯
This works without anything present in the /.ipfs/plugins/ directory b/c the default plugin set is complied into go-ipfs (and subsequently, the qri binary) by default
func NewFilesystem ¶
NewFilesystem creates a new local filesystem PathResolver with no options
func NewFilesystemFromNode ¶
NewFilesystemFromNode wraps an existing IPFS node with a qfs.Filesystem
Types ¶
type Adder ¶
type Adder struct {
// contains filtered or unexported fields
}
Adder wraps a coreunix adder to conform to the cafs adder interface
type Filestore ¶
type Filestore struct {
// contains filtered or unexported fields
}
func (*Filestore) Done ¶
func (fst *Filestore) Done() <-chan struct{}
Done implements the qfs.ReleasingFilesystem interface
func (*Filestore) IPFSCoreAPI ¶
IPFSCoreAPI exposes the Filestore's CoreAPI interface
func (Filestore) IsContentAddressedFilesystem ¶ added in v0.6.0
func (fst Filestore) IsContentAddressedFilesystem()
IsContentAddressedFilesystem declares qipfs is content-addressed
func (*Filestore) PinsetDifference ¶
func (fst *Filestore) PinsetDifference(ctx context.Context, set map[string]struct{}) (<-chan string, error)
PinsetDifference returns a map of "Recursive"-pinned hashes that are not in the given set of hash keys. The returned set is a list of all data
type StoreCfg ¶
type StoreCfg struct { // embed options for creating a node core.BuildCfg // optionally just supply a node. will override everything Node *core.IpfsNode // path to a local filesystem fs repo Path string // URL is an ipfs http api address, used as a fallback if we cannot // config an ipfs filesystem. The filesystem will instead be a `ipfs_http` // filesystem. URL string // weather or not to serve the local IPFS HTTP API. does not apply when // operating over HTTP via a URL EnableAPI bool // enable experimental IPFS pubsub service. does not apply when // operating over HTTP via a URL EnablePubSub bool // DisableBootstrap will remove the bootstrap addrs from the node DisableBootstrap bool // AdditionalSwarmListeningAddrs allows you to add a list of // addresses you want the underlying libp2p swarm to listen on AdditionalSwarmListeningAddrs []string }
StoreCfg configures the datastore
func DefaultConfig ¶
DefaultConfig results in a local node that attempts to draw from the default ipfs filesotre location
Directories ¶
Path | Synopsis |
---|---|
Package coreunix is a fork of github.com/ipfs/go-ipfs/core/coreunix gx paths used: "gx/ipfs/QmUJYo4etAQqFfSS2rarFAE97eNGB8ej64YkRT2SmsYD4r/go-ipfs/pin" ipld "gx/ipfs/QmR7TcHkR9nxkUorfi8XMTAMLUK7GiP64TWWBzY3aacc1o/go-ipld-format" dag "gx/ipfs/QmSei8kFMfqdJq7Q68d2LMnHbTWKKg2daA29ezUYFAUNgc/go-merkledag" posinfo "gx/ipfs/QmQyUyYcpKG1u53V7N25qRTGw5XwaAxTMKXbduqHotQztg/go-ipfs-posinfo" core "gx/ipfs/QmUJYo4etAQqFfSS2rarFAE97eNGB8ej64YkRT2SmsYD4r/go-ipfs/core" unixfs "gx/ipfs/QmfB3oNXGGq9S4B2a9YeCajoATms3Zw2VvDm8fK7VeLSV8/go-unixfs" balanced "gx/ipfs/QmfB3oNXGGq9S4B2a9YeCajoATms3Zw2VvDm8fK7VeLSV8/go-unixfs/importer/balanced" ihelper "gx/ipfs/QmfB3oNXGGq9S4B2a9YeCajoATms3Zw2VvDm8fK7VeLSV8/go-unixfs/importer/helpers" trickle "gx/ipfs/QmfB3oNXGGq9S4B2a9YeCajoATms3Zw2VvDm8fK7VeLSV8/go-unixfs/importer/trickle" coreiface "gx/ipfs/QmUJYo4etAQqFfSS2rarFAE97eNGB8ej64YkRT2SmsYD4r/go-ipfs/core/coreapi/interface" posinfo "gx/ipfs/QmQyUyYcpKG1u53V7N25qRTGw5XwaAxTMKXbduqHotQztg/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mfs "gx/ipfs/QmUwXQs8aZ472DmXZ8uJNf7HJNKoMJQVa7RaCz7ujZ3ua9/go-mfs" chunker "gx/ipfs/QmTUTG9Jg9ZRA1EzTPGTDvnwfcfKhDMnqANnP9fe4rSjMR/go-ipfs-chunker" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" bstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" files "gx/ipfs/QmZMWMvWMVKCbHetJ4RgndbuEF1io2UpUxwQwtNjtYPzSC/go-ipfs-files"
|
Package coreunix is a fork of github.com/ipfs/go-ipfs/core/coreunix gx paths used: "gx/ipfs/QmUJYo4etAQqFfSS2rarFAE97eNGB8ej64YkRT2SmsYD4r/go-ipfs/pin" ipld "gx/ipfs/QmR7TcHkR9nxkUorfi8XMTAMLUK7GiP64TWWBzY3aacc1o/go-ipld-format" dag "gx/ipfs/QmSei8kFMfqdJq7Q68d2LMnHbTWKKg2daA29ezUYFAUNgc/go-merkledag" posinfo "gx/ipfs/QmQyUyYcpKG1u53V7N25qRTGw5XwaAxTMKXbduqHotQztg/go-ipfs-posinfo" core "gx/ipfs/QmUJYo4etAQqFfSS2rarFAE97eNGB8ej64YkRT2SmsYD4r/go-ipfs/core" unixfs "gx/ipfs/QmfB3oNXGGq9S4B2a9YeCajoATms3Zw2VvDm8fK7VeLSV8/go-unixfs" balanced "gx/ipfs/QmfB3oNXGGq9S4B2a9YeCajoATms3Zw2VvDm8fK7VeLSV8/go-unixfs/importer/balanced" ihelper "gx/ipfs/QmfB3oNXGGq9S4B2a9YeCajoATms3Zw2VvDm8fK7VeLSV8/go-unixfs/importer/helpers" trickle "gx/ipfs/QmfB3oNXGGq9S4B2a9YeCajoATms3Zw2VvDm8fK7VeLSV8/go-unixfs/importer/trickle" coreiface "gx/ipfs/QmUJYo4etAQqFfSS2rarFAE97eNGB8ej64YkRT2SmsYD4r/go-ipfs/core/coreapi/interface" posinfo "gx/ipfs/QmQyUyYcpKG1u53V7N25qRTGw5XwaAxTMKXbduqHotQztg/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mfs "gx/ipfs/QmUwXQs8aZ472DmXZ8uJNf7HJNKoMJQVa7RaCz7ujZ3ua9/go-mfs" chunker "gx/ipfs/QmTUTG9Jg9ZRA1EzTPGTDvnwfcfKhDMnqANnP9fe4rSjMR/go-ipfs-chunker" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" bstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" files "gx/ipfs/QmZMWMvWMVKCbHetJ4RgndbuEF1io2UpUxwQwtNjtYPzSC/go-ipfs-files" |