Documentation ¶
Index ¶
- Variables
- func GetAddresses(protocol string, l net.Listener, includeLocal bool, includePrivate bool, ...) []string
- func GetLocalPeerAddresses(port int, includeLocal bool, includePrivate bool, includeIPV6 bool) ([]string, error)
- func Read(conn *Connection) (*object.Object, error)
- func Write(o *object.Object, conn *Connection) error
- type Connection
- type ListenConfig
- type Listener
- type Network
- type Transport
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrAllAddressesFailed for when a peer cannot be dialed ErrAllAddressesFailed = errors.New("all addresses failed to dial") // ErrNoAddresses for when a peer has no addresses ErrNoAddresses = errors.New("no addresses") // ErrNotForUs object is not meant for us ErrNotForUs = errors.New("object not for us") // ErrMissingKey when a key is not passed ErrMissingKey = errors.New("missing key") // ErrECDSAPrivateKeyRequired when a key is not an ECDSA key ErrECDSAPrivateKeyRequired = errors.New( "network currently requires an ecdsa private key", ) // ErrNonce is when the nonce does not match ErrNonce = errors.New("nonce does not match") // ErrMissingSignature is when the signature is missing ErrMissingSignature = errors.New("signature missing") // ErrAllAddressesBlocked all peer's addresses are currently blocked ErrAllAddressesBlocked = errors.New("all addresses blocked") )
View Source
var ( ErrInvalidSignature = errors.Error("invalid signature") ErrLineWasEmpty = errors.Error("line was empty") )
Functions ¶
func GetAddresses ¶
func GetAddresses( protocol string, l net.Listener, includeLocal bool, includePrivate bool, includeIPV6 bool, ) []string
GetAddresses returns the addresses the transport is listening to
Types ¶
type Connection ¶
type Connection struct { LocalPeerKey crypto.PublicKey RemotePeerKey crypto.PublicKey IsIncoming bool // contains filtered or unexported fields }
func (*Connection) Close ¶
func (c *Connection) Close() error
func (*Connection) LocalAddr ¶
func (c *Connection) LocalAddr() string
func (*Connection) RemoteAddr ¶
func (c *Connection) RemoteAddr() string
type ListenConfig ¶
type Network ¶
type Network interface { Dial( ctx context.Context, peer *peer.ConnectionInfo, ) (*Connection, error) Listen( ctx context.Context, bindAddress string, listenConfig *ListenConfig, ) (Listener, error) Accept() (*Connection, error) Addresses() []string }
Network interface
Click to show internal directories.
Click to hide internal directories.