host

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrUnknownTransportOption is returned when an unknown transport has been specified
	ErrUnknownTransportOption = cerr.Error("unknown transport option")
	// ErrImproperTransportOption is returned when an improper transport has been specified (e.g. 'none' with other options)
	ErrImproperTransportOption = cerr.Error("unknown improper option")
	// ErrUnknownMuxerOption is returned when an unknown muxer has been specified
	ErrUnknownMuxerOption = cerr.Error("unknown muxer option")
	// ErrImproperMuxerOption is returned when an improper muxer option format has been provided. It expects ['name', 'type']
	ErrImproperMuxerOption = cerr.Error("improper muxer option")
	// ErrUnknownSecurityOption is returned when an unknown security option has been specified
	ErrUnknownSecurityOption = cerr.Error("unknown security option")
	// ErrNilRouter is returned when a router is needed but not found
	ErrNilRouter = cerr.Error("nil router")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host struct {
	// contains filtered or unexported fields
}

Host is the gossipsub host note: lhost.Host and lrouter.Routing are interfaces

func New

func New(ctx context.Context, conf config.Config) (*Host, error)

New returns a new host note: not passing reference to config because want it to be read only.

func (*Host) Addresses

func (h *Host) Addresses() []string

Addresses returns the listening addresses of the host

func (*Host) BuildDiscoveryAndRouting

func (h *Host) BuildDiscoveryAndRouting() error

BuildDiscoveryAndRouting ...

func (*Host) BuildPubSub

func (h *Host) BuildPubSub() (*pubsub.PubSub, error)

BuildPubSub returns a pubsub service

func (*Host) BuildRPC

func (h *Host) BuildRPC(ch chan error, ps *pubsub.PubSub) error

BuildRPC returns an rpc service

func (*Host) Connect

func (h *Host) Connect(peers []string) error

Connect connects the host to the list of peers note: it expects the peers to be in IPFS form

func (*Host) ID

func (h *Host) ID() string

ID returns the host's id

func (*Host) IPFSAddresses added in v0.1.0

func (h *Host) IPFSAddresses() []string

IPFSAddresses returns the ipfs listening addresses of the host

func (*Host) RPCAddress added in v0.1.2

func (h *Host) RPCAddress() string

RPCAddress returns the host rpc address

func (*Host) Start

func (h *Host) Start(ch chan error, stop chan os.Signal) error

Start starts a new gossip host

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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