modeling

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterResourceNode

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

ClusterResourceNode represents the each raw resource entity without modeling.

func NewClusterResourceNode

func NewClusterResourceNode(resourceList corev1.ResourceList) ClusterResourceNode

NewClusterResourceNode create new cluster resource node

type ResourceList

type ResourceList map[clusterapis.ResourceName]resource.Quantity

ResourceList is a set of (resource name, quantity) pairs.

func ConvertToResourceList

func ConvertToResourceList(rslist corev1.ResourceList) ResourceList

ConvertToResourceList is convert from corev1.ResourceList to ResourceList

type ResourceSummary

type ResourceSummary []resourceModels

ResourceSummary records the list of resourceModels

func InitSummary

func InitSummary(resourceModels []clusterapis.ResourceModel) (ResourceSummary, error)

InitSummary is the init function of modeling data structure

func (*ResourceSummary) AddToResourceSummary

func (rs *ResourceSummary) AddToResourceSummary(crn ClusterResourceNode)

AddToResourceSummary add resource node into modeling summary

func (*ResourceSummary) DeleteFromResourceSummary

func (rs *ResourceSummary) DeleteFromResourceSummary(crn ClusterResourceNode) error

DeleteFromResourceSummary dalete resource node into modeling summary

func (*ResourceSummary) GetNodeNumFromModel

func (rs *ResourceSummary) GetNodeNumFromModel(model *resourceModels) int

GetNodeNumFromModel is for getting node number from the modeling

func (*ResourceSummary) UpdateInResourceSummary

func (rs *ResourceSummary) UpdateInResourceSummary(oldNode, newNode ClusterResourceNode) error

UpdateInResourceSummary update resource node into modeling summary

Jump to

Keyboard shortcuts

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