node

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: Apache-2.0, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHostConfigOption

func NewHostConfigOption(hopt ipfs_p2p.HostOption, cfg *HostConfig) ipfs_p2p.HostOption

Types

type HostConfig

type HostConfig struct {
	// called after host init
	ConfigFunc HostConfigFunc

	// p2p options
	Options []p2p.Option
}

@TODO: add custom mobile option here

type HostConfigFunc

type HostConfigFunc func(p2p_host.Host) error

func ChainHostConfig

func ChainHostConfig(cfgs ...HostConfigFunc) HostConfigFunc

type HostMobile

type HostMobile struct {
	p2p_host.Host
}

type IpfsConfig

type IpfsConfig struct {
	HostConfig *HostConfig
	HostOption ipfs_p2p.HostOption

	RoutingConfig *RoutingConfig
	RoutingOption ipfs_p2p.RoutingOption

	RepoMobile *RepoMobile
	ExtraOpts  map[string]bool
}

type IpfsMobile

type IpfsMobile struct {
	*ipfs_core.IpfsNode
	Repo *RepoMobile
	// contains filtered or unexported fields
}

func NewNode

func NewNode(ctx context.Context, cfg *IpfsConfig) (*IpfsMobile, error)

func (*IpfsMobile) Close

func (im *IpfsMobile) Close() error

func (*IpfsMobile) PeerHost

func (im *IpfsMobile) PeerHost() p2p_host.Host

func (*IpfsMobile) ServeCoreHTTP

func (im *IpfsMobile) ServeCoreHTTP(l net.Listener, opts ...ipfs_corehttp.ServeOption) error

func (*IpfsMobile) ServeGateway

func (im *IpfsMobile) ServeGateway(l net.Listener, writable bool, opts ...ipfs_corehttp.ServeOption) error

type RepoConfigPatch

type RepoConfigPatch func(cfg *ipfs_config.Config) (err error)

func ChainIpfsConfigPatch

func ChainIpfsConfigPatch(patchs ...RepoConfigPatch) RepoConfigPatch

type RepoMobile

type RepoMobile struct {
	ipfs_repo.Repo

	Path string
}

func NewRepoMobile

func NewRepoMobile(path string, repo ipfs_repo.Repo) *RepoMobile

func (*RepoMobile) ApplyPatchs

func (mr *RepoMobile) ApplyPatchs(patchs ...RepoConfigPatch) error

type RoutingConfig

type RoutingConfig struct {
	ConfigFunc RoutingConfigFunc
}

type RoutingConfigFunc

type RoutingConfigFunc func(p2p_host.Host, p2p_routing.Routing) error

Jump to

Keyboard shortcuts

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