Class: InfluxDB::Config
- Inherits:
-
Object
- Object
- InfluxDB::Config
- Defined in:
- lib/influxdb/config.rb
Overview
InfluxDB client configuration
Constant Summary collapse
- AUTH_METHODS =
["params".freeze, "basic_auth".freeze].freeze
Instance Attribute Summary collapse
-
#async ⇒ Object
readonly
Returns the value of attribute async.
-
#auth_method ⇒ Object
Returns the value of attribute auth_method.
-
#database ⇒ Object
Returns the value of attribute database.
-
#denormalize ⇒ Object
Returns the value of attribute denormalize.
-
#epoch ⇒ Object
Returns the value of attribute epoch.
-
#initial_delay ⇒ Object
Returns the value of attribute initial_delay.
-
#max_delay ⇒ Object
Returns the value of attribute max_delay.
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
-
#retry ⇒ Object
Returns the value of attribute retry.
-
#ssl_ca_cert ⇒ Object
Returns the value of attribute ssl_ca_cert.
-
#time_precision ⇒ Object
Returns the value of attribute time_precision.
-
#udp ⇒ Object
readonly
Returns the value of attribute udp.
-
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
-
#username ⇒ Object
Returns the value of attribute username.
-
#verify_ssl ⇒ Object
Returns the value of attribute verify_ssl.
Instance Method Summary collapse
- #async? ⇒ Boolean
- #hosts ⇒ Object
-
#initialize(opts = {}) ⇒ Config
constructor
A new instance of Config.
- #next_host ⇒ Object
- #udp? ⇒ Boolean
Constructor Details
#initialize(opts = {}) ⇒ Config
Returns a new instance of Config.
28 29 30 31 32 33 34 35 36 |
# File 'lib/influxdb/config.rb', line 28 def initialize(opts = {}) (opts) (opts) (opts) (opts) configure_retry! opts.fetch(:retry, nil) configure_hosts! opts[:hosts] || opts[:host] || "localhost".freeze end |
Instance Attribute Details
#async ⇒ Object (readonly)
Returns the value of attribute async.
26 27 28 |
# File 'lib/influxdb/config.rb', line 26 def async @async end |
#auth_method ⇒ Object
Returns the value of attribute auth_method.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def auth_method @auth_method end |
#database ⇒ Object
Returns the value of attribute database.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def database @database end |
#denormalize ⇒ Object
Returns the value of attribute denormalize.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def denormalize @denormalize end |
#epoch ⇒ Object
Returns the value of attribute epoch.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def epoch @epoch end |
#initial_delay ⇒ Object
Returns the value of attribute initial_delay.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def initial_delay @initial_delay end |
#max_delay ⇒ Object
Returns the value of attribute max_delay.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def max_delay @max_delay end |
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def open_timeout @open_timeout end |
#password ⇒ Object
Returns the value of attribute password.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def port @port end |
#prefix ⇒ Object
Returns the value of attribute prefix.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def prefix @prefix end |
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def read_timeout @read_timeout end |
#retry ⇒ Object
Returns the value of attribute retry.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def retry @retry end |
#ssl_ca_cert ⇒ Object
Returns the value of attribute ssl_ca_cert.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def ssl_ca_cert @ssl_ca_cert end |
#time_precision ⇒ Object
Returns the value of attribute time_precision.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def time_precision @time_precision end |
#udp ⇒ Object (readonly)
Returns the value of attribute udp.
26 27 28 |
# File 'lib/influxdb/config.rb', line 26 def udp @udp end |
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def use_ssl @use_ssl end |
#username ⇒ Object
Returns the value of attribute username.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def username @username end |
#verify_ssl ⇒ Object
Returns the value of attribute verify_ssl.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def verify_ssl @verify_ssl end |
Instance Method Details
#async? ⇒ Boolean
42 43 44 |
# File 'lib/influxdb/config.rb', line 42 def async? async != false end |
#hosts ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/influxdb/config.rb', line 52 def hosts Array.new(@hosts_queue.length) do host = @hosts_queue.pop @hosts_queue.push(host) host end end |
#next_host ⇒ Object
46 47 48 49 50 |
# File 'lib/influxdb/config.rb', line 46 def next_host host = @hosts_queue.pop @hosts_queue.push(host) host end |
#udp? ⇒ Boolean
38 39 40 |
# File 'lib/influxdb/config.rb', line 38 def udp? udp != false end |