Documentation ¶
Overview ¶
Package network is now deprecated, more to networkv2
Package network is now deprecated, more to networkv2 ¶
Package network is now deprecated, more to networkv2 ¶
Package network is now deprecated, more to networkv2 ¶
Package network is now deprecated, more to networkv2
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NetAddress ¶
type NetAddress struct { IP net.IP `json:"ip"` Port uint16 `json:"port"` // contains filtered or unexported fields }
NetAddress defines information about a peer on the network including its ID, IP address, and port.
type Node ¶
type Node struct { // sendChan contains sendData used for broadcast message SendChan chan []byte // StoreFunc can be invoked when receiving broadcast message from neigbors Receive func(message string) error // contains filtered or unexported fields }
Node hold send chan and store func
type Peer ¶
type Peer interface { //service.Service FlushStop() RemoteIP() net.IP // remote IP of the connection RemoteAddr() net.Addr // remote address of the connection IsOutbound() bool // did we dial the peer IsPersistent() bool // do we redial this peer when we disconnect CloseConn() error // close original connection NodeInfo() NodeInfo // peer's info //Status() ConnectionStatus SocketAddr() *NetAddress // actual address of the socket Send(byte, []byte) bool TrySend(byte, []byte) bool Set(string, interface{}) Get(string) interface{} }
Peer defines network apis.
Click to show internal directories.
Click to hide internal directories.