Documentation
¶
Index ¶
- func MakeDefaultRoutedHost(listenPort int, priv crypto.PrivKey, useGlobalIPFSInstance bool) (host.Host, error)
- func MakeRoutedHost(listenPort int, priv crypto.PrivKey, bootstrapPeers []pstore.PeerInfo) (host.Host, error)
- func ReadFromProtectedStream(ps ProtectedStream, m Message) error
- func ReadFromReader(r io.Reader, m Message, dbg string) error
- func ReadFromStream(s net.Stream, m Message) error
- func WriteToProtectedStream(ps ProtectedStream, m Message) error
- func WriteToStream(s net.Stream, m Message) error
- func WriteToWriter(w io.Writer, m Message, dbg string) error
- type IDOutput
- type Message
- type ProtectedStream
- type RWMutex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeDefaultRoutedHost ¶
func MakeDefaultRoutedHost(listenPort int, priv crypto.PrivKey, useGlobalIPFSInstance bool) (host.Host, error)
MakeDefaultRoutedHost creates a default LibP2P host with a random peer ID listening on the given multiaddress.
func MakeRoutedHost ¶
func MakeRoutedHost(listenPort int, priv crypto.PrivKey, bootstrapPeers []pstore.PeerInfo) (host.Host, error)
MakeRoutedHost creates a LibP2P host with a random peer ID listening on the given multiaddress. It will use secio if secio is true. It will bootstrap using the provided PeerInfo
func ReadFromProtectedStream ¶
func ReadFromProtectedStream(ps ProtectedStream, m Message) error
func WriteToProtectedStream ¶
func WriteToProtectedStream(ps ProtectedStream, m Message) error
Types ¶
type IDOutput ¶
type IDOutput struct { ID string PublicKey string Addresses []string AgentVersion string ProtocolVersion string }
IDOutput Borrowed from ipfs code to parse the results of the command `ipfs id`
type Message ¶
type Message interface { proto.Marshaler proto.Unmarshaler }
Message A protobuf message
type ProtectedStream ¶
ProtectedStream A stream protected by a RWMutex
func NewProtectedStream ¶
func NewProtectedStream(s net.Stream) ProtectedStream
Click to show internal directories.
Click to hide internal directories.