Documentation ¶
Index ¶
- Constants
- func FindPeer(ctx context.Context, n *core.IpfsNode, pid string) (*peer.AddrInfo, error)
- func GetStreamRequestRemotePeerID(req *cmds.Request, node *core.IpfsNode) (peer.ID, bool)
- func P2PCall(ctx context.Context, n *core.IpfsNode, coreApi iface.CoreAPI, pid peer.ID, ...) ([]byte, error)
- func P2PCallStrings(ctx context.Context, n *core.IpfsNode, coreApi iface.CoreAPI, pid peer.ID, ...) ([]byte, error)
- func UnmarshalResp(body []byte) (map[string]interface{}, error)
- type BusinessError
- type Call
- type ErrorMessage
- type IoError
- type P2PRemoteCall
- type RemoteCall
Constants ¶
View Source
const P2PRemoteCallProto = "/rapi"
Variables ¶
This section is empty.
Functions ¶
func FindPeer ¶
FindPeer decodes a string-based peer id and tries to find it in the current routing table (if not connected, will retry).
func GetStreamRequestRemotePeerID ¶
GetStreamRequestRemotePeerID checks to see if current request is part of a streamedd libp2p connection, if yes, return the remote peer id, otherwise return false.
func P2PCall ¶
func P2PCall(ctx context.Context, n *core.IpfsNode, coreApi iface.CoreAPI, pid peer.ID, api string, args ...interface{}) ([]byte, error)
P2PCall is a wrapper for creating a client and calling a get If passed a nil context, a new one will be created
func P2PCallStrings ¶
func P2PCallStrings(ctx context.Context, n *core.IpfsNode, coreApi iface.CoreAPI, pid peer.ID, api string, strs ...string) ([]byte, error)
P2PCallStrings is a helper to pass string arguments to P2PCall
func UnmarshalResp ¶
Types ¶
type BusinessError ¶
type BusinessError error
type ErrorMessage ¶
type P2PRemoteCall ¶
func (*P2PRemoteCall) CallPost ¶
func (r *P2PRemoteCall) CallPost()
Click to show internal directories.
Click to hide internal directories.