Sha256: 9445586e3215344c9f51f9328fef43b784fe0000318b0a48ebd2c4cfeb106600

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require 'anyway_config'

module Influxer
  # Influxer configuration
  class Config < Anyway::Config
    config_name :influxdb

    # influxdb-ruby configuration parameters + cache option
    attr_config :hosts,
                :host,
                :port,
                :username,
                :password,
                :database,
                :time_precision,
                :use_ssl,
                :verify_ssl,
                :ssl_ca_cert,
                :auth_method,
                :initial_delay,
                :max_delay,
                :open_timeout,
                :read_timeout,
                :retry,
                :prefix,
                :denormalize,
                :udp,
                :async,
                database: 'db',
                time_precision: 'ns',
                cache: false

    def load(*)
      super
      # we want pass @cache value as options to cache store, so we want it to be a Hash
      @cache = {}.with_indifferent_access if @cache == true
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
influxer-1.1.3 lib/influxer/config.rb
influxer-1.1.2 lib/influxer/config.rb