Documentation ¶
Overview ¶
Node package contains the main logic for a KAGETAKA's node. It represents a KAGETAKA'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 ¶
- type Node
- func (n *Node) AddTrader(guidBytes []byte)
- func (n *Node) AdvertiseOffersNeighbor(ctx context.Context, fromTrader, toNeighborTrader, traderOffering *types.Node)
- func (n *Node) Configuration(c context.Context) *configuration.Configuration
- func (n *Node) CreateOffer(ctx context.Context, fromNode *types.Node, toNode *types.Node, ...)
- func (n *Node) DebugSizeBytes() int
- func (n *Node) GUID() string
- func (n *Node) GetOffers(ctx context.Context, fromNode, toTrader *types.Node, relay bool) []types.AvailableOffer
- func (n *Node) GetSystemPartitionsState() *partitions.SystemResourcePartitions
- func (n *Node) LaunchContainers(ctx context.Context, fromBuyer *types.Node, offer *types.Offer, ...) ([]types.ContainerStatus, error)
- func (n *Node) ListContainers(_ context.Context) []types.ContainerStatus
- func (n *Node) NodeInformationSim() (types.Resources, types.Resources, int, int)
- func (n *Node) RefreshOffer(ctx context.Context, fromTrader *types.Node, offer *types.Offer) bool
- func (n *Node) RefreshOffersSim()
- func (n *Node) RemoveOffer(ctx context.Context, fromSupp *types.Node, toTrader *types.Node, ...)
- func (n *Node) SpreadOffersSim()
- func (n *Node) Start(join bool, joinIP string) error
- func (n *Node) Stop(ctx context.Context)
- func (n *Node) StopContainers(ctx context.Context, containersIDs []string) error
- func (n *Node) StopLocalContainer(ctx context.Context, containerID string) error
- func (n *Node) SubmitContainers(ctx context.Context, containerConfigs []types.ContainerConfig) ([]types.ContainerStatus, error)
- func (n *Node) UpdateOffer(ctx context.Context, fromSupplier, toTrader *types.Node, offer *types.Offer)
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 KAGETAKA's node.
func NewNode ¶
func NewNode(config *configuration.Configuration, overlayCli overlay.Overlay, kagetakaCli external.Kagetaka, dockerClient external.DockerClient, apiServer api.Server) *Node
NewNode creates a Node object that contains all the functionality of a KAGETAKA's node.
func (*Node) AdvertiseOffersNeighbor ¶
func (*Node) Configuration ¶
func (n *Node) Configuration(c context.Context) *configuration.Configuration
Configuration returns the system's configuration of this node.
func (*Node) CreateOffer ¶
func (*Node) DebugSizeBytes ¶
func (*Node) GetSystemPartitionsState ¶
func (n *Node) GetSystemPartitionsState() *partitions.SystemResourcePartitions
func (*Node) LaunchContainers ¶
func (*Node) ListContainers ¶
func (n *Node) ListContainers(_ context.Context) []types.ContainerStatus
func (*Node) NodeInformationSim ¶
NodeInformationSim returns the available resources, maximum available resources and number of offers in the node. Note: Only available when the node is running in simulation mode.
func (*Node) RefreshOffer ¶
func (*Node) RefreshOffersSim ¶
func (n *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) SpreadOffersSim ¶
func (n *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 ¶
Start the node's functions. If the node is joining an instance of KAGETAKA's it is called with join as true and the joinIP contains the IP address of a node that already belongs to the KAGETAKA's instance.
func (*Node) StopContainers ¶
func (*Node) StopLocalContainer ¶
func (*Node) SubmitContainers ¶
func (n *Node) SubmitContainers(ctx context.Context, containerConfigs []types.ContainerConfig) ([]types.ContainerStatus, error)