Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

fix: use pointer for struct field so the default value from unmarshal is nil #36

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/utils/consumer_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ type ConsumerConfig struct {
ReceiverQueueSize int `json:"receiverQueueSize,omitempty" yaml:"receiverQueueSize"`
SchemaProperties map[string]string `json:"schemaProperties,omitempty" yaml:"schemaProperties"`
ConsumerProperties map[string]string `json:"consumerProperties,omitempty" yaml:"consumerProperties"`
CryptoConfig CryptoConfig `json:"cryptoConfig,omitempty" yaml:"cryptoConfig"`
CryptoConfig *CryptoConfig `json:"cryptoConfig,omitempty" yaml:"cryptoConfig"`
PoolMessages bool `json:"poolMessages,omitempty" yaml:"poolMessages"`
}
1 change: 1 addition & 0 deletions pkg/utils/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ type SinkData struct {
MaxMessageRetries int `json:"maxMessageRetries,omitempty"`
DeadLetterTopic string `json:"deadLetterTopic,omitempty"`
ProcessingGuarantees string `json:"processingGuarantees,omitempty"`
RetainKeyOrdering bool `json:"retainKeyOrdering,omitempty"`
Archive string `json:"archive,omitempty"`
ClassName string `json:"className,omitempty"`
SinkConfigFile string `json:"sinkConfigFile,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/function_confg.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type FunctionConfig struct {

Output string `json:"output,omitempty" yaml:"output"`

ProducerConfig ProducerConfig `json:"producerConfig,omitempty" yaml:"producerConfig"`
ProducerConfig *ProducerConfig `json:"producerConfig,omitempty" yaml:"producerConfig"`
CustomSchemaOutputs map[string]string `json:"customSchemaOutputs,omitempty" yaml:"customSchemaOutputs"`

OutputSerdeClassName string `json:"outputSerdeClassName,omitempty" yaml:"outputSerdeClassName"`
Expand Down
8 changes: 4 additions & 4 deletions pkg/utils/producer_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type ProducerConfig struct {
//nolint
MaxPendingMessagesAcrossPartitions int `json:"maxPendingMessagesAcrossPartitions" yaml:"maxPendingMessagesAcrossPartitions"`

UseThreadLocalProducers bool `json:"useThreadLocalProducers" yaml:"useThreadLocalProducers"`
CryptoConfig CryptoConfig `json:"cryptoConfig" yaml:"cryptoConfig"`
BatchBuilder string `json:"batchBuilder" yaml:"batchBuilder"`
CompressionType string `json:"compressionType" yaml:"compressionType"`
UseThreadLocalProducers bool `json:"useThreadLocalProducers" yaml:"useThreadLocalProducers"`
CryptoConfig *CryptoConfig `json:"cryptoConfig" yaml:"cryptoConfig"`
BatchBuilder string `json:"batchBuilder" yaml:"batchBuilder"`
CompressionType string `json:"compressionType" yaml:"compressionType"`
}
6 changes: 3 additions & 3 deletions pkg/utils/source_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type SourceConfig struct {
Name string `json:"name,omitempty" yaml:"name"`
ClassName string `json:"className,omitempty" yaml:"className"`

ProducerConfig ProducerConfig `json:"producerConfig,omitempty" yaml:"producerConfig"`
ProducerConfig *ProducerConfig `json:"producerConfig,omitempty" yaml:"producerConfig"`

TopicName string `json:"topicName,omitempty" yaml:"topicName"`
SerdeClassName string `json:"serdeClassName,omitempty" yaml:"serdeClassName"`
Expand All @@ -45,6 +45,6 @@ type SourceConfig struct {

CustomRuntimeOptions string `json:"customRuntimeOptions,omitempty" yaml:"customRuntimeOptions"`

BatchSourceConfig BatchSourceConfig `json:"batchSourceConfig,omitempty" yaml:"batchSourceConfig"`
BatchBuilder string `json:"batchBuilder,omitempty" yaml:"batchBuilder"`
BatchSourceConfig *BatchSourceConfig `json:"batchSourceConfig,omitempty" yaml:"batchSourceConfig"`
BatchBuilder string `json:"batchBuilder,omitempty" yaml:"batchBuilder"`
}