diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-01-21 23:05:26 -0600 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-01-21 23:05:26 -0600 |
| commit | 7ad098358e23e7de7e6d11f9c4feb122e013d2c8 (patch) | |
| tree | 81458b674909b89119c89c5a56f3a88c5f7514de | |
| parent | 3f8af2e3ba6f9f1df35f5c0d213c1609b28cfb95 (diff) | |
| download | slskd-7ad098358e23e7de7e6d11f9c4feb122e013d2c8.tar.gz | |
implement options
| -rw-r--r-- | src/slskd/Options.cs | 70 |
1 files changed, 53 insertions, 17 deletions
diff --git a/src/slskd/Options.cs b/src/slskd/Options.cs index 0dbc9409..ef2759f5 100644 --- a/src/slskd/Options.cs +++ b/src/slskd/Options.cs @@ -1,24 +1,60 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace slskd +namespace slskd { - public class Options + using System.Collections.Generic; + using System.Linq; + + public class RuntimeOptions { - public slskdOptions slskd { get; set; } + public class Soulseek + { + public string Username { get; set; } = Program.Username; + public string Password { get; set; } = Program.Password; + public int ListenPort { get; set; } = 50000; + public DistributedNetworkOptions DistributedNetwork { get; set; } + public ConnectionOptions Connection { get; set; } + + public class DistributedNetworkOptions + { + public bool Enabled { get; set; } = true; + public int ChildLimit { get; set; } = 10; + } + + public class ConnectionOptions + { + public TimeoutOptions Timeout { get; set; } + public BufferOptions Buffer { get; set; } - public class slskdOptions + public class TimeoutOptions + { + public int Connect { get; set; } = 5000; + public int Inactivity { get; set; } = 15000; + } + + public class BufferOptions + { + public int Read { get; set; } = 16384; + public int Write { get; set; } = 16384; + } + } + } + + public class Authentication { - public bool? Debug { get; set; } - public bool? NoLogo { get; set; } - public bool? NoAuth { get; set; } - public string InstanceName { get; set; } - public bool? Prometheus { get; set; } - public bool? Swagger { get; set; } - public string Loki { get; set; } + public IEnumerable<User> Users { get; set; } + public IEnumerable<ApiKey> ApiKeys { get; set; } + + public class User + { + public string Name { get; set; } + public string Password { get; set; } + public Role Role { get; set; } + } + + public class ApiKey + { + public string Key { get; set; } + public Role Role { get; set; } + } } } } |
