/
Config.cs
54 lines (44 loc) · 1.48 KB
/
Config.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
48
49
50
51
52
53
54
#pragma warning disable RCS1102,CA1822
namespace FastEndpoints;
/// <summary>
/// global configuration settings for FastEndpoints
/// </summary>
public sealed class Config
{
internal static IServiceResolver ServiceResolver;
internal static BindingOptions BndOpts = new();
internal static EndpointOptions EpOpts = new();
internal static ErrorOptions ErrOpts = new();
internal static SecurityOptions SecOpts = new();
internal static SerializerOptions SerOpts = new();
internal static ThrottleOptions ThrOpts = new();
internal static VersioningOptions VerOpts = new();
/// <summary>
/// request binding settings
/// </summary>
public BindingOptions Binding => BndOpts;
/// <summary>
/// endpoint dicovery & registration settings
/// </summary>
public EndpointOptions Endpoints => EpOpts;
/// <summary>
/// error response customization settings
/// </summary>
public ErrorOptions Errors => ErrOpts;
/// <summary>
/// security related settings
/// </summary>
public SecurityOptions Security => SecOpts;
/// <summary>
/// settings for customizing serialization behavior
/// </summary>
public SerializerOptions Serializer => SerOpts;
/// <summary>
/// endpoint throttling/ rate limiting settings
/// </summary>
public ThrottleOptions Throttle => ThrOpts;
/// <summary>
/// endpoint versioning settings
/// </summary>
public VersioningOptions Versioning => VerOpts;
}