blankhost

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: MIT Imports: 18 Imported by: 0

README

go-libp2p-blankhost

Travis CI Discourse posts

A very thin implementation of go-libp2p-host. Does not contain any identify, relay, or NAT traversal code.

Table of Contents

Install

make install

Contribute

PRs are welcome!

Small note: If editing the Readme, please conform to the standard-readme specification.

License

MIT © Jeromy Johnson


The last gx published version of this module was: 0.3.26: QmcBTHN7uAMBdkzRoQ3n9cE7tGu8Ubd9zmahjskjTRw4Uf

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