Documentation ¶
Index ¶
Constants ¶
const HighwayType = types.PeerType_HIGHWAY
HighwayType is an alias for a types.HighwayType.
const MotorType = types.PeerType_MOTOR
MotorType is an alias for a types.MotorType.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Callback ¶ added in v0.3.1
type Callback = common.NodeCallback
Callback is an alias for a common.NodeCallback
type Node ¶
type Node interface { // Returning a Motor interface and an error. Host() P2P IPFS() IPFS Type() PeerType }
`Node` is an interface that has three methods: `Host`, `IPFS`, and `Type`.
The `Host` method returns a `Motor` interface and an error. The `IPFS` method returns a `Highway` interface and an error. The `Type` method returns a `Type` type.
The `Motor` interface has two methods: `Start` and `Stop`. The `Start` method returns an error. The `Stop` method returns an error.
The `Highway` interface has two methods: `Start` and @property Host - The motor that is hosting the node. @property IPFS - The IPFS node that the motor is connected to. @property {Type} Type - The type of node. This can be either a Motor or a Highway.