Documentation
¶
Index ¶
- Constants
- func ConfigTypeFromConfig(config cloud.KeyedConfig) (string, error)
- func GetCloudBillingWatchers(providerConfig models.ProviderConfig) map[ConfigSource]cloud.KeyedConfigWatcher
- func NewMockKeyedConfig(key, property string, valid bool) cloud.KeyedConfig
- type AWSConfigs
- type AlibabaConfigs
- type AzureConfigs
- type ConfigFileWatcher
- type ConfigSource
- type Configurations
- type Controller
- func (c *Controller) CreateConfig(conf cloud.KeyedConfig) error
- func (c *Controller) DeleteConfig(key, sourceStr string) error
- func (c *Controller) DisableConfig(key, sourceStr string) error
- func (c *Controller) EnableConfig(key, sourceStr string) error
- func (c *Controller) ExportConfigs(key string) (*Configurations, error)
- func (c *Controller) GetAddConfigHandler() func(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (c *Controller) GetDeleteConfigHandler() func(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (c *Controller) GetDisableConfigHandler() func(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (c *Controller) GetEnableConfigHandler() func(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (c *Controller) GetExportConfigHandler() func(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (c *Controller) GetStatus() []Status
- func (c *Controller) RegisterObserver(obs Observer)
- type FileControllerStorage
- type GCPConfigs
- type HelmWatcher
- type MemoryControllerStorage
- type MockConfig
- type MockKeyedConfig
- type MockKeyedConfigWatcher
- type MultiCloudConfig
- type MultiCloudWatcher
- type OCIConfigs
- type Observer
- type Status
- type Statuses
Constants ¶
const ( S3ConfigType = "s3" AthenaConfigType = "athena" BigQueryConfigType = "bigquery" AzureStorageConfigType = "azurestorage" UsageApiConfigType = "usageapi" )
Variables ¶
This section is empty.
Functions ¶
func ConfigTypeFromConfig ¶ added in v1.111.0
func ConfigTypeFromConfig(config cloud.KeyedConfig) (string, error)
func GetCloudBillingWatchers ¶ added in v1.108.0
func GetCloudBillingWatchers(providerConfig models.ProviderConfig) map[ConfigSource]cloud.KeyedConfigWatcher
func NewMockKeyedConfig ¶ added in v1.108.0
func NewMockKeyedConfig(key, property string, valid bool) cloud.KeyedConfig
Types ¶
type AWSConfigs ¶ added in v1.108.0
type AWSConfigs struct { Athena []*aws.AthenaConfiguration `json:"athena,omitempty"` S3 []*aws.S3Configuration `json:"s3,omitempty"` }
func (*AWSConfigs) Equals ¶ added in v1.108.0
func (ac *AWSConfigs) Equals(that *AWSConfigs) bool
type AlibabaConfigs ¶ added in v1.108.0
type AlibabaConfigs struct {
BOA []*alibaba.BOAConfiguration `json:"boa,omitempty"`
}
func (*AlibabaConfigs) Equals ¶ added in v1.108.0
func (ac *AlibabaConfigs) Equals(that *AlibabaConfigs) bool
type AzureConfigs ¶ added in v1.108.0
type AzureConfigs struct {
Storage []*azure.StorageConfiguration `json:"storage,omitempty"`
}
func (*AzureConfigs) Equals ¶ added in v1.108.0
func (ac *AzureConfigs) Equals(that *AzureConfigs) bool
type ConfigFileWatcher ¶ added in v1.108.0
type ConfigFileWatcher struct {
// contains filtered or unexported fields
}
func (*ConfigFileWatcher) GetConfigs ¶ added in v1.108.0
func (cfw *ConfigFileWatcher) GetConfigs() []cloud.KeyedConfig
GetConfigs checks secret files and config map set via the helm chart for Cloud Billing integrations. Returns only one billing integration due to values being shared by different configuration types.
type ConfigSource ¶ added in v1.108.0
type ConfigSource int
ConfigSource is an Enum of the sources int value of the Source determines its priority
const ( UnknownSource ConfigSource = iota ConfigControllerSource MultiCloudSource ConfigFileSource HelmSource )
func GetConfigSource ¶ added in v1.108.0
func GetConfigSource(str string) ConfigSource
func (ConfigSource) String ¶ added in v1.108.0
func (cs ConfigSource) String() string
type Configurations ¶ added in v1.108.0
type Configurations struct { AWS *AWSConfigs `json:"aws,omitempty"` GCP *GCPConfigs `json:"gcp,omitempty"` Azure *AzureConfigs `json:"azure,omitempty"` Alibaba *AlibabaConfigs `json:"alibaba,omitempty"` OCI *OCIConfigs `json:"oci,omitempty"` }
Configurations is a general use container for all configuration types
func (*Configurations) Equals ¶ added in v1.108.0
func (c *Configurations) Equals(that *Configurations) bool
func (*Configurations) Insert ¶ added in v1.108.0
func (c *Configurations) Insert(keyedConfig cloud.Config) error
func (*Configurations) ToSlice ¶ added in v1.108.0
func (c *Configurations) ToSlice() []cloud.KeyedConfig
func (*Configurations) UnmarshalJSON ¶ added in v1.108.0
func (c *Configurations) UnmarshalJSON(bytes []byte) error
UnmarshalJSON custom json unmarshalling to maintain support for MultiCloudConfig format
type Controller ¶ added in v1.108.0
type Controller struct {
// contains filtered or unexported fields
}
Controller manages the cloud.Config using config Watcher(s) to track various configuration methods. To do this it has a map of config watchers mapped on configuration source and a list Observers that it updates upon any change detected from the config watchers.
func NewController ¶ added in v1.108.0
func NewController(providerConfig models.ProviderConfig) *Controller
NewController initializes an Config Controller
func NewMemoryController ¶ added in v1.111.0
func NewMemoryController(providerConfig models.ProviderConfig) *Controller
NewMemoryController initializes a Config Controller backed in memory
func (*Controller) CreateConfig ¶ added in v1.111.0
func (c *Controller) CreateConfig(conf cloud.KeyedConfig) error
CreateConfig adds a new config to status with a source of ConfigControllerSource It will disable any config with the same key fails if there is an existing config with the same key and source
func (*Controller) DeleteConfig ¶ added in v1.108.0
func (c *Controller) DeleteConfig(key, sourceStr string) error
DeleteConfig removes a config from the statuses and deletes the config on all observers if it was active This can only be used on configs with ConfigControllerSource
func (*Controller) DisableConfig ¶ added in v1.108.0
func (c *Controller) DisableConfig(key, sourceStr string) error
DisableConfig updates an config status if it was enabled
func (*Controller) EnableConfig ¶ added in v1.108.0
func (c *Controller) EnableConfig(key, sourceStr string) error
EnableConfig enables a config with the given key and source, and disables any config with a matching key
func (*Controller) ExportConfigs ¶ added in v1.108.0
func (c *Controller) ExportConfigs(key string) (*Configurations, error)
func (*Controller) GetAddConfigHandler ¶ added in v1.111.0
func (c *Controller) GetAddConfigHandler() func(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
GetEnableConfigHandler creates a handler from a http request which enables an integration via the integrationController
func (*Controller) GetDeleteConfigHandler ¶ added in v1.108.0
func (c *Controller) GetDeleteConfigHandler() func(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
GetDeleteConfigHandler creates a handler from a http request which deletes an integration via the integrationController if there are no other integrations with the given integration key, it also clears the data.
func (*Controller) GetDisableConfigHandler ¶ added in v1.108.0
func (c *Controller) GetDisableConfigHandler() func(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
GetDisableConfigHandler creates a handler from a http request which disables an integration via the integrationController
func (*Controller) GetEnableConfigHandler ¶ added in v1.108.0
func (c *Controller) GetEnableConfigHandler() func(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
GetEnableConfigHandler creates a handler from a http request which enables an integration via the integrationController
func (*Controller) GetExportConfigHandler ¶ added in v1.108.0
func (c *Controller) GetExportConfigHandler() func(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
GetEnableConfigHandler creates a handler from a http request which enables an integration via the integrationController
func (*Controller) GetStatus ¶ added in v1.108.0
func (c *Controller) GetStatus() []Status
func (*Controller) RegisterObserver ¶ added in v1.108.0
func (c *Controller) RegisterObserver(obs Observer)
RegisterObserver gives out the current active list configs and adds the observer to the push list
type FileControllerStorage ¶ added in v1.111.0
type FileControllerStorage struct {
// contains filtered or unexported fields
}
type GCPConfigs ¶ added in v1.108.0
type GCPConfigs struct {
BigQuery []*gcp.BigQueryConfiguration `json:"bigQuery,omitempty"`
}
func (*GCPConfigs) Equals ¶ added in v1.108.0
func (gc *GCPConfigs) Equals(that *GCPConfigs) bool
type HelmWatcher ¶ added in v1.108.0
type HelmWatcher struct {
// contains filtered or unexported fields
}
func (*HelmWatcher) GetConfigs ¶ added in v1.108.0
func (hw *HelmWatcher) GetConfigs() []cloud.KeyedConfig
GetConfigs checks secret files and config map set via the helm chart for Cloud Billing integrations. Returns only one billing integration due to values being shared by different configuration types.
type MemoryControllerStorage ¶ added in v1.111.0
type MemoryControllerStorage struct {
// contains filtered or unexported fields
}
MemoryControllerStorage is a ControllerStorage implementation that is backed by a byte array that is marshalled in and out of to ensure that behaviours is same as the file backed version
type MockConfig ¶ added in v1.108.0
type MockConfig struct { }
func (*MockConfig) Equals ¶ added in v1.108.0
func (mc *MockConfig) Equals(config cloud.Config) bool
func (*MockConfig) Sanitize ¶ added in v1.108.0
func (mc *MockConfig) Sanitize() cloud.Config
func (*MockConfig) Validate ¶ added in v1.108.0
func (mc *MockConfig) Validate() error
type MockKeyedConfig ¶ added in v1.108.0
type MockKeyedConfig struct {
// contains filtered or unexported fields
}
MockKeyedConfig implements KeyedConfig it only requires a key to be valid, there is an additional property allowing MockKeyedConfig with the same key to not be equal
func (*MockKeyedConfig) Equals ¶ added in v1.108.0
func (mkc *MockKeyedConfig) Equals(config cloud.Config) bool
func (*MockKeyedConfig) Key ¶ added in v1.108.0
func (mkc *MockKeyedConfig) Key() string
func (*MockKeyedConfig) Provider ¶ added in v1.108.0
func (mkc *MockKeyedConfig) Provider() string
func (*MockKeyedConfig) Sanitize ¶ added in v1.108.0
func (mkc *MockKeyedConfig) Sanitize() cloud.Config
func (*MockKeyedConfig) Validate ¶ added in v1.108.0
func (mkc *MockKeyedConfig) Validate() error
type MockKeyedConfigWatcher ¶ added in v1.108.0
type MockKeyedConfigWatcher struct {
Integrations []cloud.KeyedConfig
}
func (*MockKeyedConfigWatcher) GetConfigs ¶ added in v1.108.0
func (mkcw *MockKeyedConfigWatcher) GetConfigs() []cloud.KeyedConfig
type MultiCloudConfig ¶ added in v1.108.0
type MultiCloudConfig struct { AzureConfigs []azure.AzureStorageConfig `json:"azure"` GCPConfigs []gcp.BigQueryConfig `json:"gcp"` AWSConfigs []aws.AwsAthenaInfo `json:"aws"` AlibabaConfigs []alibaba.AlibabaInfo `json:"alibaba"` }
MultiCloudConfig struct is used to unmarshal cloud configs for each provider out of cloud-integration file Deprecated: v1.104 use Configurations
type MultiCloudWatcher ¶ added in v1.108.0
type MultiCloudWatcher struct { }
MultiCloudWatcher ingests values a MultiCloudConfig from the file pulled in from the secret by the helm chart
func (*MultiCloudWatcher) GetConfigs ¶ added in v1.108.0
func (mcw *MultiCloudWatcher) GetConfigs() []cloud.KeyedConfig
type OCIConfigs ¶ added in v1.112.0
type OCIConfigs struct {
UsageAPI []*oracle.UsageApiConfiguration `json:"usageApi,omitempty"`
}
func (*OCIConfigs) Equals ¶ added in v1.112.0
func (oc *OCIConfigs) Equals(that *OCIConfigs) bool
type Observer ¶ added in v1.108.0
type Observer interface { PutConfig(cloud.KeyedConfig) DeleteConfig(string) SetConfigs(map[string]cloud.KeyedConfig) }
Observer should be implemented by any struct which need access to the up-to-date list of active configs that the Config.Controller provides. Any cloud billing Integration in the application that is used in the application should pass through this interface, and be revoked if it is not included in a Delete call.
type Status ¶ added in v1.108.0
type Status struct { Source ConfigSource `json:"source"` Key string `json:"key"` Active bool `json:"active"` Valid bool `json:"valid"` ConfigType string `json:"configType"` Config cloud.KeyedConfig `json:"config"` }