Documentation ¶
Index ¶
- type ClusterResourceNode
- type ResourceList
- type ResourceSummary
- func (rs *ResourceSummary) AddToResourceSummary(crn ClusterResourceNode)
- func (rs *ResourceSummary) DeleteFromResourceSummary(crn ClusterResourceNode) error
- func (rs *ResourceSummary) GetNodeNumFromModel(model *resourceModels) int
- func (rs *ResourceSummary) UpdateInResourceSummary(oldNode, newNode ClusterResourceNode) error
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