-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,17 @@ public NatsUri(string urlString, bool isSeed, string defaultScheme = DefaultSche | |
Uri = uriBuilder.Uri; | ||
} | ||
|
||
public NatsUri CloneWith(string host, int? port = default) | ||
{ | ||
var newUri = new UriBuilder(Uri) | ||
{ | ||
Host = host, | ||
Port = port ?? Port, | ||
}.Uri.ToString(); | ||
|
||
return new NatsUri(newUri, IsSeed); | ||
} | ||
|
||
public Uri Uri { get; } | ||
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / dotnet (release/v2.9.23)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / dotnet (release/v2.9.23)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / test (release/v2.9.23)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / test (release/v2.9.23)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / memory test (release/v2.9.23)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / memory test (release/v2.9.23)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / test (latest)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / test (latest)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / dotnet (latest)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / dotnet (latest)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / test (main)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / test (main)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / dotnet (main)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / dotnet (main)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / memory test (latest)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / memory test (latest)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / memory test (main)
Check warning on line 54 in src/NATS.Client.Core/Internal/NatsUri.cs GitHub Actions / memory test (main)
|
||
|
||
public bool IsSeed { get; } | ||
|