config

package
v0.23.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigmapDataCheckSum added in v0.23.0

func ConfigmapDataCheckSum(configMapData map[string]string) string

func InitializeKafkaConfigMapWatcher

func InitializeKafkaConfigMapWatcher(ctx context.Context, watcher configmap.Watcher, logger *zap.SugaredLogger, handler LoggingObserver, namespace string) error

Initialize The Specified Context With A ConfigMap Watcher Much Of This Function Is Taken From The knative.dev sharedmain Package

Types

type EKCloudEventConfig

type EKCloudEventConfig struct {
	MaxIdleConns        int `json:"maxIdleConns,omitempty"`
	MaxIdleConnsPerHost int `json:"maxIdleConnsPerHost,omitempty"`
}

EKCloudEventConfig contains the values send to the Knative cloudevents' ConfigureConnectionArgs function If they are not provided in the configmap, the DefaultMaxIdleConns and DefaultMaxIdleConnsPerHost constants are used

type EKDispatcherConfig

type EKDispatcherConfig struct {
	EKKubernetesConfig
}

EKDispatcherConfig has the base Kubernetes fields (Cpu, Memory, Replicas) only

type EKKafkaConfig

type EKKafkaConfig struct {
	Brokers             string             `json:"brokers,omitempty"`
	EnableSaramaLogging bool               `json:"enableSaramaLogging,omitempty"`
	Topic               EKKafkaTopicConfig `json:"topic,omitempty"`
	AdminType           string             `json:"adminType,omitempty"`
	AuthSecretName      string             `json:"authSecretName,omitempty"`
	AuthSecretNamespace string             `json:"authSecretNamespace,omitempty"`
}

EKKafkaConfig contains items relevant to Kafka specifically, and the Sarama logging flag

type EKKafkaTopicConfig

type EKKafkaTopicConfig struct {
	DefaultNumPartitions     int32 `json:"defaultNumPartitions,omitempty"`
	DefaultReplicationFactor int16 `json:"defaultReplicationFactor,omitempty"`
	DefaultRetentionMillis   int64 `json:"defaultRetentionMillis,omitempty"`
}

EKKafkaTopicConfig contains some defaults that are only used if not provided by the channel spec

type EKKubernetesConfig

type EKKubernetesConfig struct {
	CpuLimit      resource.Quantity `json:"cpuLimit,omitempty"`
	CpuRequest    resource.Quantity `json:"cpuRequest,omitempty"`
	MemoryLimit   resource.Quantity `json:"memoryLimit,omitempty"`
	MemoryRequest resource.Quantity `json:"memoryRequest,omitempty"`
	Replicas      int               `json:"replicas,omitempty"`
}

EKKubernetesConfig and these EK sub-structs contain our custom configuration settings, stored in the config-kafka configmap. The sub-structs are explicitly declared so that they can have their own JSON tags in the overall EventingKafkaConfig

type EKReceiverConfig

type EKReceiverConfig struct {
	EKKubernetesConfig
}

EKReceiverConfig has the base Kubernetes fields (Cpu, Memory, Replicas) only

type EventingKafkaConfig

type EventingKafkaConfig struct {
	Receiver    EKReceiverConfig   `json:"receiver,omitempty"`
	Dispatcher  EKDispatcherConfig `json:"dispatcher,omitempty"`
	CloudEvents EKCloudEventConfig `json:"cloudevents,omitempty"`
	Kafka       EKKafkaConfig      `json:"kafka,omitempty"`
}

EventingKafkaConfig is the main struct that holds the Receiver, Dispatcher, and Kafka sub-items

type LoggingObserver

type LoggingObserver func(ctx context.Context, configMap *corev1.ConfigMap)

This function type is for a shim so that we can pass our own logger to the Observer function

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL