ipfsutil

package
v2.37.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: Apache-2.0, MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureLogger

func ConfigureLogger(filter string, logger *zap.Logger, logLevel string) error

func CreateBuildConfigWithDatastore

func CreateBuildConfigWithDatastore(opts *BuildOpts, ds ipfs_datastore.Batching) (*ipfs_node.BuildCfg, error)

func CreateRepo

func CreateRepo(dstore ipfs_datastore.Batching, opts *BuildOpts) (ipfs_repo.Repo, error)

func NewConfigurableCoreAPI

func NewConfigurableCoreAPI(ctx context.Context, cfg *ipfs_node.BuildCfg, options ...NewAPIOption) (ipfs_interface.CoreAPI, *ipfs_core.IpfsNode, error)

NewConfigurableCoreAPI returns an IPFS CoreAPI from a provided ipfs_node.BuildCfg

func NewDatastoreKeystore

func NewDatastoreKeystore(ds datastore.Datastore) keystore.Keystore

func NewInMemoryCoreAPI

func NewInMemoryCoreAPI(ctx context.Context, listeners ...string) (ipfs_interface.CoreAPI, *ipfs_core.IpfsNode, error)

NewInMemoryCoreAPI returns an IPFS CoreAPI based on an opininated ipfs_node.BuildCfg

func NewNamespacedDatastore

func NewNamespacedDatastore(child ds.Datastore, prefix ds.Key) ds.Batching

func OptionMDNSDiscovery

func OptionMDNSDiscovery(ctx context.Context, node *ipfs_core.IpfsNode, api ipfs_interface.CoreAPI) error

func TestingRepo added in v2.31.1

func TestingRepo(t testing.TB) ipfs_repo.Repo

Types

type BuildOpts

type BuildOpts struct {
	SwarmAddresses []string
}

type CoreAPIMock

type CoreAPIMock interface {
	ipfs_interface.CoreAPI

	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

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, m libp2p_mocknet.Mocknet) CoreAPIMock

TestingCoreAPIUsingMockNet returns a fully initialized mocked Core API with the given mocknet

type DiscoveryNotifee

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

func (*DiscoveryNotifee) HandlePeerFound

func (n *DiscoveryNotifee) HandlePeerFound(pi peer.AddrInfo)

Jump to

Keyboard shortcuts

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