eventbus

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultEventbus -
	DefaultEventbus = New()
)

Functions

func Publish added in v0.9.0

func Publish(e localEvent)

Publish a local event in the Default eventbus

func Subscribe added in v0.9.0

func Subscribe() pubsub.Subscription

Subscribe to all local events on the default eventbus

Types

type Eventbus

type Eventbus interface {
	Publish(localEvent)
	Subscribe() pubsub.Subscription
}

Eventbus for passing information around the various nimona packages.

func New

func New() Eventbus

New constructs a new event bus

type NetworkAddressAdded

type NetworkAddressAdded struct {
	Address string
	// contains filtered or unexported fields
}

NetworkAddressAdded is published when the network starts listening to a new address.

type NetworkAddressRemoved

type NetworkAddressRemoved struct {
	Address string
	// contains filtered or unexported fields
}

NetworkAddressRemoved is published when the network stops listening to an existing address.

type ObjectPinned

type ObjectPinned struct {
	Hash object.Hash
	// contains filtered or unexported fields
}

ObjectPinned is published when an object is pinned.

type ObjectUnpinned

type ObjectUnpinned struct {
	Hash object.Hash
	// contains filtered or unexported fields
}

ObjectUnpinned is published when an object is unpinned.

type PeerConnectionEstablished

type PeerConnectionEstablished struct {
	PublicKey crypto.PublicKey
	// contains filtered or unexported fields
}

PeerConnectionEstablished is published when a connection is established with a peer.

type RelayAdded

type RelayAdded struct {
	Peer *peer.Peer
	// contains filtered or unexported fields
}

RelayAdded is published when a relay has been found and should be used.

type RelayRemoved

type RelayRemoved struct {
	PublicKey crypto.PublicKey
	// contains filtered or unexported fields
}

RelayRemoved is published when a relay should be removed.

Jump to

Keyboard shortcuts

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