Versions in this module Expand all Collapse all v1 v1.0.1 Aug 15, 2024 Changes in this version + var Workspaces = []Workspace + func Accuracy(v float64, accuracy int32) float64 + func ByteToGibibyte(v uint64, accuracy int32) float64 + func CoreToMillcore(v float64) uint64 + func GibibyteToByte(v float64) uint64 + func MillcoreToCore(v uint64, accuracy int32) float64 + func ResourceToString(res float64, typ string) string + func WorkspaceString(workspace Workspace) string + func WorkspacesString(workspaces []Workspace) []string + type Calculator struct + ClusterName string + func New(clusterName string) *Calculator + func (c *Calculator) AddValue(cpu, mem uint64, workspace ...Workspace) + func (c *Calculator) AllocatableCPU(workspace Workspace) uint64 + func (c *Calculator) AllocatableMem(workspace Workspace) uint64 + func (c *Calculator) AlreadyTookUpCPU(workspace Workspace) uint64 + func (c *Calculator) AlreadyTookUpMem(workspace Workspace) uint64 + func (c *Calculator) DeductionQuota(workspace Workspace, cpu, mem uint64) + func (c *Calculator) QuotableCPUForWorkspace(workspace Workspace) uint64 + func (c *Calculator) QuotableMemForWorkspace(workspace Workspace) uint64 + func (c *Calculator) TotalQuotableCPU() uint64 + func (c *Calculator) TotalQuotableMem() uint64 + type ResourceCalculator struct + Type string + WorkspacesValues map[string]uint64 + type Workspace int + const Dev + const Prod + const Staging + const Test