go-libp2p-core: github.com/libp2p/go-libp2p-core/pnet Index | Files

package pnet

import "github.com/libp2p/go-libp2p-core/pnet"

Package pnet provides interfaces for private networking in libp2p.

Index

Package Files

codec.go env.go error.go protector.go

Constants

const EnvKey = "LIBP2P_FORCE_PNET"

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.

Variables

var ErrNotInPrivateNetwork = NewError("private network was not configured but" +
    " is enforced by the environment")

ErrNotInPrivateNetwork is an error that should be returned by libp2p when it tries to dial with ForcePrivateNetwork set and no PNet Protector

var ForcePrivateNetwork = false

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.

func IsPNetError Uses

func IsPNetError(err error) bool

IsPNetError checks if given error is PNet Error

func NewError Uses

func NewError(err string) error

NewError creates new Error

type Error Uses

type Error interface {
    IsPNetError() bool
}

Error is error type for ease of detecting PNet errors

type PSK Uses

type PSK []byte

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.

func DecodeV1PSK Uses

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

DecodeV1PSK reads a Multicodec encoded V1 PSK.

Package pnet imports 7 packages (graph) and is imported by 20 packages. Updated 2020-03-08. Refresh now. Tools for package owners.