diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-11-13 15:41:29 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2022-11-13 15:41:29 -0600 |
| commit | db3870018d9c2d523a4e106b888c45f0066f7933 (patch) | |
| tree | 73d56145eb7588cfec555de16b0c3ec9f732f9ea /src | |
| parent | a1d113528e575a828350917d5ac0c53851d4aca5 (diff) | |
| download | slskd-db3870018d9c2d523a4e106b888c45f0066f7933.tar.gz | |
rename Network in options
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Core/Options.cs | 36 |
1 files changed, 18 insertions, 18 deletions
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; /// <summary> - /// Gets network options. + /// Gets relay options. /// </summary> [Validate] - public NetworkOptions Network { get; init; } = new NetworkOptions(); + public RelayOptions Relay { get; init; } = new RelayOptions(); /// <summary> /// Gets directory options. @@ -288,9 +288,9 @@ namespace slskd { var results = new List<ValidationResult>(); - if (InstanceName == "local" && Network.Mode.ToEnum<OperationMode>() == OperationMode.Agent) + if (InstanceName == "local" && Relay.Mode.ToEnum<OperationMode>() == 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 } /// <summary> - /// Network options. + /// Relay options. /// </summary> - public class NetworkOptions : IValidatableObject + public class RelayOptions : IValidatableObject { /// <summary> /// Gets the application operation mode. /// </summary> - [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(); /// <summary> /// Gets the controller configuration. /// </summary> - public NetworkControllerConfigurationOptions Controller { get; init; } = new NetworkControllerConfigurationOptions(); + public RelayControllerConfigurationOptions Controller { get; init; } = new RelayControllerConfigurationOptions(); /// <summary> /// Gets the agent configuration. /// </summary> - public Dictionary<string, NetworkAgentConfigurationOptions> Agents { get; init; } = new(); + public Dictionary<string, RelayAgentConfigurationOptions> Agents { get; init; } = new(); public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) { @@ -414,7 +414,7 @@ namespace slskd var results = new List<ValidationResult>(); var modeResults = new List<ValidationResult>(); - 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 } /// <summary> - /// Network controller configuration options. + /// Relay controller configuration options. /// </summary> - public class NetworkControllerConfigurationOptions + public class RelayControllerConfigurationOptions { /// <summary> /// Gets the controller address. @@ -485,9 +485,9 @@ namespace slskd } /// <summary> - /// Network agent configuration options. + /// Relay agent configuration options. /// </summary> - public class NetworkAgentConfigurationOptions + public class RelayAgentConfigurationOptions { /// <summary> /// Gets the agent secret. |
