mirror of
https://github.com/libp2p/go-libp2p-core.git
synced 2025-01-15 02:30:05 +08:00
16 lines
522 B
Go
16 lines
522 B
Go
// Package pnet provides interfaces for private networking in libp2p.
|
|
package pnet
|
|
|
|
import "net"
|
|
|
|
// Protector interface is a way for private network implementation to be transparent in
|
|
// libp2p. It is created by implementation and use by libp2p-conn to secure connections
|
|
// so they can be only established with selected number of peers.
|
|
type Protector interface {
|
|
// Wraps passed connection to protect it
|
|
Protect(net.Conn) (net.Conn, error)
|
|
|
|
// Returns key fingerprint that is safe to expose
|
|
Fingerprint() []byte
|
|
}
|