namespace NATS.Server.Configuration;
///
/// Remote leaf node entry parsed from the remotes[] array inside a leafnodes {} block.
/// Go reference: opts.go RemoteLeafOpts struct.
///
public sealed class RemoteLeafOptions
{
/// Local account to bind this remote to.
public string? LocalAccount { get; init; }
/// Path to credentials file.
public string? Credentials { get; init; }
/// URLs for this remote entry.
public List Urls { get; init; } = [];
/// Whether to not randomize URL order.
public bool DontRandomize { get; init; }
}
public sealed class LeafNodeOptions
{
public string Host { get; set; } = "0.0.0.0";
public int Port { get; set; }
// Auth for leaf listener
public string? Username { get; set; }
public string? Password { get; set; }
public double AuthTimeout { get; set; }
// Advertise address
public string? Advertise { get; set; }
// Per-subsystem write deadline
public TimeSpan WriteDeadline { get; set; }
///
/// Simple URL list for programmatic setup (tests, server-code wiring).
/// Parsed config populates RemoteLeaves instead.
///
public List Remotes { get; set; } = [];
///
/// Remote leaf node entries parsed from a config file (remotes: [] array).
/// Each entry has a local account, credentials, and a list of URLs.
///
public List RemoteLeaves { get; set; } = [];
///
/// JetStream domain for this leaf node.
/// Go reference: leafnode.go -- JsDomain in leafNodeCfg.
///
public string? JetStreamDomain { get; set; }
public List DenyExports { get; set; } = [];
public List DenyImports { get; set; } = [];
public List ExportSubjects { get; set; } = [];
public List ImportSubjects { get; set; } = [];
/// List of users for leaf listener authentication (from authorization.users).
public List? Users { get; set; }
}