-
Notifications
You must be signed in to change notification settings - Fork 20
/
config.rb
55 lines (48 loc) · 1.2 KB
/
config.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# 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,
:cache_enabled,
:cache,
database: "db",
time_precision: "ns",
time_duration_suffix_enabled: false
def load(*)
super
if cache_enabled.nil?
self.cache_enabled = cache_enabled_value
end
end
def cache=(value)
super
self.cache_enabled = cache_enabled_value
end
private
def cache_enabled_value
!!cache
end
end
end