Documentation ¶
Overview ¶
Package config holds the typed objects that define the schemas for ConfigMap objects that pertain to our API objects.
Index ¶
Constants ¶
const ( // KafkaDefaultsConfigName is the name of config map for the default // configs that KafkaSource should use. KafkaDefaultsConfigName = "config-kafka-source-defaults" // DefaultAutoscalingClassKey is the name of autoscaler class annotation DefaultAutoscalingClassKey = "autoscalingClass" // DefaultMinScaleKey is the name of the key corresponding to the KEDA minScale annotation DefaultMinScaleKey = "minScale" // DefaultMaxScaleKey is the name of the KEDA maxScale annotation DefaultMaxScaleKey = "maxScale" // DefaultPollingIntervalKey is the name of the KEDA pollingInterval annotation DefaultPollingIntervalKey = "pollingInterval" // DefaultCooldownPeriodKey is the name of the KEDA cooldownPeriod annotation DefaultCooldownPeriodKey = "cooldownPeriod" // DefaultKafkaLagThresholdKey is the name of the KEDA kafkaLagThreshold annotation DefaultKafkaLagThresholdKey = "kafkaLagThreshold" // KedaAutoscalingClass is the class name for KEDA KedaAutoscalingClass = "keda.autoscaling.knative.dev" // DefaultMinScaleValue is the default value for DefaultMinScaleKey DefaultMinScaleValue = int64(1) // DefaultMaxScaleValue is the default value for DefaultMaxScaleKey DefaultMaxScaleValue = int64(1) // DefaultPollingIntervalValue is the default value for DefaultPollingIntervalKey DefaultPollingIntervalValue = int64(30) // DefaultCooldownPeriodValue is the default value for DefaultCooldownPeriodKey DefaultCooldownPeriodValue = int64(300) // DefaultKafkaLagThresholdValue is the default value for DefaultKafkaLagThresholdKey DefaultKafkaLagThresholdValue = int64(10) )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
KafkaSourceDefaults *KafkaSourceDefaults
}
Config holds the collection of configurations that we attach to contexts. +k8s:deepcopy-gen=false
func FromContext ¶
FromContext extracts a Config from the provided context.
func FromContextOrDefaults ¶
FromContextOrDefaults is like FromContext, but when no Config is attached it returns a Config populated with the defaults for each of the Config fields.
type KafkaSourceDefaults ¶
type KafkaSourceDefaults struct { AutoscalingClass string `json:"autoscalingClass,omitempty"` MinScale int64 `json:"minScale,omitempty"` MaxScale int64 `json:"maxScale,omitempty"` PollingInterval int64 `json:"pollingInterval,omitempty"` CooldownPeriod int64 `json:"cooldownPeriod,omitempty"` KafkaLagThreshold int64 `json:"kafkaLagThreshold,omitempty"` }
func NewKafkaDefaultsConfigFromConfigMap ¶
func NewKafkaDefaultsConfigFromConfigMap(config *corev1.ConfigMap) (*KafkaSourceDefaults, error)
NewKafkaDefaultsConfigFromConfigMap creates a KafkaSourceDefaults from the supplied configMap
func NewKafkaDefaultsConfigFromMap ¶
func NewKafkaDefaultsConfigFromMap(data map[string]string) (*KafkaSourceDefaults, error)
NewKafkaDefaultsConfigFromMap creates a KafkaSourceDefaults from the supplied Map
func (*KafkaSourceDefaults) DeepCopy ¶
func (d *KafkaSourceDefaults) DeepCopy() *KafkaSourceDefaults
type Store ¶
type Store struct {
*configmap.UntypedStore
}
Store is a typed wrapper around configmap.Untyped store to handle our configmaps. +k8s:deepcopy-gen=false
func NewStore ¶
NewStore creates a new store of Configs and optionally calls functions when ConfigMaps are updated.