node

package
v0.4.3-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const HighwayType = types.PeerType_HIGHWAY

HighwayType is an alias for a types.HighwayType.

View Source
const MotorType = types.PeerType_MOTOR

MotorType is an alias for a types.MotorType.

Variables

This section is empty.

Functions

func NewIPFS

func NewIPFS(ctx context.Context, opts ...Option) (common.IPFSNode, error)

NewIPFS creates a new IPFS node

Types

type Callback added in v0.3.1

type Callback = common.NodeCallback

Callback is an alias for a common.NodeCallback

type IPFS added in v0.3.1

type IPFS = common.IPFSNode

IPFS is an alias for a common.IPFSNode.

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.

func New

func New(ctx context.Context, opts ...Option) (Node, error)

It creates a new host, and then creates a new node with that host

type Option added in v0.3.1

type Option = config.Option

Options is an alias for a config.Options.

type P2P added in v0.3.1

type P2P = common.PeerNode

P2P is an alias for a common.P2PNode.

type PeerType added in v0.3.1

type PeerType = types.PeerType

PeerType is an alias for a types.PeerType.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL