peer

package
v0.0.0-...-5b6cbe3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

README

Peer is a library responsible for the deployment of local Microservices and procurements of connectors for remote Microservices

API:

https://godoc.org/gitlab.com/tromos/tromos-ce/engine/peer

Documentation

Index

Constants

View Source
const (
	WebServicePort string = "6666"
)

Variables

View Source
var (
	// ErrPeer is the root of errors caused by Peer
	ErrPeer = errors.NewClass("Peer Error")

	// ErrClosed indicates that the peer is closed
	ErrClosed = ErrPeer.New("Peer is closed")

	// ErrInvalid is used when the calling arguments are wrong
	ErrInvalid = ErrPeer.New("Invalid arguments")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Manifest manifest.Manifest `validate:"required"`
	Address  string            `validate:"omitempty,ip"`
}

Config is the configuration for the Peer. If address is empty then the localhost is used instead

type Peer

type Peer struct {
	*hub.Hub
	// contains filtered or unexported fields
}

Peer is a continuous configuration process that handles the proxies

func New

func New(config Config) (peer *Peer, err error)

New sets up a new peer. Manifest is required. Address is optional.

func (*Peer) Address

func (peer *Peer) Address() string

Address returns the ip address which the peer will use to spawn microservices. The address must be the same as in the Manifest

func (*Peer) Close

func (peer *Peer) Close() error

Close terminates the peer and all the bootstrapped Proxies

func (*Peer) Coordinator

func (peer *Peer) Coordinator(name string) (coordinator.Coordinator, bool)

Coordinator returns the Coordinator corresponding to the name

func (*Peer) Coordinators

func (peer *Peer) Coordinators() []string

Coordinators return the names of the instantiated proxy Coordinators

func (*Peer) Device

func (peer *Peer) Device(name string) (device.Device, bool)

Device returns the Device corresponding to the name

func (*Peer) Devices

func (peer *Peer) Devices() []string

Devices return the names of the instantiated proxy Devices

func (*Peer) Processor

func (peer *Peer) Processor(name string) (processor.Processor, bool)

Device returns the Processor corresponding to the name

func (*Peer) Processors

func (peer *Peer) Processors() []string

Processors return the names of the instantiated proxy Processors

func (*Peer) RunWebservice

func (peer *Peer) RunWebservice() error

RunWebservice makes the peer functionality availablle through RPC

Jump to

Keyboard shortcuts

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