Help us shape the future of Go! Take the 2026 Go Developer Survey

cobalt

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager fans resource operations out to the loaded plugins.

func New

func New(config types.Config) *Manager

func (*Manager) AddNode

func (m *Manager) AddNode(ctx context.Context, nodename string, opts resourcetypes.Resources, nodeInfo *enginetypes.Info) (resourcetypes.Resources, error)

func (*Manager) AddPlugins

func (m *Manager) AddPlugins(ps ...plugins.Plugin)

func (*Manager) Alloc

func (m *Manager) Alloc(ctx context.Context, nodename string, deployCount int, opts resourcetypes.Resources) ([]resourcetypes.Resources, []resourcetypes.Resources, error)

Alloc allocates resource for deployCount workloads on nodename, keyed by plugin name in opts.

func (*Manager) GetMetricsDescription

func (m *Manager) GetMetricsDescription(ctx context.Context) ([]*plugintypes.MetricsDescription, error)

func (*Manager) GetMostIdleNode

func (m *Manager) GetMostIdleNode(ctx context.Context, nodenames []string) (string, error)

func (*Manager) GetNodeResourceInfo

func (m *Manager) GetNodeResourceInfo(ctx context.Context, nodename string, workloads []*types.Workload, fix bool) (resourcetypes.Resources, resourcetypes.Resources, []string, error)

func (*Manager) GetNodesDeployCapacity

func (m *Manager) GetNodesDeployCapacity(ctx context.Context, nodenames []string, opts resourcetypes.Resources) (map[string]*plugintypes.NodeDeployCapacity, int, error)

func (*Manager) GetNodesMetrics added in v0.1.4

func (m *Manager) GetNodesMetrics(ctx context.Context, nodes []*types.Node) ([]*plugintypes.Metrics, error)

func (*Manager) GetNodesResourceInfo added in v0.1.5

func (m *Manager) GetNodesResourceInfo(ctx context.Context, nodenames []string) (map[string]*types.NodeResourceInfo, error)

func (*Manager) LoadPlugins

func (m *Manager) LoadPlugins(ctx context.Context, store store.Store) error

func (*Manager) Realloc

func (*Manager) Remap

func (m *Manager) Remap(ctx context.Context, nodename string, workloads []*types.Workload) (map[string]resourcetypes.Resources, error)

Remap returns engine params per workload and never changes resource params.

func (*Manager) RemoveNode

func (m *Manager) RemoveNode(ctx context.Context, nodename string) error

func (*Manager) RollbackAlloc

func (m *Manager) RollbackAlloc(ctx context.Context, nodename string, workloadsParams []resourcetypes.Resources) error

RollbackAlloc returns the allocated resource to the node.

func (*Manager) RollbackRealloc

func (m *Manager) RollbackRealloc(ctx context.Context, nodename string, workloadParams resourcetypes.Resources) error

func (*Manager) SetNodeResourceCapacity

func (m *Manager) SetNodeResourceCapacity(ctx context.Context, nodename string, nodeResource, nodeResourceRequest resourcetypes.Resources, delta, incr bool) (resourcetypes.Resources, resourcetypes.Resources, error)

func (*Manager) SetNodeResourceUsage

func (m *Manager) SetNodeResourceUsage(ctx context.Context, nodename string, nodeResource, nodeResourceRequest resourcetypes.Resources, workloadsResource []resourcetypes.Resources, delta, incr bool) (resourcetypes.Resources, resourcetypes.Resources, error)

Jump to

Keyboard shortcuts

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