2024-06-05 21:20:33 +02:00
|
|
|
package limits
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"github.com/openziti/zrok/controller/store"
|
|
|
|
)
|
|
|
|
|
|
|
|
type configResourceCountClass struct {
|
|
|
|
cfg *Config
|
|
|
|
}
|
|
|
|
|
|
|
|
func newConfigResourceCountClass(cfg *Config) store.ResourceCountClass {
|
|
|
|
return &configResourceCountClass{cfg}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (rcc *configResourceCountClass) IsGlobal() bool {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
func (rcc *configResourceCountClass) GetLimitClassId() int {
|
|
|
|
return -1
|
|
|
|
}
|
|
|
|
|
|
|
|
func (rcc *configResourceCountClass) GetEnvironments() int {
|
|
|
|
return rcc.cfg.Environments
|
|
|
|
}
|
|
|
|
|
|
|
|
func (rcc *configResourceCountClass) GetShares() int {
|
|
|
|
return rcc.cfg.Shares
|
|
|
|
}
|
|
|
|
|
|
|
|
func (rcc *configResourceCountClass) GetReservedShares() int {
|
|
|
|
return rcc.cfg.ReservedShares
|
|
|
|
}
|
|
|
|
|
|
|
|
func (rcc *configResourceCountClass) GetUniqueNames() int {
|
|
|
|
return rcc.cfg.UniqueNames
|
|
|
|
}
|
|
|
|
|
2024-06-17 18:12:38 +02:00
|
|
|
func (rcc *configResourceCountClass) GetShareFrontends() int {
|
|
|
|
return rcc.cfg.ShareFrontends
|
2024-06-17 17:41:24 +02:00
|
|
|
}
|
|
|
|
|
2024-06-05 21:20:33 +02:00
|
|
|
func (rcc *configResourceCountClass) String() string {
|
2024-06-17 19:16:07 +02:00
|
|
|
return fmt.Sprintf("Config<environments: %d, shares: %d, reservedShares: %d, uniqueNames: %d, share_frontends: %d>", rcc.cfg.Environments, rcc.cfg.Shares, rcc.cfg.ReservedShares, rcc.cfg.UniqueNames, rcc.cfg.ShareFrontends)
|
2024-06-05 21:20:33 +02:00
|
|
|
}
|