/
IProxyConfig.cs
37 lines (30 loc) · 1.14 KB
/
IProxyConfig.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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using Microsoft.Extensions.Primitives;
namespace Yarp.ReverseProxy.Configuration;
/// <summary>
/// Represents a snapshot of proxy configuration data. These properties may be accessed multiple times and should not be modified.
/// </summary>
public interface IProxyConfig
{
private static readonly ConditionalWeakTable<IProxyConfig, string> _revisionIdsTable = new();
/// <summary>
/// A unique identifier for this revision of the configuration.
/// </summary>
string RevisionId => _revisionIdsTable.GetValue(this, static _ => Guid.NewGuid().ToString());
/// <summary>
/// Routes matching requests to clusters.
/// </summary>
IReadOnlyList<RouteConfig> Routes { get; }
/// <summary>
/// Cluster information for where to proxy requests to.
/// </summary>
IReadOnlyList<ClusterConfig> Clusters { get; }
/// <summary>
/// A notification that triggers when this snapshot expires.
/// </summary>
IChangeToken ChangeToken { get; }
}