Documentation
¶
Overview ¶
Package ipfsutil contains helpers around IPFS (logging, datastore, networking, core API, ...).
Index ¶
- func CreateBuildConfig(opts *CoreAPIConfig) (*ipfs_node.BuildCfg, error)
- func CreateRepo(dstore ipfs_datastore.Batching, opts *CoreAPIConfig) (ipfs_repo.Repo, error)
- func NewConfigurableCoreAPI(ctx context.Context, bcfg *ipfs_node.BuildCfg, opts ...CoreAPIOption) (ipfs_interface.CoreAPI, *ipfs_core.IpfsNode, error)
- func NewCoreAPI(ctx context.Context, cfg *CoreAPIConfig, opts ...CoreAPIOption) (ipfs_interface.CoreAPI, *ipfs_core.IpfsNode, error)
- func NewDatastoreKeystore(ds datastore.Datastore) keystore.Keystore
- func NewNamespacedDatastore(child ds.Datastore, prefix ds.Key) ds.Batching
- func NewTinderRouting(logger *zap.Logger, rdvpeer *peer.AddrInfo, dhtclient bool) (ipfs_p2p.RoutingOption, <-chan *RoutingOut)
- func OptionMDNSDiscovery(ctx context.Context, node *ipfs_core.IpfsNode, api ipfs_interface.CoreAPI) error
- func ParseAndResolveIpfsAddr(ctx context.Context, addr string) (*peer.AddrInfo, error)
- func TestingRDVP(ctx context.Context, t testing.TB, h host.Host) (*rendezvous.RendezvousService, func())
- func TestingRepo(t testing.TB) ipfs_repo.Repo
- type CoreAPIConfig
- type CoreAPIMock
- type CoreAPIOption
- type DiscoveryNotifee
- type RoutingOut
- type TestingAPIOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBuildConfig ¶ added in v2.53.1
func CreateBuildConfig(opts *CoreAPIConfig) (*ipfs_node.BuildCfg, error)
func CreateRepo ¶
func CreateRepo(dstore ipfs_datastore.Batching, opts *CoreAPIConfig) (ipfs_repo.Repo, error)
func NewConfigurableCoreAPI ¶
func NewConfigurableCoreAPI(ctx context.Context, bcfg *ipfs_node.BuildCfg, opts ...CoreAPIOption) (ipfs_interface.CoreAPI, *ipfs_core.IpfsNode, error)
NewConfigurableCoreAPI returns an IPFS CoreAPI from a provided ipfs_node.BuildCfg
func NewCoreAPI ¶ added in v2.53.1
func NewCoreAPI(ctx context.Context, cfg *CoreAPIConfig, opts ...CoreAPIOption) (ipfs_interface.CoreAPI, *ipfs_core.IpfsNode, error)
func NewNamespacedDatastore ¶
func NewTinderRouting ¶ added in v2.50.0
func NewTinderRouting(logger *zap.Logger, rdvpeer *peer.AddrInfo, dhtclient bool) (ipfs_p2p.RoutingOption, <-chan *RoutingOut)
func OptionMDNSDiscovery ¶
func ParseAndResolveIpfsAddr ¶ added in v2.53.1
parseIpfsAddr is a function that takes in addr string and return ipfsAddrs
func TestingRDVP ¶ added in v2.50.0
func TestingRDVP(ctx context.Context, t testing.TB, h host.Host) (*rendezvous.RendezvousService, func())
Types ¶
type CoreAPIConfig ¶ added in v2.53.1
type CoreAPIConfig struct { Datastore ipfs_datastore.Batching BootstrapAddrs []string SwarmAddrs []string ExtraLibp2pOption p2p.Option Routing ipfs_libp2p.RoutingOption }
type CoreAPIMock ¶
type CoreAPIMock interface { ipfs_interface.CoreAPI Tinder() tinder.Driver MockNetwork() libp2p_mocknet.Mocknet MockNode() *ipfs_core.IpfsNode Close() }
CoreAPIMock implements ipfs.CoreAPI and adds some debugging helpers
func TestingCoreAPI ¶
func TestingCoreAPI(ctx context.Context, t testing.TB) (CoreAPIMock, func())
TestingCoreAPI returns a fully initialized mocked Core API. If you want to do some tests involving multiple peers you should use `TestingCoreAPIUsingMockNet` with the same mocknet instead.
func TestingCoreAPIUsingMockNet ¶
func TestingCoreAPIUsingMockNet(ctx context.Context, t testing.TB, opts *TestingAPIOpts) (api CoreAPIMock, cleanup func())
TestingCoreAPIUsingMockNet returns a fully initialized mocked Core API with the given mocknet
type CoreAPIOption ¶ added in v2.53.1
type DiscoveryNotifee ¶
type DiscoveryNotifee struct {
// contains filtered or unexported fields
}
func (*DiscoveryNotifee) HandlePeerFound ¶
func (n *DiscoveryNotifee) HandlePeerFound(pi peer.AddrInfo)
type TestingAPIOpts ¶ added in v2.50.0
type TestingAPIOpts struct { Mocknet libp2p_mocknet.Mocknet RDVPeer peer.AddrInfo }
Click to show internal directories.
Click to hide internal directories.