controller

package
v0.7.4-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 28, 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(net network.HostNetwork) network.Controller

NewNetworkController create new network controller.

Types

type Controller

type Controller struct {
	Bootstrapper  bootstrap.NetworkBootstrapper `inject:""`
	RPCController RPCController                 `inject:""`
	// 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) 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)

func (*Controller) Start added in v0.7.5

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

Inject inject components.

type PulseController

type PulseController interface {
	component.Starter
}

func NewPulseController

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

type RPCController

type RPCController interface {
	component.Starter

	// hack for DI, else we receive ServiceNetwork injection in RPCController instead of rpcController that leads to stack overflow
	IAmRPCController()

	SendMessage(nodeID core.RecordRef, name string, msg core.Parcel) ([]byte, error)
	SendCascadeMessage(data core.Cascade, method string, msg core.Parcel) error
	RemoteProcedureRegister(name string, method core.RemoteProcedure)
}

func NewRPCController

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

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