Versions in this module Expand all Collapse all v1 v1.0.0 Jun 26, 2019 Changes in this version + var ErrLinuxOnly = errors.New(...) + func ExternalIP() net.IP + func RegisterServices(services Services) + type CnAdapter struct + func NewCnAdapter(services map[string]ServiceFunc) *CnAdapter + func (s *CnAdapter) Dial(dest *discover.Node) (conn net.Conn, err error) + func (s *CnAdapter) DialRPC(id discover.NodeID) (*rpc.Client, error) + func (s *CnAdapter) GetNode(id discover.NodeID) (*CnNode, bool) + func (s *CnAdapter) Name() string + func (s *CnAdapter) NewNode(config *NodeConfig) (Node, error) + type CnNode struct + ID discover.NodeID + func (sn *CnNode) Addr() []byte + func (sn *CnNode) Client() (*rpc.Client, error) + func (sn *CnNode) DisconnectPeer(destID discover.NodeID) + func (sn *CnNode) GetPeerCount() int + func (sn *CnNode) Node() *discover.Node + func (sn *CnNode) NodeInfo() *p2p.NodeInfo + func (sn *CnNode) PeersInfo() []*p2p.PeerInfo + func (sn *CnNode) ServeRPC(conn net.Conn) error + func (sn *CnNode) Server() p2p.Server + func (sn *CnNode) Services() []node.Service + func (sn *CnNode) Snapshots() (map[string][]byte, error) + func (sn *CnNode) Start(snapshots map[string][]byte) error + func (sn *CnNode) Stop() error + func (sn *CnNode) SubscribeEvents(ch chan *p2p.PeerEvent) event.Subscription + type DockerAdapter struct + func NewDockerAdapter() (*DockerAdapter, error) + func (d *DockerAdapter) Name() string + func (d *DockerAdapter) NewNode(config *NodeConfig) (Node, error) + type DockerNode struct + type ExecAdapter struct + BaseDir string + func NewExecAdapter(baseDir string) *ExecAdapter + func (e *ExecAdapter) Name() string + func (e *ExecAdapter) NewNode(config *NodeConfig) (Node, error) + type ExecNode struct + Cmd *exec.Cmd + Config *execNodeConfig + Dir string + ID discover.NodeID + Info *p2p.NodeInfo + func (n *ExecNode) Addr() []byte + func (n *ExecNode) Client() (*rpc.Client, error) + func (n *ExecNode) DisconnectPeer(destID discover.NodeID) + func (n *ExecNode) GetPeerCount() int + func (n *ExecNode) NodeInfo() *p2p.NodeInfo + func (n *ExecNode) ServeRPC(clientConn net.Conn) error + func (n *ExecNode) Snapshots() (map[string][]byte, error) + func (n *ExecNode) Start(snapshots map[string][]byte) (err error) + func (n *ExecNode) Stop() error + func (sn *ExecNode) PeersInfo() []*p2p.PeerInfo + type Node interface + Addr func() []byte + Client func() (*rpc.Client, error) + DisconnectPeer func(destID discover.NodeID) + GetPeerCount func() int + NodeInfo func() *p2p.NodeInfo + PeersInfo func() []*p2p.PeerInfo + ServeRPC func(net.Conn) error + Snapshots func() (map[string][]byte, error) + Start func(snapshots map[string][]byte) error + Stop func() error + type NodeAdapter interface + Name func() string + NewNode func(config *NodeConfig) (Node, error) + type NodeConfig struct + EnableMsgEvents bool + ID discover.NodeID + Name string + Port uint16 + PrivateKey *ecdsa.PrivateKey + Reachable func(id discover.NodeID) bool + Services []string + func RandomNodeConfig() *NodeConfig + func (n *NodeConfig) MarshalJSON() ([]byte, error) + func (n *NodeConfig) UnmarshalJSON(data []byte) error + type RPCDialer interface + DialRPC func(id discover.NodeID) (*rpc.Client, error) + type ServiceContext struct + Config *NodeConfig + NodeContext *node.ServiceContext + Snapshot []byte + type ServiceFunc func(ctx *ServiceContext) (node.Service, error) + type Services map[string]ServiceFunc + type SimAdapter struct + func NewSimAdapter(services map[string]ServiceFunc) *SimAdapter + func NewTCPAdapter(services map[string]ServiceFunc) *SimAdapter + func (s *SimAdapter) Dial(dest *discover.Node) (conn net.Conn, err error) + func (s *SimAdapter) DialMulti(dest *discover.Node) (conn []net.Conn, err error) + func (s *SimAdapter) DialRPC(id discover.NodeID) (*rpc.Client, error) + func (s *SimAdapter) GetNode(id discover.NodeID) (*SimNode, bool) + func (s *SimAdapter) Name() string + func (s *SimAdapter) NewNode(config *NodeConfig) (Node, error) + type SimNode struct + ID discover.NodeID + func (n *SimNode) DisconnectPeer(destID discover.NodeID) + func (sn *SimNode) Addr() []byte + func (sn *SimNode) Client() (*rpc.Client, error) + func (sn *SimNode) GetPeerCount() int + func (sn *SimNode) Node() *discover.Node + func (sn *SimNode) NodeInfo() *p2p.NodeInfo + func (sn *SimNode) PeersInfo() []*p2p.PeerInfo + func (sn *SimNode) ServeRPC(conn net.Conn) error + func (sn *SimNode) Server() p2p.Server + func (sn *SimNode) Services() []node.Service + func (sn *SimNode) Snapshots() (map[string][]byte, error) + func (sn *SimNode) Start(snapshots map[string][]byte) error + func (sn *SimNode) Stop() error + func (sn *SimNode) SubscribeEvents(ch chan *p2p.PeerEvent) event.Subscription + type SnapshotAPI struct + func (api SnapshotAPI) Snapshot() (map[string][]byte, error)