peernet

package
v0.0.0-...-3231407 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Network

type Network interface {
	// DefaultTLSConfig creates a default TLS config.
	// This config should not require client certificate verification.
	DefaultTLSConfig() *tls.Config

	// RoundTripperFor returns an HTTP round tripper which authenticates the given peer.
	// If pid is empty, the round tripper should work for any peer.
	RoundTripperFor(pid peer.ID) http.RoundTripper

	// HTTPClientFor returns an HTTP client which authenticates the given peer.
	// If pid is empty, the client should work for any peer.
	HTTPClientFor(pid peer.ID) *http.Client
}

Network provides the transport and HTTP clients for communicating with peers.

func New

func New(h host.Host) (Network, error)

New creates a new network interface for communicating with peers.

Jump to

Keyboard shortcuts

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