Documentation ¶
Overview ¶
Package tcp provides the internode communication network layer.
Index ¶
Constants ¶
const ( // DefaultTimeout is the default length of time to wait for first byte. DefaultTimeout = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
Addr string `json:"address"`
}
Address is a struct for holding network addresses
type Dialer ¶
type Dialer struct {
// contains filtered or unexported fields
}
Dialer supports dialing a cluster service.
type InterfaceDetail ¶
type InterfaceDetail struct { Flags string `json:"flags"` HardwareAddress string `json:"hardware_address"` Addresses []Address `json:"addresses"` }
InterfaceDetail is a struct for holding network interface details
type InterfaceStats ¶
type InterfaceStats map[string]InterfaceDetail
InterfaceStats is a map of network interface names to InterfaceDetail
type Layer ¶
type Layer struct {
// contains filtered or unexported fields
}
Layer represents the connection between nodes. It can be both used to make connections to other nodes (client), and receive connections from other nodes (server)
type Mux ¶
type Mux struct { // The amount of time to wait for the first header byte. Timeout time.Duration // Out-of-band error logger Logger *log.Logger // contains filtered or unexported fields }
Mux multiplexes a network connection.
func NewMutualTLSMux ¶ added in v8.13.3
NewMutualTLSMux returns a new instance of Mux for ln, and encrypts all traffic using TLS. The server will also verify the client's certificate.
func NewMux ¶
NewMux returns a new instance of Mux for ln. If adv is nil, then the addr of ln is used.
func NewTLSMux ¶
func NewTLSMux(ln net.Listener, adv net.Addr, cert, key, caCert string, insecure, mutual bool) (*Mux, error)
NewTLSMux returns a new instance of Mux for ln, and encrypts all traffic using TLS. If adv is nil, then the addr of ln is used. If insecure is true, then the server will not verify the client's certificate. If mutual is true, then the server will require the client to present a trusted certificate.
func (*Mux) Listen ¶
Listen returns a Listener associated with the given header. Any connection accepted by mux is multiplexed based on the initial header byte.
type NameAddress ¶
type NameAddress struct {
Address string
}
NameAddress wraps a string and implements the net.Listener interface.
func (NameAddress) Network ¶
func (n NameAddress) Network() string
Network returns the network type. Always returns "tcp".
type NetworkReporter ¶
type NetworkReporter struct{}
NetworkReporter is a reporter for network information
func (NetworkReporter) Stats ¶
func (n NetworkReporter) Stats() (map[string]interface{}, error)
Stats returns network interface details