controller

package
v0.7.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: Apache-2.0, BSD-3-Clause-Clear Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureOptions

func ConfigureOptions(config configuration.HostNetwork) *common.Options

ConfigureOptions convert daemon configuration to controller options

func NewNetworkController

func NewNetworkController(
	pulseHandler network.PulseHandler,
	options *common.Options,
	certificate core.Certificate,
	transport network.InternalTransport,
	routingTable network.RoutingTable,
	network network.HostNetwork,
	scheme core.PlatformCryptographyScheme) network.Controller

NewNetworkController create new network controller.

Types

type Controller

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

Controller contains network logic.

func (*Controller) Bootstrap

func (c *Controller) Bootstrap(ctx context.Context) error

Bootstrap init bootstrap process: 1. Connect to discovery node; 2. Reconnect to new discovery node if redirected.

func (*Controller) GetLastIgnoredPulse added in v0.7.5

func (c *Controller) GetLastIgnoredPulse() core.PulseNumber

func (*Controller) Inject

func (c *Controller) Inject(cryptographyService core.CryptographyService,
	networkCoordinator core.NetworkCoordinator, nodeKeeper network.NodeKeeper)

Inject inject components.

func (*Controller) RemoteProcedureRegister

func (c *Controller) RemoteProcedureRegister(name string, method core.RemoteProcedure)

RemoteProcedureRegister register remote procedure that will be executed when message is received.

func (*Controller) SendCascadeMessage

func (c *Controller) SendCascadeMessage(data core.Cascade, method string, msg core.Parcel) error

SendCascadeMessage sends a message from MessageBus to a cascade of nodes.

func (*Controller) SendMessage

func (c *Controller) SendMessage(nodeID core.RecordRef, name string, msg core.Parcel) ([]byte, error)

SendParcel send message to nodeID.

func (*Controller) SetLastIgnoredPulse added in v0.7.5

func (c *Controller) SetLastIgnoredPulse(number core.PulseNumber)

type PulseController

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

func NewPulseController

func NewPulseController(pulseHandler network.PulseHandler, hostNetwork network.HostNetwork,
	routingTable network.RoutingTable) *PulseController

func (*PulseController) Start

func (pc *PulseController) Start()

type RPCController

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

func NewRPCController

func NewRPCController(options *common.Options, hostNetwork network.HostNetwork, scheme core.PlatformCryptographyScheme) *RPCController

func (*RPCController) RemoteProcedureRegister

func (rpc *RPCController) RemoteProcedureRegister(name string, method core.RemoteProcedure)

func (*RPCController) SendCascadeMessage

func (rpc *RPCController) SendCascadeMessage(data core.Cascade, method string, msg core.Parcel) error

func (*RPCController) SendMessage

func (rpc *RPCController) SendMessage(nodeID core.RecordRef, name string, msg core.Parcel) ([]byte, error)

func (*RPCController) Start

func (rpc *RPCController) Start()

type RequestCascade

type RequestCascade struct {
	TraceID string
	RPC     RequestRPC
	Cascade core.Cascade
}

type RequestRPC

type RequestRPC struct {
	Method string
	Data   [][]byte
}

type ResponseCascade

type ResponseCascade struct {
	Success bool
	Error   string
}

type ResponseRPC

type ResponseRPC struct {
	Success bool
	Result  []byte
	Error   string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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