Documentation ¶
Index ¶
- 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) DeleteConfig(key, source string) error
- func (c *Controller) DisableConfig(key, source string) error
- func (c *Controller) EnableConfig(key, source string) error
- func (c *Controller) ExportConfigs(key string) (*Configurations, error)
- 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 GCPConfigs
- type HelmWatcher
- type MockConfig
- type MockKeyedConfig
- type MockKeyedConfigWatcher
- type MultiCloudConfig
- type MultiCloudWatcher
- type Observer
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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"` }
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(cp models.Provider) *Controller
NewController initializes an Config Controller
func (*Controller) DeleteConfig ¶ added in v1.108.0
func (c *Controller) DeleteConfig(key, source string) error
DeleteConfig removes an config from the statuses and deletes the config on all observers if it was active
func (*Controller) DisableConfig ¶ added in v1.108.0
func (c *Controller) DisableConfig(key, source string) error
DisableConfig updates an config status if it was enabled
func (*Controller) EnableConfig ¶ added in v1.108.0
func (c *Controller) EnableConfig(key, source string) error
func (*Controller) ExportConfigs ¶ added in v1.108.0
func (c *Controller) ExportConfigs(key string) (*Configurations, error)
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 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 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 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 Key string Active bool Valid bool Config cloud.KeyedConfig }