From d38be6f00e3b391ded92038a62e0835c94f13b38 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 29 Oct 2022 12:43:35 -0500 Subject: move types out of Core --- src/slskd/Core/CacheKeys.cs | 24 +++++++++++++++++ src/slskd/Core/Types/CacheKeys.cs | 24 ----------------- src/slskd/Core/Types/NetworkOperationMode.cs | 35 ------------------------ src/slskd/Core/Types/QueueStrategy.cs | 35 ------------------------ src/slskd/Core/Types/StorageMode.cs | 35 ------------------------ src/slskd/Network/Types/OperationMode.cs | 40 ++++++++++++++++++++++++++++ src/slskd/Shares/Types/StorageMode.cs | 35 ++++++++++++++++++++++++ src/slskd/Transfers/Types/QueueStrategy.cs | 35 ++++++++++++++++++++++++ 8 files changed, 134 insertions(+), 129 deletions(-) create mode 100644 src/slskd/Core/CacheKeys.cs delete mode 100644 src/slskd/Core/Types/CacheKeys.cs delete mode 100644 src/slskd/Core/Types/NetworkOperationMode.cs delete mode 100644 src/slskd/Core/Types/QueueStrategy.cs delete mode 100644 src/slskd/Core/Types/StorageMode.cs create mode 100644 src/slskd/Network/Types/OperationMode.cs create mode 100644 src/slskd/Shares/Types/StorageMode.cs create mode 100644 src/slskd/Transfers/Types/QueueStrategy.cs (limited to 'src') diff --git a/src/slskd/Core/CacheKeys.cs b/src/slskd/Core/CacheKeys.cs new file mode 100644 index 00000000..b5a335c1 --- /dev/null +++ b/src/slskd/Core/CacheKeys.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) slskd Team. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see https://www.gnu.org/licenses/. +// + +namespace slskd +{ + public static class CacheKeys + { + public static readonly string UserStatisticsToken = nameof(UserStatisticsToken); + } +} diff --git a/src/slskd/Core/Types/CacheKeys.cs b/src/slskd/Core/Types/CacheKeys.cs deleted file mode 100644 index b5a335c1..00000000 --- a/src/slskd/Core/Types/CacheKeys.cs +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) slskd Team. All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published -// by the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see https://www.gnu.org/licenses/. -// - -namespace slskd -{ - public static class CacheKeys - { - public static readonly string UserStatisticsToken = nameof(UserStatisticsToken); - } -} diff --git a/src/slskd/Core/Types/NetworkOperationMode.cs b/src/slskd/Core/Types/NetworkOperationMode.cs deleted file mode 100644 index 4b190275..00000000 --- a/src/slskd/Core/Types/NetworkOperationMode.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// Copyright (c) slskd Team. All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published -// by the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see https://www.gnu.org/licenses/. -// - -namespace slskd -{ - /// - /// The network operation mode. - /// - public enum NetworkOperationMode - { - /// - /// Controller operation mode. - /// - Controller = 0, - - /// - /// Agent operation mode. - /// - Agent = 1, - } -} diff --git a/src/slskd/Core/Types/QueueStrategy.cs b/src/slskd/Core/Types/QueueStrategy.cs deleted file mode 100644 index 50f6cce1..00000000 --- a/src/slskd/Core/Types/QueueStrategy.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// Copyright (c) slskd Team. All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published -// by the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see https://www.gnu.org/licenses/. -// - -namespace slskd -{ - /// - /// Queue strategies. - /// - public enum QueueStrategy - { - /// - /// Uploads are prioritized based on the time they became ready. - /// - RoundRobin = 0, - - /// - /// Uploads are prioritized based on the time they were enqueued. - /// - FirstInFirstOut = 1, - } -} diff --git a/src/slskd/Core/Types/StorageMode.cs b/src/slskd/Core/Types/StorageMode.cs deleted file mode 100644 index aced3050..00000000 --- a/src/slskd/Core/Types/StorageMode.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// Copyright (c) slskd Team. All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published -// by the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see https://www.gnu.org/licenses/. -// - -namespace slskd -{ - /// - /// Storage mode. - /// - public enum StorageMode - { - /// - /// Stored in memory. - /// - Memory = 0, - - /// - /// Stored on disk. - /// - Disk = 1, - } -} diff --git a/src/slskd/Network/Types/OperationMode.cs b/src/slskd/Network/Types/OperationMode.cs new file mode 100644 index 00000000..7503c6c9 --- /dev/null +++ b/src/slskd/Network/Types/OperationMode.cs @@ -0,0 +1,40 @@ +// +// Copyright (c) slskd Team. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see https://www.gnu.org/licenses/. +// + +namespace slskd.Network +{ + /// + /// The network operation mode. + /// + public enum OperationMode + { + /// + /// Controller operation mode. + /// + Controller = 0, + + /// + /// Agent operation mode. + /// + Agent = 1, + + /// + /// Debug mode; enables operation as both a controller and agent. + /// + Debug = 2, + } +} diff --git a/src/slskd/Shares/Types/StorageMode.cs b/src/slskd/Shares/Types/StorageMode.cs new file mode 100644 index 00000000..2b7992f5 --- /dev/null +++ b/src/slskd/Shares/Types/StorageMode.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) slskd Team. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see https://www.gnu.org/licenses/. +// + +namespace slskd.Shares +{ + /// + /// Storage mode. + /// + public enum StorageMode + { + /// + /// Stored in memory. + /// + Memory = 0, + + /// + /// Stored on disk. + /// + Disk = 1, + } +} diff --git a/src/slskd/Transfers/Types/QueueStrategy.cs b/src/slskd/Transfers/Types/QueueStrategy.cs new file mode 100644 index 00000000..63a6a7cd --- /dev/null +++ b/src/slskd/Transfers/Types/QueueStrategy.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) slskd Team. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see https://www.gnu.org/licenses/. +// + +namespace slskd.Transfers +{ + /// + /// Queue strategies. + /// + public enum QueueStrategy + { + /// + /// Uploads are prioritized based on the time they became ready. + /// + RoundRobin = 0, + + /// + /// Uploads are prioritized based on the time they were enqueued. + /// + FirstInFirstOut = 1, + } +} -- cgit v1.2.3