Documentation ¶
Index ¶
- Constants
- type DRFResource
- func (r *DRFResource) AddFromResourceList(rl v1.ResourceList)
- func (r *DRFResource) AddResource(rr DRFResource) *DRFResource
- func (r *DRFResource) GetResourceValue(rName v1.ResourceName) int64
- func (r *DRFResource) IsEmpty() bool
- func (r DRFResource) IsInit() bool
- func (r *DRFResource) IsZero(rn v1.ResourceName) bool
- func (r *DRFResource) Multi(ratio float64) *DRFResource
- func (r *DRFResource) ResourceNames() []v1.ResourceName
- func (r *DRFResource) SetMaxResource(rl v1.ResourceList)
- func (r *DRFResource) SetResourceValue(rName v1.ResourceName, quantity int64)
- func (r *DRFResource) String() string
- func (r *DRFResource) SubResource(rr DRFResource) *DRFResource
Constants ¶
const ZERO = int64(0)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DRFResource ¶
func EmptyResource ¶
func EmptyResource() *DRFResource
EmptyResource creates an empty resource object and returns
func GetPodResourceRequest ¶
func GetPodResourceRequest(pod *v1.Pod) *DRFResource
func MaxResource ¶
func MaxResource() DRFResource
func (*DRFResource) AddFromResourceList ¶
func (r *DRFResource) AddFromResourceList(rl v1.ResourceList)
AddFromResourceList adds ResourceList into Resource.
func (*DRFResource) AddResource ¶
func (r *DRFResource) AddResource(rr DRFResource) *DRFResource
AddResource is used to add the two resources
func (*DRFResource) GetResourceValue ¶
func (r *DRFResource) GetResourceValue(rName v1.ResourceName) int64
resource type
func (*DRFResource) IsEmpty ¶
func (r *DRFResource) IsEmpty() bool
IsEmpty returns bool after checking any of resource is less than min possible value
func (DRFResource) IsInit ¶
func (r DRFResource) IsInit() bool
IsInit checks if the DRFResource has been initialized.
func (*DRFResource) IsZero ¶
func (r *DRFResource) IsZero(rn v1.ResourceName) bool
IsZero checks whether that resource is less than min possible value
func (*DRFResource) Multi ¶
func (r *DRFResource) Multi(ratio float64) *DRFResource
Multi multiples the resource with ratio provided
func (*DRFResource) ResourceNames ¶
func (r *DRFResource) ResourceNames() []v1.ResourceName
ResourceNames returns all resource types
func (*DRFResource) SetMaxResource ¶
func (r *DRFResource) SetMaxResource(rl v1.ResourceList)
SetMaxResource compares with ResourceList and takes max value for each Resource.
func (*DRFResource) SetResourceValue ¶
func (r *DRFResource) SetResourceValue(rName v1.ResourceName, quantity int64)
SetResourceValue sets the resource value for that specific resource type.
func (*DRFResource) String ¶
func (r *DRFResource) String() string
String returns resource details in string format
func (*DRFResource) SubResource ¶
func (r *DRFResource) SubResource(rr DRFResource) *DRFResource
SubResource subtracts two Resource objects.