Documentation
¶
Index ¶
- func LoadPrivateKey(path string) (crypto.PrivKey, error)
- type Network
- func (n *Network) AnnounceFile(id string) error
- func (n *Network) AnnounceToPeers(nodeID, address string)
- func (n *Network) ConnectToBootstrapNodes()
- func (n *Network) ConnectToPeer(addr string) (err error)
- func (n *Network) FindFile(id string) ([]peer.AddrInfo, error)
- func (n *Network) FindPeer(peerID string) (peer.AddrInfo, error)
- func (n *Network) GetHost() host.Host
- func (n *Network) RequestFile(peerID peer.ID, protocolID protocol.ID, cid string) error
- func (n *Network) RetrieveFile(cid, outputPath string) error
- func (n *Network) SendMessage(peerID peer.ID, protocolID protocol.ID, msg string) (err error)
- func (n *Network) ShareFile(path string) (cid string, err error)
- func (n *Network) Shutdown() error
- func (n *Network) StartSimpleProtocol(protocolID protocol.ID)
- type Node
- type NodeRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
func NewNetwork ¶
func (*Network) AnnounceFile ¶
func (*Network) AnnounceToPeers ¶
func (*Network) ConnectToBootstrapNodes ¶
func (n *Network) ConnectToBootstrapNodes()
func (*Network) ConnectToPeer ¶
func (*Network) RequestFile ¶
func (*Network) RetrieveFile ¶
func (*Network) SendMessage ¶
func (*Network) StartSimpleProtocol ¶
type NodeRegistry ¶
type NodeRegistry struct {
// contains filtered or unexported fields
}
func NewNodeRegistry ¶
func NewNodeRegistry() *NodeRegistry
func (*NodeRegistry) GetAllNodes ¶
func (nr *NodeRegistry) GetAllNodes() []Node
func (*NodeRegistry) RegisterNode ¶
func (nr *NodeRegistry) RegisterNode(node Node)
Click to show internal directories.
Click to hide internal directories.