Class InMemoryConfigProvider
Provides an implementation of IProxyConfigProvider to support config being generated by code.
Inheritance
System.Object
InMemoryConfigProvider
Implements
Namespace: Yarp.ReverseProxy.Configuration
Assembly: Yarp.ReverseProxy.dll
Syntax
public sealed class InMemoryConfigProvider : object, IProxyConfigProvider
Constructors
| Improve this Doc View SourceInMemoryConfigProvider(IReadOnlyList<RouteConfig>, IReadOnlyList<ClusterConfig>)
Creates a new instance.
Declaration
public InMemoryConfigProvider(IReadOnlyList<RouteConfig> routes, IReadOnlyList<ClusterConfig> clusters)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<RouteConfig> | routes | |
IReadOnlyList<ClusterConfig> | clusters |
InMemoryConfigProvider(IReadOnlyList<RouteConfig>, IReadOnlyList<ClusterConfig>, String)
Creates a new instance, specifying a revision id of the configuration.
Declaration
public InMemoryConfigProvider(IReadOnlyList<RouteConfig> routes, IReadOnlyList<ClusterConfig> clusters, string revisionId)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<RouteConfig> | routes | |
IReadOnlyList<ClusterConfig> | clusters | |
System.String | revisionId |
Methods
| Improve this Doc View SourceGetConfig()
Implementation of the IProxyConfigProvider.GetConfig method to supply the current snapshot of configuration
Declaration
public IProxyConfig GetConfig()
Returns
Type | Description |
---|---|
IProxyConfig | An immutable snapshot of the current configuration state |
Update(IReadOnlyList<RouteConfig>, IReadOnlyList<ClusterConfig>)
Swaps the config state with a new snapshot of the configuration, then signals that the old one is outdated.
Declaration
public void Update(IReadOnlyList<RouteConfig> routes, IReadOnlyList<ClusterConfig> clusters)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<RouteConfig> | routes | |
IReadOnlyList<ClusterConfig> | clusters |
Update(IReadOnlyList<RouteConfig>, IReadOnlyList<ClusterConfig>, String)
Swaps the config state with a new snapshot of the configuration, then signals that the old one is outdated.
Declaration
public void Update(IReadOnlyList<RouteConfig> routes, IReadOnlyList<ClusterConfig> clusters, string revisionId)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<RouteConfig> | routes | |
IReadOnlyList<ClusterConfig> | clusters | |
System.String | revisionId |