Documentation
¶
Index ¶
- func Await(v js.Value) (result js.Value, ok bool)
- func NewP2pTransport(p2pLocalNode *P2pLocalNode) *p2pTransport
- type P2pLocalNode
- func (pn *P2pLocalNode) Js() js.Value
- func (pn *P2pLocalNode) RegisterFoundProviders(handler func([]PeerInfo))
- func (pn *P2pLocalNode) RegisterPeerConnect(handler func(*PeerInfo))
- func (pn *P2pLocalNode) RegisterPeerDisconnect(handler func(*PeerInfo))
- func (pn *P2pLocalNode) RegisterPeerDiscover(handler func(*PeerInfo))
- type PeerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Await ¶
Await waits until the promise v has been resolved or rejected and returns the promise's result value. The boolean value ok is true if the promise has been resolved, false if it has been rejected. If v is not a promise, v itself is returned as the value and ok is true.
func NewP2pTransport ¶
func NewP2pTransport(p2pLocalNode *P2pLocalNode) *p2pTransport
NewP2pTransport returns an http.RoundTripper
Types ¶
type P2pLocalNode ¶
func NewP2pLocalNode ¶
func NewP2pLocalNode(service string, seed []byte, addrs []string, namespace string) *P2pLocalNode
NewP2pLocalNode creates a new P2pLocalNode and starts it.
func (*P2pLocalNode) Js ¶
func (pn *P2pLocalNode) Js() js.Value
func (*P2pLocalNode) RegisterFoundProviders ¶
func (pn *P2pLocalNode) RegisterFoundProviders(handler func([]PeerInfo))
func (*P2pLocalNode) RegisterPeerConnect ¶
func (pn *P2pLocalNode) RegisterPeerConnect(handler func(*PeerInfo))
func (*P2pLocalNode) RegisterPeerDisconnect ¶
func (pn *P2pLocalNode) RegisterPeerDisconnect(handler func(*PeerInfo))
func (*P2pLocalNode) RegisterPeerDiscover ¶
func (pn *P2pLocalNode) RegisterPeerDiscover(handler func(*PeerInfo))
Click to show internal directories.
Click to hide internal directories.