Documentation ¶
Overview ¶
Package transports implements Generic interfaces for telehash transports
Transports must implement the Config and Transport interfaces. Endpoints are responsible for actually managing the transports.
e3x.New(keys, udp.Config{})
Index ¶
- Variables
- func DecodeAddr(p []byte) (net.Addr, error)
- func EncodeAddr(a net.Addr) ([]byte, error)
- func EqualAddr(a, b net.Addr) bool
- func RegisterAddr(typ AddrMarshaler)
- func RegisterResolver(network string, resolver func(addr string) (net.Addr, error))
- func ResolveAddr(network, addr string) (net.Addr, error)
- type AddrEqualer
- type AddrMarshaler
- type Config
- type Transport
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidAddr = errors.New("invalid address")
Functions ¶
func DecodeAddr ¶
DecodeAddr will decode an address from JSON. ErrInvalidAddr is returned when the address could not be decoded.
func RegisterAddr ¶
func RegisterAddr(typ AddrMarshaler)
RegisterAddr registers a marshalable address type. Addr types that are expected to be communicated through telehash must be registered here.
func RegisterResolver ¶
Types ¶
type AddrEqualer ¶
type AddrMarshaler ¶
type Transport ¶
type Transport interface { // Addrs returns all the known addresses this transport is reachable at. Addrs() []net.Addr // Dial will open a new connection to addr. // io.EOF is returned when the transport is closed. // ErrInvalidAddr must be returned when the addr is // not suppoorted by the transport. Dial(addr net.Addr) (net.Conn, error) // Accept will accept the next incomming connection. // io.EOF is returned when the transport is closed. Accept() (c net.Conn, err error) // Close closes the transport. Close() error }
Transport is an opened transport. This interface is used internally by E3X.
Directories ¶
Path | Synopsis |
---|---|
Package dgram provides a wrapper for datagram based transports like UDP.
|
Package dgram provides a wrapper for datagram based transports like UDP. |
Package inproc implements the in-process transport
|
Package inproc implements the in-process transport |
Package mux implements a transport muxer.
|
Package mux implements a transport muxer. |
Package nat privides NAT port mapping for transports that support it.
|
Package nat privides NAT port mapping for transports that support it. |
Package tcp implements the TCP transport.
|
Package tcp implements the TCP transport. |
Package udp implements the UDP transport.
|
Package udp implements the UDP transport. |
Package unix implements the UNIX domain sockets transport.
|
Package unix implements the UNIX domain sockets transport. |
Click to show internal directories.
Click to hide internal directories.