node

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2018 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Overview

Node package contains the main logic for a CARAVELA's node. It represents a CARAVELA's node it has a one-to-one relation with the number of daemons/machine in the system. It is the facade for all the functionality exposing it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

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

Node is the top level entry structure, facade, for all the functionality of a CARAVELA's node.

func NewNode

func NewNode(config *configuration.Configuration, overlay external.Overlay, caravelaCli external.Caravela,
	dockerClient external.DockerClient, apiServer api.Server) *Node

NewNode creates a Node object that contains all the functionality of a CARAVELA's node.

func (*Node) AddTrader

func (node *Node) AddTrader(guidBytes []byte)

func (*Node) AdvertiseOffersNeighbor

func (node *Node) AdvertiseOffersNeighbor(_ context.Context, fromTrader, toNeighborTrader, traderOffering *types.Node)

func (*Node) AvailableResourcesSim

func (node *Node) AvailableResourcesSim() types.Resources

AvailableResourcesSim returns the current available resources of the node. Note: Only available when the node is running in simulation mode.

func (*Node) Configuration

func (node *Node) Configuration(c context.Context) *configuration.Configuration

Configuration returns the system's configuration of this node.

func (*Node) CreateOffer

func (node *Node) CreateOffer(_ context.Context, fromNode *types.Node, toNode *types.Node, offer *types.Offer)

func (*Node) GetOffers

func (node *Node) GetOffers(_ context.Context, fromNode, toTrader *types.Node, relay bool) []types.AvailableOffer

func (*Node) LaunchContainers

func (node *Node) LaunchContainers(ctx context.Context, fromBuyer *types.Node, offer *types.Offer,
	containersConfigs []types.ContainerConfig) ([]types.ContainerStatus, error)

func (*Node) ListContainers

func (node *Node) ListContainers(_ context.Context) []types.ContainerStatus

func (*Node) MaximumResourcesSim

func (node *Node) MaximumResourcesSim() types.Resources

MaximumResourcesSim returns the maximum available resources of the node. Note: Only available when the node is running in simulation mode.

func (*Node) RefreshOffer

func (node *Node) RefreshOffer(_ context.Context, fromTrader *types.Node, offer *types.Offer) bool

func (*Node) RefreshOffersSim

func (node *Node) RefreshOffersSim()

RefreshOffersSim triggers the inner actions to refresh all the offers that the node is handling. Note: Only available when the node is running in simulation mode.

func (*Node) RemoveOffer

func (node *Node) RemoveOffer(_ context.Context, fromSupp *types.Node, toTrader *types.Node, offer *types.Offer)

func (*Node) SpreadOffersSim

func (node *Node) SpreadOffersSim()

SpreadOffersSim triggers the inner actions to spread the offers that the node is handling. Note: Only available when the node is running in simulation mode.

func (*Node) Start

func (node *Node) Start(join bool, joinIP string) error

Start the node's functions. If the node is joining an instance of CARAVELA's it is called with join as true and the joinIP contains the IP address of a node that already belongs to the CARAVELA's instance.

func (*Node) Stop

func (node *Node) Stop(ctx context.Context)

Stop the node's functions.

func (*Node) StopContainers

func (node *Node) StopContainers(ctx context.Context, containersIDs []string) error

func (*Node) StopLocalContainer

func (node *Node) StopLocalContainer(_ context.Context, containerID string) error

func (*Node) SubmitContainers

func (node *Node) SubmitContainers(ctx context.Context, containerConfigs []types.ContainerConfig) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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