Module: FakeFlorence

Defined in:
lib/fake_florence.rb,
lib/fake_florence/cli.rb,
lib/fake_florence/config.rb,
lib/fake_florence/daemon.rb,
lib/fake_florence/server.rb,
lib/fake_florence/feature.rb,
lib/fake_florence/version.rb,
lib/fake_florence/retriever.rb,
lib/fake_florence/announcers.rb,
lib/fake_florence/feature_cache.rb,
lib/fake_florence/feature_schema.rb,
lib/fake_florence/announcers/routemaster.rb

Defined Under Namespace

Modules: Announcers, Config Classes: Cli, Daemon, Feature, FeatureCache, Retriever, Server

Constant Summary collapse

VERSION =
'1.0.0'
FeatureSchema =
Dry::Validation.Schema do
  configure { config.input_processor = :sanitizer }

  required('id').maybe(:str?)

  required('name').filled(:str?)
  required('identifier').filled(:str?)
  required('bucket_type').filled(:str?)
  required('active').filled(:bool?)
  required('target_groups').each do
    schema do
      required('rollout') { int? & gteq?(0) & lteq?(65536) }
      # TODO: any key => :str?
      required('constraints').filled(:hash?)
    end
  end

  # TODO: any key => :int?
  required('variants').filled(:hash?)
  required('winning_variant').filled(:str?)

  # TODO: any key => :str?, :bool?
  required('overrides', Dry::Types::Hash).filled
end