blankhost

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlankHost

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

BlankHost is the thinnest implementation of the host.Host interface

func NewBlankHost

func NewBlankHost(n network.Network, options ...Option) *BlankHost

func (*BlankHost) Addrs

func (bh *BlankHost) Addrs() []ma.Multiaddr

func (*BlankHost) Close

func (bh *BlankHost) Close() error

func (*BlankHost) ConnManager

func (bh *BlankHost) ConnManager() connmgr.ConnManager

func (*BlankHost) Connect

func (bh *BlankHost) Connect(ctx context.Context, ai peer.AddrInfo) error

func (*BlankHost) EventBus

func (bh *BlankHost) EventBus() event.Bus

func (*BlankHost) ID

func (bh *BlankHost) ID() peer.ID

func (*BlankHost) Mux

func (bh *BlankHost) Mux() protocol.Switch

TODO: i'm not sure this really needs to be here

func (*BlankHost) Network

func (bh *BlankHost) Network() network.Network

TODO: also not sure this fits... Might be better ways around this (leaky abstractions)

func (*BlankHost) NewStream

func (bh *BlankHost) NewStream(ctx context.Context, p peer.ID, protos ...protocol.ID) (network.Stream, error)

func (*BlankHost) Peerstore

func (bh *BlankHost) Peerstore() peerstore.Peerstore

func (*BlankHost) RemoveStreamHandler

func (bh *BlankHost) RemoveStreamHandler(pid protocol.ID)

func (*BlankHost) SetStreamHandler

func (bh *BlankHost) SetStreamHandler(pid protocol.ID, handler network.StreamHandler)

func (*BlankHost) SetStreamHandlerMatch

func (bh *BlankHost) SetStreamHandlerMatch(pid protocol.ID, m func(string) bool, handler network.StreamHandler)

type Option

type Option = func(cfg *config)

func WithConnectionManager

func WithConnectionManager(cmgr connmgr.ConnManager) Option

func WithEventBus

func WithEventBus(eventBus event.Bus) Option

Jump to

Keyboard shortcuts

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