Sha256: 667540fe0700dbaf31dfc9ca6b2f6b818735ab405eb79df13e6d8ad137812157

Contents?: true

Size: 673 Bytes

Versions: 11

Compression:

Stored size: 673 Bytes

Contents

# frozen_string_literal: true

module WaterDrop
  module Contracts
    # Contract with validation rules for validating that all the message options that
    # we provide to producer ale valid and usable
    # @note Does not validate message itself as it is not our concern
    class MessageOptions < Dry::Validation::Contract
      params do
        required(:topic).filled(:str?, format?: TOPIC_REGEXP)
        optional(:key).maybe(:str?, :filled?)
        optional(:partition).filled(:int?, gteq?: 0)
        optional(:partition_key).maybe(:str?, :filled?)
        optional(:create_time).maybe(:time?)
        optional(:headers).maybe(:hash?)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
waterdrop-1.4.4 lib/water_drop/contracts/message_options.rb
waterdrop-1.4.3 lib/water_drop/contracts/message_options.rb
waterdrop-1.4.2 lib/water_drop/contracts/message_options.rb
waterdrop-1.4.1 lib/water_drop/contracts/message_options.rb
waterdrop-1.4.0 lib/water_drop/contracts/message_options.rb
waterdrop-1.3.4 lib/water_drop/contracts/message_options.rb
waterdrop-1.3.3 lib/water_drop/contracts/message_options.rb
waterdrop-1.3.2 lib/water_drop/contracts/message_options.rb
waterdrop-1.3.1 lib/water_drop/contracts/message_options.rb
waterdrop-1.3.0 lib/water_drop/contracts/message_options.rb
waterdrop-1.3.0.rc1 lib/water_drop/contracts/message_options.rb