net

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicHost

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

BasicHost wraps core.Host for use by the DHT and PubSub

func New

func New(ctx context.Context, cfg *config.AppConfig) (*BasicHost, error)

New creates a new host

func NewWithHost

func NewWithHost(host core.Host) *BasicHost

NewWithHost creates an instance of BasicHost with a pre-existing host

func (*BasicHost) Addrs

func (h *BasicHost) Addrs() []multiaddr.Multiaddr

Addrs returns the addresses of the host

func (*BasicHost) FullAddr

func (h *BasicHost) FullAddr() string

FullAddr returns the full host address

func (*BasicHost) Get

func (h *BasicHost) Get() core.Host

Get returns the host object

func (*BasicHost) ID

func (h *BasicHost) ID() peer.ID

ID returns the peer ID of the host

type Host

type Host interface {
	Get() core.Host
	ID() peer.ID
	Addrs() []multiaddr.Multiaddr
	FullAddr() string
}

Host describes an object participating in a p2p network.

Directories

Path Synopsis
dht

Jump to

Keyboard shortcuts

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