peernet

package
v0.0.11-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT License.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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