Sha256: 8ba6ea2cfa1403bcbd3b60d21d2dc0623b47bdf6f553c9b2ed1a40959a5b2832

Contents?: true

Size: 1.76 KB

Versions: 32

Compression:

Stored size: 1.76 KB

Contents

require "ldclient-rb/impl/integrations/consul_impl"
require "ldclient-rb/integrations/util/store_wrapper"

module LaunchDarkly
  module Integrations
    module Consul
      #
      # Default value for the `prefix` option for {new_feature_store}.
      #
      # @return [String]  the default key prefix
      #
      def self.default_prefix
        'launchdarkly'
      end

      #
      # Creates a Consul-backed persistent feature store.
      #
      # To use this method, you must first install the gem `diplomat`. Then, put the object returned by
      # this method into the `feature_store` property of your client configuration ({LaunchDarkly::Config}).
      #
      # @param opts [Hash] the configuration options
      # @option opts [Hash] :consul_config  an instance of `Diplomat::Configuration` to replace the default
      #   Consul client configuration (note that this is exactly the same as modifying `Diplomat.configuration`)
      # @option opts [String] :url   shortcut for setting the `url` property of the Consul client configuration
      # @option opts [String] :prefix  namespace prefix to add to all keys used by LaunchDarkly
      # @option opts [Logger] :logger  a `Logger` instance; defaults to `Config.default_logger`
      # @option opts [Integer] :expiration (15)  expiration time for the in-memory cache, in seconds; 0 for no local caching
      # @option opts [Integer] :capacity (1000)  maximum number of items in the cache
      # @return [LaunchDarkly::Interfaces::FeatureStore]  a feature store object
      #
      def self.new_feature_store(opts, &block)
        core = LaunchDarkly::Impl::Integrations::Consul::ConsulFeatureStoreCore.new(opts)
        return LaunchDarkly::Integrations::Util::CachingStoreWrapper.new(core, opts)
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
launchdarkly-server-sdk-6.2.5 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-6.2.4 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-6.2.3 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-6.2.2 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-6.2.1 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-6.2.0 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-6.1.1 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-6.1.0 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-6.0.0 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-5.8.2 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-5.8.1 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-5.8.0 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-5.7.4 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-5.7.3 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-5.7.2 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-5.7.1 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-5.7.0 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-5.6.2 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-5.6.1 lib/ldclient-rb/integrations/consul.rb
launchdarkly-server-sdk-5.6.0 lib/ldclient-rb/integrations/consul.rb