-
Notifications
You must be signed in to change notification settings - Fork 95
/
Copy pathFluxConnectionOptions.cs
47 lines (38 loc) · 1.35 KB
/
FluxConnectionOptions.cs
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
using System;
using System.Net;
namespace InfluxDB.Client.Flux
{
public class FluxConnectionOptions
{
public enum AuthenticationType
{
UrlQueryParameters,
BasicAuthentication
}
public string Url { get; private set; }
public TimeSpan Timeout { get; private set; }
public string Username { get; }
public char[] Password { get; }
public AuthenticationType Authentication { get; }
public IWebProxy WebProxy { get; }
public FluxConnectionOptions(string url) : this(url, TimeSpan.FromSeconds(60))
{
}
public FluxConnectionOptions(string url, string username = "", char[] password = null,
AuthenticationType authentication = AuthenticationType.UrlQueryParameters) : this(url,
TimeSpan.FromSeconds(60), username, password, authentication)
{
}
public FluxConnectionOptions(string url, TimeSpan timeout, string username = "", char[] password = null,
AuthenticationType authentication = AuthenticationType.UrlQueryParameters,
IWebProxy webProxy = null)
{
Url = url;
Timeout = timeout;
Username = username;
Password = password;
Authentication = authentication;
WebProxy = webProxy;
}
}
}