Documentation ¶
Overview ¶
Package simple contains simplistic implementation for the wire.Dialer and wire.Listener interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶ added in v0.10.5
type Account struct {
// contains filtered or unexported fields
}
Account is a wire account.
func NewAccount ¶ added in v0.10.5
NewAccount creates a new account.
func NewRandomAccount ¶ added in v0.10.5
NewRandomAccount generates a new random account.
type Address ¶ added in v0.10.5
type Address string
Address is a wire address.
func NewAddress ¶ added in v0.10.5
NewAddress returns a new address.
func NewRandomAddress ¶ added in v0.10.5
NewRandomAddress returns a new random peer address.
func (Address) Cmp ¶ added in v0.10.5
Cmp compares the byte representation of two addresses. For `a.Cmp(b)` returns -1 if a < b, 0 if a == b, 1 if a > b.
func (Address) MarshalBinary ¶ added in v0.10.5
MarshalBinary marshals the address to binary.
func (*Address) UnmarshalBinary ¶ added in v0.10.5
UnmarshalBinary unmarshals an address from binary.
type Dialer ¶
Dialer is a simple lookup-table based dialer that can dial known peers. New peer addresses can be added via Register().
func NewNetDialer ¶
NewNetDialer creates a new dialer with a preset default timeout for dial attempts. Leaving the timeout as 0 will result in no timeouts. Standard OS timeouts may still apply even when no timeout is selected. The network string controls the type of connection that the dialer can dial. `serializer` defines the message encoding.
func NewTCPDialer ¶
NewTCPDialer is a short-hand version of NewNetDialer for creating TCP dialers.
func NewUnixDialer ¶
NewUnixDialer is a short-hand version of NewNetDialer for creating Unix dialers.
type Listener ¶
Listener is a TCP Listener.
func NewNetListener ¶
NewNetListener creates a listener reachable under the requested address.
func NewTCPListener ¶
NewTCPListener is a short-hand version of NewNetListener for TCP listeners.
func NewUnixListener ¶
NewUnixListener is a short-hand version of NewNetListener for Unix listeners.