Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions README.es-ES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@


# csharp-control-plane

Un plano de control en C# para [Envoy Proxy](https://envoyproxy.io) basado en [java-control-plane](https://github.com/envoyproxy/java-control-plane)

```csharp
public static async Task MainAsync(string[] args)
{
// Primero, crea un objeto de caché para almacenar la caché de configuración de Envoy
// la caché requiere un callback de hash de nodo. Te proporcionará un Node de Envoy y esperará un Id.
// esto codifica el id como "key", pero cambiará más adelante.
var cache = new SimpleCache<string>(_ => "key");

cache.SetSnapshot("key", CreateSnapshot());

// Crea un DiscoveryServer y proporciónale el objeto de caché
// Selecciona el tipo de servidor. https://www.envoyproxy.io/docs/envoy/latest/api-docs/xds_protocol
// Esto utiliza el servidor ADS
var discoveryServer = DiscoveryServerBuilder
.CreateFor(cache)
.ConfigureDiscoveryService<AggregatedDiscoveryService>()
.ConfigureLogging(logging =>
{
logging.AddConsole();
logging.SetMinimumLevel(LogLevel.Debug);
})
.Build();

// Ejecuta el servidor
var cts = new CancellationTokenSource();
await discoveryServer.RunAsync(cts.Token);
}
```