Versions in this module Expand all Collapse all v0 v0.8.6 May 28, 2024 v0.8.2 Mar 31, 2023 v0.8.1 Sep 13, 2022 v0.7.6 Feb 4, 2022 v0.7.3 Dec 16, 2019 v0.7.0 Dec 9, 2019 v0.6.22 Dec 3, 2019 v0.6.21 Nov 7, 2019 v0.6.20 Oct 21, 2019 v0.6.17 Oct 2, 2019 v0.6.15 Sep 27, 2019 v0.6.13 Sep 3, 2019 v0.6.12 Sep 2, 2019 v0.6.11 May 7, 2019 v0.6.9 Apr 30, 2019 v0.6.8 Apr 25, 2019 v0.6.7 Apr 25, 2019 v0.6.6 Apr 24, 2019 v0.6.4 Apr 7, 2019 Changes in this version + var DefaultClient = NewClient("http://localhost:8888") + var DialBanTimeout = 200 * time.Millisecond + func ConnLabel(source, target discover.NodeID) string + func GetMockerList() []string + func LookupMocker(mockerType string) func(net *Network, quit chan struct{}, nodeCount int) + type Client struct + URL string + func NewClient(url string) *Client + func (c *Client) ConnectNode(nodeID, peerID string) error + func (c *Client) CreateNode(config *adapters.NodeConfig) (*p2p.NodeInfo, error) + func (c *Client) CreateSnapshot() (*Snapshot, error) + func (c *Client) Delete(path string) error + func (c *Client) DisconnectNode(nodeID, peerID string) error + func (c *Client) Get(path string, out interface{}) error + func (c *Client) GetNetwork() (*Network, error) + func (c *Client) GetNode(nodeID string) (*p2p.NodeInfo, error) + func (c *Client) GetNodes() ([]*p2p.NodeInfo, error) + func (c *Client) LoadSnapshot(snap *Snapshot) error + func (c *Client) Post(path string, in, out interface{}) error + func (c *Client) RPCClient(ctx context.Context, nodeID string) (*rpc.Client, error) + func (c *Client) Send(method, path string, in, out interface{}) error + func (c *Client) StartNetwork() error + func (c *Client) StartNode(nodeID string) error + func (c *Client) StopNetwork() error + func (c *Client) StopNode(nodeID string) error + func (c *Client) SubscribeNetwork(events chan *Event, opts SubscribeOpts) (event.Subscription, error) + type Conn struct + One discover.NodeID + Other discover.NodeID + Up bool + func (c *Conn) String() string + type Event struct + Conn *Conn + Control bool + Msg *Msg + Node *Node + Time time.Time + Type EventType + func ControlEvent(v interface{}) *Event + func NewEvent(v interface{}) *Event + func (e *Event) String() string + type EventType string + const EventTypeConn + const EventTypeMsg + const EventTypeNode + type Expectation struct + Check func(context.Context, discover.NodeID) (bool, error) + Nodes []discover.NodeID + type Msg struct + Code uint64 + One discover.NodeID + Other discover.NodeID + Protocol string + Received bool + func (m *Msg) String() string + type MsgFilter struct + Code int64 + Proto string + type MsgFilters map[MsgFilter]struct + func NewMsgFilters(filterParam string) (MsgFilters, error) + func (m MsgFilters) Match(msg *Msg) bool + type Network struct + Conns []*Conn + Nodes []*Node + func NewNetwork(nodeAdapter adapters.NodeAdapter, conf *NetworkConfig) *Network + func (net *Network) Config() *NetworkConfig + func (net *Network) Connect(oneID, otherID discover.NodeID) error + func (net *Network) DidConnect(one, other discover.NodeID) error + func (net *Network) DidDisconnect(one, other discover.NodeID) error + func (net *Network) DidReceive(sender, receiver discover.NodeID, proto string, code uint64) error + func (net *Network) DidSend(sender, receiver discover.NodeID, proto string, code uint64) error + func (net *Network) Disconnect(oneID, otherID discover.NodeID) error + func (net *Network) Events() *event.Feed + func (net *Network) GetConn(oneID, otherID discover.NodeID) *Conn + func (net *Network) GetNode(id discover.NodeID) *Node + func (net *Network) GetNodeByName(name string) *Node + func (net *Network) GetNodes() (nodes []*Node) + func (net *Network) GetOrCreateConn(oneID, otherID discover.NodeID) (*Conn, error) + func (net *Network) InitConn(oneID, otherID discover.NodeID) (*Conn, error) + func (net *Network) Load(snap *Snapshot) error + func (net *Network) NewNodeWithConfig(conf *adapters.NodeConfig) (*Node, error) + func (net *Network) Reset() + func (net *Network) Shutdown() + func (net *Network) Snapshot() (*Snapshot, error) + func (net *Network) Start(id discover.NodeID) error + func (net *Network) StartAll() error + func (net *Network) Stop(id discover.NodeID) error + func (net *Network) StopAll() error + func (net *Network) Subscribe(events chan *Event) + type NetworkConfig struct + DefaultService string + ID string + type Node struct + Config *adapters.NodeConfig + Up bool + func (n *Node) ID() discover.NodeID + func (n *Node) MarshalJSON() ([]byte, error) + func (n *Node) NodeInfo() *p2p.NodeInfo + func (n *Node) String() string + type NodeSnapshot struct + Node Node + Snapshots map[string][]byte + type Server struct + func NewServer(network *Network) *Server + func (s *Server) ConnectNode(w http.ResponseWriter, req *http.Request) + func (s *Server) CreateNode(w http.ResponseWriter, req *http.Request) + func (s *Server) CreateSnapshot(w http.ResponseWriter, req *http.Request) + func (s *Server) DELETE(path string, handle http.HandlerFunc) + func (s *Server) DisconnectNode(w http.ResponseWriter, req *http.Request) + func (s *Server) GET(path string, handle http.HandlerFunc) + func (s *Server) GetMockers(w http.ResponseWriter, req *http.Request) + func (s *Server) GetNetwork(w http.ResponseWriter, req *http.Request) + func (s *Server) GetNode(w http.ResponseWriter, req *http.Request) + func (s *Server) GetNodes(w http.ResponseWriter, req *http.Request) + func (s *Server) JSON(w http.ResponseWriter, status int, data interface{}) + func (s *Server) LoadSnapshot(w http.ResponseWriter, req *http.Request) + func (s *Server) NodeRPC(w http.ResponseWriter, req *http.Request) + func (s *Server) OPTIONS(path string, handle http.HandlerFunc) + func (s *Server) Options(w http.ResponseWriter, req *http.Request) + func (s *Server) POST(path string, handle http.HandlerFunc) + func (s *Server) ResetNetwork(w http.ResponseWriter, req *http.Request) + func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) + func (s *Server) StartMocker(w http.ResponseWriter, req *http.Request) + func (s *Server) StartNetwork(w http.ResponseWriter, req *http.Request) + func (s *Server) StartNode(w http.ResponseWriter, req *http.Request) + func (s *Server) StopMocker(w http.ResponseWriter, req *http.Request) + func (s *Server) StopNetwork(w http.ResponseWriter, req *http.Request) + func (s *Server) StopNode(w http.ResponseWriter, req *http.Request) + func (s *Server) StreamNetworkEvents(w http.ResponseWriter, req *http.Request) + type Simulation struct + func NewSimulation(network *Network) *Simulation + func (s *Simulation) Run(ctx context.Context, step *Step) (result *StepResult) + type Snapshot struct + Conns []Conn + Nodes []NodeSnapshot + type Step struct + Action func(context.Context) error + Expect *Expectation + Trigger chan discover.NodeID + type StepResult struct + Error error + FinishedAt time.Time + NetworkEvents []*Event + Passes map[discover.NodeID]time.Time + StartedAt time.Time + type SubscribeOpts struct + Current bool + Filter string