Class: Karafka::Contracts::Base

Inherits:
Karafka::Core::Contractable::Contract
  • Object
show all
Defined in:
lib/karafka/contracts/base.rb

Overview

Base contract for all Karafka contracts

Direct Known Subclasses

ActiveJob::JobOptionsContract, Config, ConsumerGroup, Routing, ServerCliOptions, Topic, Pro::Contracts::Base, Pro::Encryption::Contracts::Config, Pro::RecurringTasks::Contracts::Config, Pro::RecurringTasks::Contracts::Task, Pro::Routing::Features::AdaptiveIterator::Contracts::Topic, Pro::Routing::Features::DeadLetterQueue::Contracts::Topic, Pro::Routing::Features::Delaying::Contracts::Topic, Pro::Routing::Features::DirectAssignments::Contracts::ConsumerGroup, Pro::Routing::Features::DirectAssignments::Contracts::Topic, Pro::Routing::Features::Expiring::Contracts::Topic, Pro::Routing::Features::Filtering::Contracts::Topic, Pro::Routing::Features::InlineInsights::Contracts::Topic, Pro::Routing::Features::LongRunningJob::Contracts::Topic, Pro::Routing::Features::Multiplexing::Contracts::Topic, Pro::Routing::Features::OffsetMetadata::Contracts::Topic, Pro::Routing::Features::Patterns::Contracts::ConsumerGroup, Pro::Routing::Features::Patterns::Contracts::Pattern, Pro::Routing::Features::Patterns::Contracts::Topic, Pro::Routing::Features::Pausing::Contracts::Topic, Pro::Routing::Features::PeriodicJob::Contracts::Topic, Pro::Routing::Features::RecurringTasks::Contracts::Topic, Pro::Routing::Features::ScheduledMessages::Contracts::Topic, Pro::Routing::Features::Swarm::Contracts::Routing, Pro::Routing::Features::Swarm::Contracts::Topic, Pro::Routing::Features::Throttling::Contracts::Topic, Pro::Routing::Features::VirtualPartitions::Contracts::Topic, Pro::ScheduledMessages::Contracts::Config, Pro::ScheduledMessages::Contracts::Message, Routing::Features::ActiveJob::Contracts::Topic, Routing::Features::DeadLetterQueue::Contracts::Topic, Routing::Features::Declaratives::Contracts::Topic, Routing::Features::Deserializers::Contracts::Topic, Routing::Features::Eofed::Contracts::Topic, Routing::Features::InlineInsights::Contracts::Topic, Routing::Features::ManualOffsetManagement::Contracts::Topic

Instance Method Summary collapse

Instance Method Details

#validate!(data) ⇒ Boolean

Note:

We use contracts only in the config validation context, so no need to add support for multiple error classes. It will be added when it will be needed.

Returns true if all good.

Parameters:

  • data (Hash)

    data for validation

Returns:

  • (Boolean)

    true if all good

Raises:



12
13
14
# File 'lib/karafka/contracts/base.rb', line 12

def validate!(data)
  super(data, Errors::InvalidConfigurationError)
end