external

package
v0.0.0-...-38a8f93 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerClient

type DockerClient interface {
	Start() <-chan *events.Event

	// Obtains the Docker engine max CPU cores and Memory.
	GetDockerEngineTotalResources() (int, int, int)

	// Checks the status of a container in the  Docker engine.
	CheckContainerStatus(containerID string) (container.Status, error)

	// Runs a container in the Docker engine.
	RunContainer(contConfig types.ContainerConfig) (*types.ContainerStatus, error)

	// Remove a container from the Docker engine.
	RemoveContainer(containerID string) error
}

Interface for interacting with the Docker daemon. Provides a useful wrapper, for docker API client, for simple interaction with KAGETAKA components.

type Kagetaka

type Kagetaka interface {

	// Sends a create offer message to a trader from a supplier that wants to offer its resources.
	CreateOffer(ctx context.Context, fromNode, toNode *types.Node, offer *types.Offer) error

	// Sends a refresh message from a trader to a supplier. It is used to mutually know that both are alive.
	RefreshOffer(ctx context.Context, fromTrader, toSupp *types.Node, offer *types.Offer) (bool, error)

	// Sends a update offer message from a supplier to a trader. It is used to update offer's information.
	UpdateOffer(ctx context.Context, fromSupplier, toTrader *types.Node, offer *types.Offer) error

	// Sends a remove offer message from a supplier to a trader. It means the supplier does not handle the offer anymore.
	RemoveOffer(ctx context.Context, fromSupp, toTrader *types.Node, offer *types.Offer) error

	// Sends a get message to obtain all the available offers in a trader.
	GetOffers(ctx context.Context, fromNode, toTrader *types.Node, relay bool) ([]types.AvailableOffer, error)

	// Sends a message to a neighbor trader saying that a given trader has offers available
	AdvertiseOffersNeighbor(ctx context.Context, fromTrader, toNeighborTrader, traderOffering *types.Node) error

	// Sends a launch container message to a supplier in order to deploy the container
	LaunchContainer(ctx context.Context, fromBuyer, toSupplier *types.Node, offer *types.Offer,
		containerConfig []types.ContainerConfig) ([]types.ContainerStatus, error)

	// Sends a stop container message to a supplier in order to stop the container
	StopLocalContainer(ctx context.Context, toSupplier *types.Node, containerID string) error

	// Sends a message to obtain the system configurations of an existing node. Used by joining nodes to know what are
	// the system configuration parameters and the respective values.
	ObtainConfiguration(ctx context.Context, systemsNode *types.Node) (*configuration.Configuration, error)
}

Kagetaka is the complete API/Interface for the remote client of a node.

Jump to

Keyboard shortcuts

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