Commit 5f84065 1 parent 55bbc07 commit 5f84065 Copy full SHA for 5f84065
File tree 1 file changed +29
-10
lines changed
1 file changed +29
-10
lines changed Original file line number Diff line number Diff line change @@ -120,15 +120,7 @@ const auto response = influxdb->execute("SHOW DATABASES");
120
120
121
121
## Transports
122
122
123
- An underlying transport is fully configurable by passing an URI:
124
- ```
125
- [protocol]://[username:password@]host:port[?db=database]
126
-
127
- # Auth token:
128
- [protocol]://[token@]host:port[?db=database]
129
- ```
130
- <br >
131
- List of supported transport is following:
123
+ Supported transports:
132
124
133
125
| Name | Dependency | URI protocol | Sample URI |
134
126
| ----------- | :-----------:| :--------------:| -------------------------------------:|
@@ -137,9 +129,36 @@ List of supported transport is following:
137
129
| UDP | boost | ` udp ` | ` udp://localhost:8094 ` |
138
130
| Unix socket | boost | ` unix ` | ` unix:///tmp/telegraf.sock ` |
139
131
140
-
141
132
<sup >i)</sup > boost is needed to support queries.
142
133
134
+ ### Configuration by URI
135
+
136
+ An underlying transport is configurable by passing an URI. ` [protocol] ` determines the actual transport type:
137
+
138
+ ``` cpp
139
+ auto influxdb = influxdb::InfluxDBFactory::Get(" http://localhost:8086?db=test" );
140
+ ```
141
+
142
+ URI Format:
143
+
144
+ ```
145
+ [protocol]://[username:password@]host:port[?db=database]
146
+
147
+ # Auth token:
148
+ [protocol]://[token@]host:port[?db=database]
149
+ ```
150
+
151
+ ### Additional transport configuration * (HTTP only)*
152
+
153
+ The HTTP transport supports additional configurations beyond the limited URI parameters:
154
+
155
+ ``` cpp
156
+ auto influxdb = InfluxDBBuilder::http(" http://localhost:8086?db=test" )
157
+ .setTimeout(std::chrono::seconds{20})
158
+ .setAuthToken("<token >")
159
+ .connect();
160
+ ```
161
+
143
162
144
163
## InfluxDB v2.x compatibility
145
164
You can’t perform that action at this time.
0 commit comments