servicenetwork

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsensus added in v0.6.2

func NewConsensus(network network.HostNetwork) consensus.Processor

func NewHostNetwork added in v0.6.2

func NewHostNetwork(conf configuration.Configuration, certificate core.Certificate, pulseCallback network.OnPulse) (network.HostNetwork, error)

NewHostNetwork create new HostNetwork. Certificate in new network should be removed and pulseCallback should be passed to NewNetworkController.

func NewNetworkController added in v0.6.2

func NewNetworkController(conf configuration.Configuration, network network.HostNetwork) (network.Controller, error)

NewNetworkController create new network.Controller. In new network it should read conf.

Types

type ServiceNetwork

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

ServiceNetwork is facade for network.

func NewServiceNetwork

func NewServiceNetwork(conf configuration.Configuration) (*ServiceNetwork, error)

NewServiceNetwork returns a new ServiceNetwork.

func (*ServiceNetwork) GetAddress

func (n *ServiceNetwork) GetAddress() string

GetAddress returns host public address.

func (*ServiceNetwork) GetHostNetwork added in v0.0.6

func (n *ServiceNetwork) GetHostNetwork() (hosthandler.HostHandler, hosthandler.Context)

GetHostNetwork returns pointer to host network layer(DHT), temp method, refactoring needed TODO: replace with GetNetworkHelper that returns a component with all needed data for interactive/rest API

func (*ServiceNetwork) GetNodeID added in v0.2.0

func (n *ServiceNetwork) GetNodeID() core.RecordRef

GetNodeID returns current node id.

func (*ServiceNetwork) GetPrivateKey added in v0.6.1

func (n *ServiceNetwork) GetPrivateKey() *ecdsa.PrivateKey

GetPrivateKey returns a private key. TODO: remove, use helper functions from certificate instead

func (*ServiceNetwork) RemoteProcedureRegister

func (n *ServiceNetwork) RemoteProcedureRegister(name string, method core.RemoteProcedure)

RemoteProcedureRegister registers procedure for remote call on this host.

func (*ServiceNetwork) SendCascadeMessage added in v0.2.0

func (n *ServiceNetwork) SendCascadeMessage(data core.Cascade, method string, msg core.SignedMessage) error

SendCascadeMessage sends a message from MessageBus to a cascade of nodes

func (*ServiceNetwork) SendMessage

func (n *ServiceNetwork) SendMessage(nodeID core.RecordRef, method string, msg core.SignedMessage) ([]byte, error)

SendMessage sends a message from MessageBus.

func (*ServiceNetwork) Start added in v0.0.6

func (n *ServiceNetwork) Start(ctx context.Context, components core.Components) error

Start implements core.Component

func (*ServiceNetwork) Stop added in v0.0.6

func (n *ServiceNetwork) Stop(ctx context.Context) error

Stop implements core.Component

Jump to

Keyboard shortcuts

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