Documentation ¶
Index ¶
- type IIpfsMgr
- type IpfsMgr
- func (mgr *IpfsMgr) AddIpfsDir(inputPath string) (cidPath icorepath.Path, err error)
- func (mgr *IpfsMgr) AddIpfsFile(inputPathFile string) (cidFile icorepath.Path, err error)
- func (mgr *IpfsMgr) ConnectToPeers(peers []string) error
- func (mgr *IpfsMgr) CreateNode(repoPath string) (api icore.CoreAPI, err error)
- func (mgr *IpfsMgr) CreateRepo(repoPath string) error
- func (mgr *IpfsMgr) GetIpfsDir(cidPath string, outputPath string) (err error)
- func (mgr *IpfsMgr) GetIpfsDirFromCid(cidDirectory icorepath.Path, outputPath string) (err error)
- func (mgr *IpfsMgr) GetIpfsFile(cidPath string, outputPathFile string) (err error)
- func (mgr *IpfsMgr) GetIpfsFileFromCid(cidFile icorepath.Path, outputPathFile string) (err error)
- func (mgr *IpfsMgr) GetLocalFile(path string) (files.File, error)
- func (mgr *IpfsMgr) GetLocalNode(path string) (files.Node, error)
- func (mgr *IpfsMgr) GetRepoPath() (string, error)
- func (mgr *IpfsMgr) SetupPlugins(pluginsPath string) (*loader.PluginLoader, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IIpfsMgr ¶
type IIpfsMgr interface { // AddIpfsFile upload local file to IPFS AddIpfsFile(inputPathFile string) (cidFile icorepath.Path, err error) // AddIpfsDir upload local directory to IPFS AddIpfsDir(inputPath string) (cidPath icorepath.Path, err error) // GetIpfsFile download IPFS cid file to outputPathFile GetIpfsFile(cidPath string, outputPathFile string) (err error) // GetIpfsDir download IPFS cid path to outputPath GetIpfsDir(cidPath string, outputPath string) (err error) }
type IIpfsMgr is an interface of type IpfsMgr
type IpfsMgr ¶
type IpfsMgr struct {
// contains filtered or unexported fields
}
type IpfsMgr, create repo, collect to peers, add and get ipfs files.
func NewIpfsMgr ¶
NewIpfsMgr new instance of IpfsMgr repoPath could be empty, default is ~/.ipfs
func (*IpfsMgr) AddIpfsDir ¶
AddIpfsDir add local directory to IPFS
func (*IpfsMgr) AddIpfsFile ¶
AddIpfsFile add local file to IPFS
func (*IpfsMgr) ConnectToPeers ¶
ConnectToPeers connect peers, there are default bootstrap peers. param peers could be nil or empty, or you can add your own peers.
func (*IpfsMgr) CreateNode ¶
CreateNode Creates an IPFS node and returns its coreAPI param repoPath could be empty and set to default ~/.ipfs MUST use `ipfs init` to init ~/.ipfs as a repo
func (*IpfsMgr) CreateRepo ¶
CreateRepo create and config a repo
func (*IpfsMgr) GetIpfsDir ¶
GetIpfsDir from cidPath string
func (*IpfsMgr) GetIpfsDirFromCid ¶
GetIpfsDirFromCid from cidDirectory from github.com/ipfs/interface-go-ipfs-core/path.Path
func (*IpfsMgr) GetIpfsFile ¶
GetIpfsFile from cidPath string.
func (*IpfsMgr) GetIpfsFileFromCid ¶
GetIpfsFile from cidFile from github.com/ipfs/interface-go-ipfs-core/path.Path
func (*IpfsMgr) GetLocalFile ¶
GetLocalFile read local file content ipfs File include Node interface and io.Reader io.Seeker
func (*IpfsMgr) GetLocalNode ¶
GetLocalNode get local file node ipfs Node is a common interface for files, directories and other special files
func (*IpfsMgr) GetRepoPath ¶ added in v0.9.1
func (*IpfsMgr) SetupPlugins ¶
func (mgr *IpfsMgr) SetupPlugins(pluginsPath string) (*loader.PluginLoader, error)
SetupPlugins setup repo external plugins directors and load the plugins