pnet

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 2 Imported by: 69

Documentation

Overview

Deprecated: This package has moved into go-libp2p as a sub-package: github.com/libp2p/go-libp2p/core/pnet.

Package pnet provides interfaces for private networking in libp2p.

Index

Constants

View Source
const EnvKey = pnet.EnvKey

EnvKey defines environment variable name for forcing usage of PNet in libp2p When environment variable of this name is set to "1" the ForcePrivateNetwork variable will be set to true. Deprecated: use github.com/libp2p/go-libp2p/core/pnet.EnvKey instead

Variables

View Source
var ErrNotInPrivateNetwork = pnet.ErrNotInPrivateNetwork

ErrNotInPrivateNetwork is an error that should be returned by libp2p when it tries to dial with ForcePrivateNetwork set and no PNet Protector Deprecated: use github.com/libp2p/go-libp2p/core/pnet.ErrNotInPrivateNetwork instead

View Source
var ForcePrivateNetwork = pnet.ForcePrivateNetwork

ForcePrivateNetwork is boolean variable that forces usage of PNet in libp2p Setting this variable to true or setting LIBP2P_FORCE_PNET environment variable to true will make libp2p to require private network protector. If no network protector is provided and this variable is set to true libp2p will refuse to connect. Deprecated: use github.com/libp2p/go-libp2p/core/pnet.ForcePrivateNetwork instead

Functions

func IsPNetError

func IsPNetError(err error) bool

IsPNetError checks if given error is PNet Error Deprecated: use github.com/libp2p/go-libp2p/core/pnet.IsPNetError instead

func NewError

func NewError(err string) error

NewError creates new Error Deprecated: use github.com/libp2p/go-libp2p/core/pnet.NewError instead

Types

type Error

type Error = pnet.Error

Error is error type for ease of detecting PNet errors Deprecated: use github.com/libp2p/go-libp2p/core/pnet.Error instead

type PSK added in v0.5.0

type PSK = pnet.PSK

A PSK enables private network implementation to be transparent in libp2p. It is used to ensure that peers can only establish connections to other peers that are using the same PSK. Deprecated: use github.com/libp2p/go-libp2p/core/pnet.PSK instead

func DecodeV1PSK added in v0.5.0

func DecodeV1PSK(in io.Reader) (PSK, error)

DecodeV1PSK reads a Multicodec encoded V1 PSK. Deprecated: use github.com/libp2p/go-libp2p/core/pnet.DecodeV1PSK instead

Jump to

Keyboard shortcuts

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