-
Notifications
You must be signed in to change notification settings - Fork 370
/
DnsSrvServiceEndpointProviderOptions.cs
43 lines (36 loc) · 1.56 KB
/
DnsSrvServiceEndpointProviderOptions.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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Microsoft.Extensions.ServiceDiscovery.Dns;
/// <summary>
/// Options for configuring <see cref="DnsSrvServiceEndpointProvider"/>.
/// </summary>
public class DnsSrvServiceEndpointProviderOptions
{
/// <summary>
/// Gets or sets the default refresh period for endpoints resolved from DNS.
/// </summary>
public TimeSpan DefaultRefreshPeriod { get; set; } = TimeSpan.FromMinutes(1);
/// <summary>
/// Gets or sets the initial period between retries.
/// </summary>
public TimeSpan MinRetryPeriod { get; set; } = TimeSpan.FromSeconds(1);
/// <summary>
/// Gets or sets the maximum period between retries.
/// </summary>
public TimeSpan MaxRetryPeriod { get; set; } = TimeSpan.FromSeconds(30);
/// <summary>
/// Gets or sets the retry period growth factor.
/// </summary>
public double RetryBackOffFactor { get; set; } = 2;
/// <summary>
/// Gets or sets the default DNS query suffix for services resolved via this provider.
/// </summary>
/// <remarks>
/// If not specified, the provider will attempt to infer the namespace.
/// </remarks>
public string? QuerySuffix { get; set; }
/// <summary>
/// Gets or sets a delegate used to determine whether to apply host name metadata to each resolved endpoint. Defaults to <c>false</c>.
/// </summary>
public Func<ServiceEndpoint, bool> ShouldApplyHostNameMetadata { get; set; } = _ => false;
}