Documentation ¶
Index ¶
- Variables
- func GetDefaultMaxAllowedInstances() int
- type Account
- func (account Account) GetBillingModel(instanceTypeID string, billingModelID string) (BillingModel, bool)
- func (account Account) GetGrantedQuota() QuotaList
- func (account Account) GetMaxAllowedInstances(instanceTypeID string, billingModelID string) int
- func (account Account) HasQuotaConfigurationFor(instanceTypeId string, billingModelID string) bool
- func (account Account) IsInstanceCountWithinLimit(instanceTypeID string, billingModelID string, count int) bool
- type AccountList
- type BillingModel
- type BillingModelList
- type ExpirationDate
- type Organisation
- func (org Organisation) GetBillingModel(instanceTypeID string, billingModelID string) (BillingModel, bool)
- func (org Organisation) GetGrantedQuota() QuotaList
- func (org Organisation) GetMaxAllowedInstances(instanceTypeID string, billingModelID string) int
- func (org Organisation) HasQuotaConfigurationFor(instanceTypeId string, billingModelID string) bool
- func (org Organisation) HasUsersRegistered() bool
- func (org Organisation) IsInstanceCountWithinLimit(instanceTypeID string, billingModelID string, count int) bool
- func (org Organisation) IsUserRegistered(username string) bool
- type OrganisationList
- type Quota
- type QuotaList
- type QuotaManagementListConfig
- type QuotaManagementListItem
- type RegisteredUsersListConfiguration
Constants ¶
This section is empty.
Variables ¶
View Source
var MaxAllowedInstances = 1
Functions ¶
func GetDefaultMaxAllowedInstances ¶
func GetDefaultMaxAllowedInstances() int
GetDefaultMaxAllowedInstances - Returns the default max allowed instances for both internal (users and orgs in quota list config) and external users
Types ¶
type Account ¶
type Account struct { Username string `yaml:"username"` MaxAllowedInstances int `yaml:"max_allowed_instances"` GrantedQuota QuotaList `yaml:"granted_quota,omitempty"` }
func (Account) GetBillingModel ¶
func (account Account) GetBillingModel(instanceTypeID string, billingModelID string) (BillingModel, bool)
func (Account) GetGrantedQuota ¶
func (Account) GetMaxAllowedInstances ¶
func (Account) HasQuotaConfigurationFor ¶
type AccountList ¶
type AccountList []Account
func (AccountList) GetByUsername ¶
func (allowedAccounts AccountList) GetByUsername(username string) (Account, bool)
type BillingModel ¶
type BillingModel struct { Id string `yaml:"id"` ExpirationDate *ExpirationDate `yaml:"expiration_date,omitempty"` MaxAllowedInstances int `yaml:"max_allowed_instances"` }
func (*BillingModel) HasExpired ¶
func (bm *BillingModel) HasExpired() bool
type BillingModelList ¶
type BillingModelList []BillingModel
type ExpirationDate ¶
func (*ExpirationDate) HasExpired ¶
func (e *ExpirationDate) HasExpired() bool
func (*ExpirationDate) MarshalJSON ¶
func (e *ExpirationDate) MarshalJSON() ([]byte, error)
func (*ExpirationDate) MarshalYAML ¶
func (e *ExpirationDate) MarshalYAML() (any, error)
func (*ExpirationDate) UnmarshalJSON ¶
func (e *ExpirationDate) UnmarshalJSON(b []byte) error
func (*ExpirationDate) UnmarshalYAML ¶
func (e *ExpirationDate) UnmarshalYAML(unmarshal func(any) error) error
type Organisation ¶
type Organisation struct { Id string `yaml:"id"` AnyUser bool `yaml:"any_user"` MaxAllowedInstances int `yaml:"max_allowed_instances"` RegisteredUsers AccountList `yaml:"registered_users"` GrantedQuota QuotaList `yaml:"granted_quota,omitempty"` }
func (Organisation) GetBillingModel ¶
func (org Organisation) GetBillingModel(instanceTypeID string, billingModelID string) (BillingModel, bool)
func (Organisation) GetGrantedQuota ¶
func (org Organisation) GetGrantedQuota() QuotaList
func (Organisation) GetMaxAllowedInstances ¶
func (org Organisation) GetMaxAllowedInstances(instanceTypeID string, billingModelID string) int
func (Organisation) HasQuotaConfigurationFor ¶
func (org Organisation) HasQuotaConfigurationFor(instanceTypeId string, billingModelID string) bool
func (Organisation) HasUsersRegistered ¶
func (org Organisation) HasUsersRegistered() bool
func (Organisation) IsInstanceCountWithinLimit ¶
func (org Organisation) IsInstanceCountWithinLimit(instanceTypeID string, billingModelID string, count int) bool
func (Organisation) IsUserRegistered ¶
func (org Organisation) IsUserRegistered(username string) bool
type OrganisationList ¶
type OrganisationList []Organisation
func (OrganisationList) GetById ¶
func (orgList OrganisationList) GetById(Id string) (Organisation, bool)
type Quota ¶
type Quota struct { InstanceTypeID string `yaml:"instance_type_id"` KafkaBillingModels BillingModelList `yaml:"kafka_billing_models,omitempty"` }
func (*Quota) GetKafkaBillingModelByID ¶
func (quota *Quota) GetKafkaBillingModelByID(billingModelId string) (BillingModel, bool)
func (*Quota) GetKafkaBillingModels ¶
func (quota *Quota) GetKafkaBillingModels() BillingModelList
type QuotaManagementListConfig ¶
type QuotaManagementListConfig struct { QuotaList RegisteredUsersListConfiguration QuotaListConfigFile string EnableInstanceLimitControl bool }
func NewQuotaManagementListConfig ¶
func NewQuotaManagementListConfig() *QuotaManagementListConfig
func (*QuotaManagementListConfig) AddFlags ¶
func (c *QuotaManagementListConfig) AddFlags(fs *pflag.FlagSet)
func (*QuotaManagementListConfig) GetAllowedAccountByUsernameAndOrgId ¶
func (c *QuotaManagementListConfig) GetAllowedAccountByUsernameAndOrgId(username string, orgId string) (Account, bool)
func (*QuotaManagementListConfig) ReadFiles ¶
func (c *QuotaManagementListConfig) ReadFiles() error
type QuotaManagementListItem ¶
type QuotaManagementListItem interface { // IsInstanceCountWithinLimit returns true if the given count is within limits IsInstanceCountWithinLimit(instanceTypeID string, billingModelID string, count int) bool // GetMaxAllowedInstances returns maximum number of allowed instances. GetMaxAllowedInstances(instanceTypeID string, billingModelID string) int }
type RegisteredUsersListConfiguration ¶
type RegisteredUsersListConfiguration struct { Organisations OrganisationList `yaml:"registered_users_per_organisation"` ServiceAccounts AccountList `yaml:"registered_service_accounts"` }
Click to show internal directories.
Click to hide internal directories.