Documentation ¶
Index ¶
- func FakeNewIPFSNodes(ctx context.Context, numPeers int) []*core.IpfsNode
- func FakeNewIPFSNodesNetworked(mn mocknet.Mocknet, ctx context.Context, numPeers int, ...) []*core.IpfsNode
- func OpenIPFSRepo(ctx context.Context, path string, limited bool, swarmkey []byte) (*core.IpfsNode, error)
- func Publish(node *core.IpfsNode, topic string, data []byte) error
- func PublishPath(n *core.IpfsNode, pth path.Path) error
- func StringToCid(value string) *cid.Cid
- func StringToCid2(value string) *cid.Cid
- func Subscribe(node *core.IpfsNode, topic string, didChange func(peer peer.ID, data []byte)) (*floodsub.Subscription, error)
- type BitswapService
- func (b *BitswapService) DecodeKey(key string) (string, error)
- func (b *BitswapService) Find(subject string, num int) <-chan pstore.PeerInfo
- func (b *BitswapService) GetShardedValues(ctx context.Context, keyType string, rawKey string) ([][]byte, error)
- func (b *BitswapService) GetValue(ctx context.Context, keyType string, rawKey string) ([]byte, error)
- func (b *BitswapService) Provide(subject string) error
- func (b *BitswapService) PutShardedValues(keyType string, rawKey string, data []byte) error
- func (b *BitswapService) PutValue(keyType string, rawKey string, data []byte) error
- func (b *BitswapService) RegisterValidator(key string, validatorFunc validateFunc_t, selectFunc selectFunc_t, cache bool) error
- type FilesAPI
- func (d *FilesAPI) GetFile(path string) ([]byte, error)
- func (d *FilesAPI) GetPeerFile(owner libp2pPeer.ID, name string) ([]byte, error)
- func (d *FilesAPI) GetPeerFiles(owner libp2pPeer.ID) ([]*ipld.Link, error)
- func (d *FilesAPI) PublishPeerFiles(files []files.File) (string, error)
- func (d *FilesAPI) SaveFile(data []byte) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenIPFSRepo ¶
func StringToCid ¶
func StringToCid(value string) *cid.Cid
func StringToCid2 ¶
func StringToCid2(value string) *cid.Cid
Types ¶
type BitswapService ¶
type BitswapService struct {
// contains filtered or unexported fields
}
Find other peers around a subject. This is done by using kad-DHT.
func NewBitSwap ¶
func NewBitSwap(node *core.IpfsNode) (*BitswapService, error)
func (*BitswapService) Find ¶
func (b *BitswapService) Find(subject string, num int) <-chan pstore.PeerInfo
func (*BitswapService) GetShardedValues ¶
func (*BitswapService) Provide ¶
func (b *BitswapService) Provide(subject string) error
func (*BitswapService) PutShardedValues ¶
func (b *BitswapService) PutShardedValues(keyType string, rawKey string, data []byte) error
Sharded value means that on this key type we can have several values. The value put in here will get shared over slots
func (*BitswapService) PutValue ¶
func (b *BitswapService) PutValue(keyType string, rawKey string, data []byte) error
func (*BitswapService) RegisterValidator ¶
func (b *BitswapService) RegisterValidator(key string, validatorFunc validateFunc_t, selectFunc selectFunc_t, cache bool) error
type FilesAPI ¶
type FilesAPI struct {
// contains filtered or unexported fields
}
Simplifies all the interactions with IPFS.
func NewFilesAPI ¶
func (*FilesAPI) GetPeerFile ¶
func (*FilesAPI) GetPeerFiles ¶
func (*FilesAPI) PublishPeerFiles ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.