From db3870018d9c2d523a4e106b888c45f0066f7933 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 13 Nov 2022 15:41:29 -0600 Subject: rename Network in options --- src/slskd/Core/Options.cs | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs index a64d5875..3a61e376 100644 --- a/src/slskd/Core/Options.cs +++ b/src/slskd/Core/Options.cs @@ -32,7 +32,7 @@ namespace slskd using slskd.Authentication; using slskd.Configuration; using slskd.Cryptography; - using slskd.Network; + using slskd.Relay; using slskd.Shares; using slskd.Validation; using Soulseek.Diagnostics; @@ -196,10 +196,10 @@ namespace slskd public string ConfigurationFile { get; init; } = Program.DefaultConfigurationFile; /// - /// Gets network options. + /// Gets relay options. /// [Validate] - public NetworkOptions Network { get; init; } = new NetworkOptions(); + public RelayOptions Relay { get; init; } = new RelayOptions(); /// /// Gets directory options. @@ -288,9 +288,9 @@ namespace slskd { var results = new List(); - if (InstanceName == "local" && Network.Mode.ToEnum() == OperationMode.Agent) + if (InstanceName == "local" && Relay.Mode.ToEnum() == OperationMode.Agent) { - results.Add(new ValidationResult("Instance name must be something other than 'local' when operating in Network Agent mode")); + results.Add(new ValidationResult("Instance name must be something other than 'local' when operating in Relay Agent mode")); } return results; @@ -384,29 +384,29 @@ namespace slskd } /// - /// Network options. + /// Relay options. /// - public class NetworkOptions : IValidatableObject + public class RelayOptions : IValidatableObject { /// /// Gets the application operation mode. /// - [Argument('m', "network-operation-mode")] - [EnvironmentVariable("NETWORK_OPERATION_MODE")] - [Description("network operation mode; controller, agent")] + [Argument('m', "relay-operation-mode")] + [EnvironmentVariable("RELAY_OPERATION_MODE")] + [Description("relay operation mode; controller, agent")] [RequiresRestart] [Enum(typeof(OperationMode))] - public string Mode { get; init; } = slskd.Network.OperationMode.Controller.ToString().ToLowerInvariant(); + public string Mode { get; init; } = slskd.Relay.OperationMode.Controller.ToString().ToLowerInvariant(); /// /// Gets the controller configuration. /// - public NetworkControllerConfigurationOptions Controller { get; init; } = new NetworkControllerConfigurationOptions(); + public RelayControllerConfigurationOptions Controller { get; init; } = new RelayControllerConfigurationOptions(); /// /// Gets the agent configuration. /// - public Dictionary Agents { get; init; } = new(); + public Dictionary Agents { get; init; } = new(); public IEnumerable Validate(ValidationContext validationContext) { @@ -414,7 +414,7 @@ namespace slskd var results = new List(); var modeResults = new List(); - if (mode == slskd.Network.OperationMode.Agent && !Validator.TryValidateObject(Controller, new ValidationContext(Controller), modeResults, validateAllProperties: true)) + if (mode == slskd.Relay.OperationMode.Agent && !Validator.TryValidateObject(Controller, new ValidationContext(Controller), modeResults, validateAllProperties: true)) { results.Add(new CompositeValidationResult("Controller", modeResults)); } @@ -439,9 +439,9 @@ namespace slskd } /// - /// Network controller configuration options. + /// Relay controller configuration options. /// - public class NetworkControllerConfigurationOptions + public class RelayControllerConfigurationOptions { /// /// Gets the controller address. @@ -485,9 +485,9 @@ namespace slskd } /// - /// Network agent configuration options. + /// Relay agent configuration options. /// - public class NetworkAgentConfigurationOptions + public class RelayAgentConfigurationOptions { /// /// Gets the agent secret. -- cgit v1.2.3