Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename ValidateHeaders to ValidateHeader #60

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 4 additions & 4 deletions validator/internal/centralconsumer/centralconsumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ type Settings struct {
// NumInferrers defines the maximum amount of inflight destination topic inference jobs (validation and routing).
NumInferrers int

// ValidateHeaders defines if the messages' headers will be validated
ValidateHeaders bool
// ValidateHeader defines if the messages' headers will be validated
ValidateHeader bool

// DefaultHeaderSchemaId is default ID of the header schema
DefaultHeaderSchemaId string
Expand Down Expand Up @@ -143,7 +143,7 @@ func New(registry registry.SchemaRegistry, publisher broker.Publisher, validator
if settings.NumInferrers > 0 {
validatorsSem = make(chan struct{}, settings.NumInferrers)
}
if settings.ValidateHeaders {
if settings.ValidateHeader {
_, ok := validators["json"]
if !ok {
// if json validation is turned off, this version of json validator is used by default for validating message header
Expand Down Expand Up @@ -200,7 +200,7 @@ func New(registry registry.SchemaRegistry, publisher broker.Publisher, validator
Specification: schemaVersion.Specification,
},
encryptionKey: encryptionKey,
validateHeaders: settings.ValidateHeaders,
validateHeaders: settings.ValidateHeader,
defaultHeaderSchema: config.DefaultHeaderSchema{
DefaultHeaderSchemaId: settings.DefaultHeaderSchemaId,
DefaultHeaderSchemaVersion: settings.DefaultHeaderSchemaVersion,
Expand Down
2 changes: 1 addition & 1 deletion validator/internal/config/centralconsumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type CentralConsumer struct {
ShouldLog CentralConsumerShouldLog `toml:"should_log"`
NumSchemaCollectors int `toml:"num_schema_collectors" default:"-1"`
NumInferrers int `toml:"num_inferrers" default:"-1"`
ValidateHeaders bool `toml:"validate_headers"`
ValidateHeader bool `toml:"validate_header"`
DefaultHeaderSchema DefaultHeaderSchema `toml:"default_header_schema"`
MetricsLoggingInterval time.Duration `toml:"metrics_logging_interval" default:"5s"`
RunOptions RunOptions `toml:"run_option"`
Expand Down
2 changes: 1 addition & 1 deletion validator/internal/janitorctl/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func RunCentralConsumer(configFile string) {
centralconsumer.Settings{
NumSchemaCollectors: cfg.NumSchemaCollectors,
NumInferrers: cfg.NumInferrers,
ValidateHeaders: cfg.ValidateHeaders,
ValidateHeader: cfg.ValidateHeader,
DefaultHeaderSchemaId: cfg.DefaultHeaderSchema.DefaultHeaderSchemaId,
DefaultHeaderSchemaVersion: cfg.DefaultHeaderSchema.DefaultHeaderSchemaVersion,
},
Expand Down
Loading