mocks

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	mock.Mock
}

Plugin is an autogenerated mock type for the Plugin type

func NewPlugin

func NewPlugin(t interface {
	mock.TestingT
	Cleanup(func())
}) *Plugin

NewPlugin creates a new instance of Plugin. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*Plugin) AddNode

func (_mock *Plugin) AddNode(ctx context.Context, nodename string, resource types.NodeResourceRequest, info *types0.Info) (*types.AddNodeResponse, error)

AddNode provides a mock function for the type Plugin

func (*Plugin) CalculateDeploy

func (_mock *Plugin) CalculateDeploy(ctx context.Context, nodename string, deployCount int, resourceRequest types.WorkloadResourceRequest) (*types.CalculateDeployResponse, error)

CalculateDeploy provides a mock function for the type Plugin

func (*Plugin) CalculateRealloc

func (_mock *Plugin) CalculateRealloc(ctx context.Context, nodename string, resource types.WorkloadResource, resourceRequest types.WorkloadResourceRequest) (*types.CalculateReallocResponse, error)

CalculateRealloc provides a mock function for the type Plugin

func (*Plugin) CalculateRemap

func (_mock *Plugin) CalculateRemap(ctx context.Context, nodename string, workloadsResource map[string]types.WorkloadResource) (*types.CalculateRemapResponse, error)

CalculateRemap provides a mock function for the type Plugin

func (*Plugin) EXPECT

func (_m *Plugin) EXPECT() *Plugin_Expecter

func (*Plugin) FixNodeResource

func (_mock *Plugin) FixNodeResource(ctx context.Context, nodename string, workloadsResource []types.WorkloadResource) (*types.GetNodeResourceInfoResponse, error)

FixNodeResource provides a mock function for the type Plugin

func (*Plugin) GetMetrics

func (_mock *Plugin) GetMetrics(ctx context.Context, nodes []types.NodeRef) (*types.GetMetricsResponse, error)

GetMetrics provides a mock function for the type Plugin

func (*Plugin) GetMetricsDescription

func (_mock *Plugin) GetMetricsDescription(ctx context.Context) (*types.GetMetricsDescriptionResponse, error)

GetMetricsDescription provides a mock function for the type Plugin

func (*Plugin) GetMostIdleNode

func (_mock *Plugin) GetMostIdleNode(ctx context.Context, nodenames []string) (*types.GetMostIdleNodeResponse, error)

GetMostIdleNode provides a mock function for the type Plugin

func (*Plugin) GetNodeResourceInfo

func (_mock *Plugin) GetNodeResourceInfo(ctx context.Context, nodename string, workloadsResource []types.WorkloadResource) (*types.GetNodeResourceInfoResponse, error)

GetNodeResourceInfo provides a mock function for the type Plugin

func (*Plugin) GetNodesDeployCapacity

func (_mock *Plugin) GetNodesDeployCapacity(ctx context.Context, nodenames []string, resource types.WorkloadResourceRequest) (*types.GetNodesDeployCapacityResponse, error)

GetNodesDeployCapacity provides a mock function for the type Plugin

func (*Plugin) Name

func (_mock *Plugin) Name() string

Name provides a mock function for the type Plugin

func (*Plugin) RemoveNode

func (_mock *Plugin) RemoveNode(ctx context.Context, nodename string) (*types.RemoveNodeResponse, error)

RemoveNode provides a mock function for the type Plugin

func (*Plugin) SetNodeResourceCapacity

func (_mock *Plugin) SetNodeResourceCapacity(ctx context.Context, nodename string, resource types.NodeResource, resourceRequest types.NodeResourceRequest, delta bool, incr bool) (*types.SetNodeResourceCapacityResponse, error)

SetNodeResourceCapacity provides a mock function for the type Plugin

func (*Plugin) SetNodeResourceInfo

func (_mock *Plugin) SetNodeResourceInfo(ctx context.Context, nodename string, capacity types.NodeResource, usage types.NodeResource) (*types.SetNodeResourceInfoResponse, error)

SetNodeResourceInfo provides a mock function for the type Plugin

func (*Plugin) SetNodeResourceUsage

func (_mock *Plugin) SetNodeResourceUsage(ctx context.Context, nodename string, resource types.NodeResource, resourceRequest types.NodeResourceRequest, workloadsResource []types.WorkloadResource, delta bool, incr bool) (*types.SetNodeResourceUsageResponse, error)

SetNodeResourceUsage provides a mock function for the type Plugin

type Plugin_AddNode_Call

type Plugin_AddNode_Call struct {
	*mock.Call
}

Plugin_AddNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddNode'

func (*Plugin_AddNode_Call) Return

func (_c *Plugin_AddNode_Call) Return(addNodeResponse *types.AddNodeResponse, err error) *Plugin_AddNode_Call

func (*Plugin_AddNode_Call) Run

func (_c *Plugin_AddNode_Call) Run(run func(ctx context.Context, nodename string, resource types.NodeResourceRequest, info *types0.Info)) *Plugin_AddNode_Call

func (*Plugin_AddNode_Call) RunAndReturn

func (_c *Plugin_AddNode_Call) RunAndReturn(run func(ctx context.Context, nodename string, resource types.NodeResourceRequest, info *types0.Info) (*types.AddNodeResponse, error)) *Plugin_AddNode_Call

type Plugin_CalculateDeploy_Call

type Plugin_CalculateDeploy_Call struct {
	*mock.Call
}

Plugin_CalculateDeploy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CalculateDeploy'

func (*Plugin_CalculateDeploy_Call) Return

func (*Plugin_CalculateDeploy_Call) Run

func (_c *Plugin_CalculateDeploy_Call) Run(run func(ctx context.Context, nodename string, deployCount int, resourceRequest types.WorkloadResourceRequest)) *Plugin_CalculateDeploy_Call

func (*Plugin_CalculateDeploy_Call) RunAndReturn

func (_c *Plugin_CalculateDeploy_Call) RunAndReturn(run func(ctx context.Context, nodename string, deployCount int, resourceRequest types.WorkloadResourceRequest) (*types.CalculateDeployResponse, error)) *Plugin_CalculateDeploy_Call

type Plugin_CalculateRealloc_Call

type Plugin_CalculateRealloc_Call struct {
	*mock.Call
}

Plugin_CalculateRealloc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CalculateRealloc'

func (*Plugin_CalculateRealloc_Call) Return

func (*Plugin_CalculateRealloc_Call) Run

func (*Plugin_CalculateRealloc_Call) RunAndReturn

type Plugin_CalculateRemap_Call

type Plugin_CalculateRemap_Call struct {
	*mock.Call
}

Plugin_CalculateRemap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CalculateRemap'

func (*Plugin_CalculateRemap_Call) Return

func (*Plugin_CalculateRemap_Call) Run

func (_c *Plugin_CalculateRemap_Call) Run(run func(ctx context.Context, nodename string, workloadsResource map[string]types.WorkloadResource)) *Plugin_CalculateRemap_Call

func (*Plugin_CalculateRemap_Call) RunAndReturn

func (_c *Plugin_CalculateRemap_Call) RunAndReturn(run func(ctx context.Context, nodename string, workloadsResource map[string]types.WorkloadResource) (*types.CalculateRemapResponse, error)) *Plugin_CalculateRemap_Call

type Plugin_Expecter

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

func (*Plugin_Expecter) AddNode

func (_e *Plugin_Expecter) AddNode(ctx any, nodename any, resource any, info any) *Plugin_AddNode_Call

AddNode is a helper method to define mock.On call

  • ctx context.Context
  • nodename string
  • resource types.NodeResourceRequest
  • info *types0.Info

func (*Plugin_Expecter) CalculateDeploy

func (_e *Plugin_Expecter) CalculateDeploy(ctx any, nodename any, deployCount any, resourceRequest any) *Plugin_CalculateDeploy_Call

CalculateDeploy is a helper method to define mock.On call

  • ctx context.Context
  • nodename string
  • deployCount int
  • resourceRequest types.WorkloadResourceRequest

func (*Plugin_Expecter) CalculateRealloc

func (_e *Plugin_Expecter) CalculateRealloc(ctx any, nodename any, resource any, resourceRequest any) *Plugin_CalculateRealloc_Call

CalculateRealloc is a helper method to define mock.On call

  • ctx context.Context
  • nodename string
  • resource types.WorkloadResource
  • resourceRequest types.WorkloadResourceRequest

func (*Plugin_Expecter) CalculateRemap

func (_e *Plugin_Expecter) CalculateRemap(ctx any, nodename any, workloadsResource any) *Plugin_CalculateRemap_Call

CalculateRemap is a helper method to define mock.On call

  • ctx context.Context
  • nodename string
  • workloadsResource map[string]types.WorkloadResource

func (*Plugin_Expecter) FixNodeResource

func (_e *Plugin_Expecter) FixNodeResource(ctx any, nodename any, workloadsResource any) *Plugin_FixNodeResource_Call

FixNodeResource is a helper method to define mock.On call

  • ctx context.Context
  • nodename string
  • workloadsResource []types.WorkloadResource

func (*Plugin_Expecter) GetMetrics

func (_e *Plugin_Expecter) GetMetrics(ctx any, nodes any) *Plugin_GetMetrics_Call

GetMetrics is a helper method to define mock.On call

  • ctx context.Context
  • nodes []types.NodeRef

func (*Plugin_Expecter) GetMetricsDescription

func (_e *Plugin_Expecter) GetMetricsDescription(ctx any) *Plugin_GetMetricsDescription_Call

GetMetricsDescription is a helper method to define mock.On call

  • ctx context.Context

func (*Plugin_Expecter) GetMostIdleNode

func (_e *Plugin_Expecter) GetMostIdleNode(ctx any, nodenames any) *Plugin_GetMostIdleNode_Call

GetMostIdleNode is a helper method to define mock.On call

  • ctx context.Context
  • nodenames []string

func (*Plugin_Expecter) GetNodeResourceInfo

func (_e *Plugin_Expecter) GetNodeResourceInfo(ctx any, nodename any, workloadsResource any) *Plugin_GetNodeResourceInfo_Call

GetNodeResourceInfo is a helper method to define mock.On call

  • ctx context.Context
  • nodename string
  • workloadsResource []types.WorkloadResource

func (*Plugin_Expecter) GetNodesDeployCapacity

func (_e *Plugin_Expecter) GetNodesDeployCapacity(ctx any, nodenames any, resource any) *Plugin_GetNodesDeployCapacity_Call

GetNodesDeployCapacity is a helper method to define mock.On call

  • ctx context.Context
  • nodenames []string
  • resource types.WorkloadResourceRequest

func (*Plugin_Expecter) Name

func (_e *Plugin_Expecter) Name() *Plugin_Name_Call

Name is a helper method to define mock.On call

func (*Plugin_Expecter) RemoveNode

func (_e *Plugin_Expecter) RemoveNode(ctx any, nodename any) *Plugin_RemoveNode_Call

RemoveNode is a helper method to define mock.On call

  • ctx context.Context
  • nodename string

func (*Plugin_Expecter) SetNodeResourceCapacity

func (_e *Plugin_Expecter) SetNodeResourceCapacity(ctx any, nodename any, resource any, resourceRequest any, delta any, incr any) *Plugin_SetNodeResourceCapacity_Call

SetNodeResourceCapacity is a helper method to define mock.On call

  • ctx context.Context
  • nodename string
  • resource types.NodeResource
  • resourceRequest types.NodeResourceRequest
  • delta bool
  • incr bool

func (*Plugin_Expecter) SetNodeResourceInfo

func (_e *Plugin_Expecter) SetNodeResourceInfo(ctx any, nodename any, capacity any, usage any) *Plugin_SetNodeResourceInfo_Call

SetNodeResourceInfo is a helper method to define mock.On call

  • ctx context.Context
  • nodename string
  • capacity types.NodeResource
  • usage types.NodeResource

func (*Plugin_Expecter) SetNodeResourceUsage

func (_e *Plugin_Expecter) SetNodeResourceUsage(ctx any, nodename any, resource any, resourceRequest any, workloadsResource any, delta any, incr any) *Plugin_SetNodeResourceUsage_Call

SetNodeResourceUsage is a helper method to define mock.On call

  • ctx context.Context
  • nodename string
  • resource types.NodeResource
  • resourceRequest types.NodeResourceRequest
  • workloadsResource []types.WorkloadResource
  • delta bool
  • incr bool

type Plugin_FixNodeResource_Call

type Plugin_FixNodeResource_Call struct {
	*mock.Call
}

Plugin_FixNodeResource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FixNodeResource'

func (*Plugin_FixNodeResource_Call) Return

func (*Plugin_FixNodeResource_Call) Run

func (_c *Plugin_FixNodeResource_Call) Run(run func(ctx context.Context, nodename string, workloadsResource []types.WorkloadResource)) *Plugin_FixNodeResource_Call

func (*Plugin_FixNodeResource_Call) RunAndReturn

type Plugin_GetMetricsDescription_Call

type Plugin_GetMetricsDescription_Call struct {
	*mock.Call
}

Plugin_GetMetricsDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMetricsDescription'

func (*Plugin_GetMetricsDescription_Call) Return

func (*Plugin_GetMetricsDescription_Call) Run

func (*Plugin_GetMetricsDescription_Call) RunAndReturn

type Plugin_GetMetrics_Call

type Plugin_GetMetrics_Call struct {
	*mock.Call
}

Plugin_GetMetrics_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMetrics'

func (*Plugin_GetMetrics_Call) Return

func (_c *Plugin_GetMetrics_Call) Return(getMetricsResponse *types.GetMetricsResponse, err error) *Plugin_GetMetrics_Call

func (*Plugin_GetMetrics_Call) Run

func (_c *Plugin_GetMetrics_Call) Run(run func(ctx context.Context, nodes []types.NodeRef)) *Plugin_GetMetrics_Call

func (*Plugin_GetMetrics_Call) RunAndReturn

type Plugin_GetMostIdleNode_Call

type Plugin_GetMostIdleNode_Call struct {
	*mock.Call
}

Plugin_GetMostIdleNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMostIdleNode'

func (*Plugin_GetMostIdleNode_Call) Return

func (*Plugin_GetMostIdleNode_Call) Run

func (_c *Plugin_GetMostIdleNode_Call) Run(run func(ctx context.Context, nodenames []string)) *Plugin_GetMostIdleNode_Call

func (*Plugin_GetMostIdleNode_Call) RunAndReturn

type Plugin_GetNodeResourceInfo_Call

type Plugin_GetNodeResourceInfo_Call struct {
	*mock.Call
}

Plugin_GetNodeResourceInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNodeResourceInfo'

func (*Plugin_GetNodeResourceInfo_Call) Return

func (*Plugin_GetNodeResourceInfo_Call) Run

func (_c *Plugin_GetNodeResourceInfo_Call) Run(run func(ctx context.Context, nodename string, workloadsResource []types.WorkloadResource)) *Plugin_GetNodeResourceInfo_Call

func (*Plugin_GetNodeResourceInfo_Call) RunAndReturn

type Plugin_GetNodesDeployCapacity_Call

type Plugin_GetNodesDeployCapacity_Call struct {
	*mock.Call
}

Plugin_GetNodesDeployCapacity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNodesDeployCapacity'

func (*Plugin_GetNodesDeployCapacity_Call) Return

func (*Plugin_GetNodesDeployCapacity_Call) Run

func (*Plugin_GetNodesDeployCapacity_Call) RunAndReturn

type Plugin_Name_Call

type Plugin_Name_Call struct {
	*mock.Call
}

Plugin_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name'

func (*Plugin_Name_Call) Return

func (_c *Plugin_Name_Call) Return(s string) *Plugin_Name_Call

func (*Plugin_Name_Call) Run

func (_c *Plugin_Name_Call) Run(run func()) *Plugin_Name_Call

func (*Plugin_Name_Call) RunAndReturn

func (_c *Plugin_Name_Call) RunAndReturn(run func() string) *Plugin_Name_Call

type Plugin_RemoveNode_Call

type Plugin_RemoveNode_Call struct {
	*mock.Call
}

Plugin_RemoveNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveNode'

func (*Plugin_RemoveNode_Call) Return

func (_c *Plugin_RemoveNode_Call) Return(removeNodeResponse *types.RemoveNodeResponse, err error) *Plugin_RemoveNode_Call

func (*Plugin_RemoveNode_Call) Run

func (_c *Plugin_RemoveNode_Call) Run(run func(ctx context.Context, nodename string)) *Plugin_RemoveNode_Call

func (*Plugin_RemoveNode_Call) RunAndReturn

func (_c *Plugin_RemoveNode_Call) RunAndReturn(run func(ctx context.Context, nodename string) (*types.RemoveNodeResponse, error)) *Plugin_RemoveNode_Call

type Plugin_SetNodeResourceCapacity_Call

type Plugin_SetNodeResourceCapacity_Call struct {
	*mock.Call
}

Plugin_SetNodeResourceCapacity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNodeResourceCapacity'

func (*Plugin_SetNodeResourceCapacity_Call) Return

func (*Plugin_SetNodeResourceCapacity_Call) Run

func (_c *Plugin_SetNodeResourceCapacity_Call) Run(run func(ctx context.Context, nodename string, resource types.NodeResource, resourceRequest types.NodeResourceRequest, delta bool, incr bool)) *Plugin_SetNodeResourceCapacity_Call

func (*Plugin_SetNodeResourceCapacity_Call) RunAndReturn

type Plugin_SetNodeResourceInfo_Call

type Plugin_SetNodeResourceInfo_Call struct {
	*mock.Call
}

Plugin_SetNodeResourceInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNodeResourceInfo'

func (*Plugin_SetNodeResourceInfo_Call) Return

func (*Plugin_SetNodeResourceInfo_Call) Run

func (*Plugin_SetNodeResourceInfo_Call) RunAndReturn

type Plugin_SetNodeResourceUsage_Call

type Plugin_SetNodeResourceUsage_Call struct {
	*mock.Call
}

Plugin_SetNodeResourceUsage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNodeResourceUsage'

func (*Plugin_SetNodeResourceUsage_Call) Return

func (*Plugin_SetNodeResourceUsage_Call) Run

func (_c *Plugin_SetNodeResourceUsage_Call) Run(run func(ctx context.Context, nodename string, resource types.NodeResource, resourceRequest types.NodeResourceRequest, workloadsResource []types.WorkloadResource, delta bool, incr bool)) *Plugin_SetNodeResourceUsage_Call

func (*Plugin_SetNodeResourceUsage_Call) RunAndReturn

func (_c *Plugin_SetNodeResourceUsage_Call) RunAndReturn(run func(ctx context.Context, nodename string, resource types.NodeResource, resourceRequest types.NodeResourceRequest, workloadsResource []types.WorkloadResource, delta bool, incr bool) (*types.SetNodeResourceUsageResponse, error)) *Plugin_SetNodeResourceUsage_Call

Jump to

Keyboard shortcuts

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