bsnet

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: Apache-2.0, MIT Imports: 19 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ProtocolBitswapNoVers is equivalent to the legacy bitswap protocol
	ProtocolBitswapNoVers = internal.ProtocolBitswapNoVers
	// ProtocolBitswapOneZero is the prefix for the legacy bitswap protocol
	ProtocolBitswapOneZero = internal.ProtocolBitswapOneZero
	// ProtocolBitswapOneOne is the prefix for version 1.1.0
	ProtocolBitswapOneOne = internal.ProtocolBitswapOneOne
	// ProtocolBitswap is the current version of the bitswap protocol: 1.2.0
	ProtocolBitswap = internal.ProtocolBitswap
)

Functions

func NewFromIpfsHost

func NewFromIpfsHost(host host.Host, opts ...NetOpt) iface.BitSwapNetwork

NewFromIpfsHost returns a BitSwapNetwork supported by underlying IPFS host.

Types

type HasContext

type HasContext interface {
	Context() context.Context
}

type NetOpt

type NetOpt func(*Settings)

func Prefix

func Prefix(prefix protocol.ID) NetOpt

func SupportedProtocols

func SupportedProtocols(protos []protocol.ID) NetOpt

func WithConnectEventManager added in v0.33.1

func WithConnectEventManager(evm *network.ConnectEventManager) NetOpt

WithConnectEventManager allows to set the ConnectEventManager. Upon Start(), we will run SetListeners(). If not provided, an event manager will be created internally. This allows re-using the event manager among several Network instances.

type Settings

type Settings struct {
	ProtocolPrefix     protocol.ID
	SupportedProtocols []protocol.ID
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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