Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to net8 #17

Merged
merged 4 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ jobs:
environment: build
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup .NET 6
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
uses: actions/checkout@v4

- name: Install dependencies
run: dotnet restore ./YaCloudKit.sln
Expand All @@ -22,7 +17,7 @@ jobs:
run: dotnet build ./YaCloudKit.sln --configuration Release --no-restore

- name: Test
run: dotnet test ./YaCloudKit.sln --configuration Release --no-restore
run: dotnet test --no-build ./YaCloudKit.sln --configuration Release --no-restore

- name: Pack
run: dotnet pack ./YaCloudKit.sln -c Release
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup .NET 6
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
uses: actions/checkout@v4

- name: Install dependencies
run: dotnet restore ./YaCloudKit.sln
Expand All @@ -26,4 +21,4 @@ jobs:
run: dotnet build ./YaCloudKit.sln --configuration Release --no-restore

- name: Test
run: dotnet test ./YaCloudKit.sln --configuration Release --no-restore
run: dotnet test --no-build ./YaCloudKit.sln --configuration Release --no-restore
55 changes: 30 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,34 @@
<p align="center">
<img src="./assets/logo-main.png">
</p>
Набор инструментов для работы с сервисами Yandex.Cloud

A set of tools for working with Yandex.Cloud services.

[![Main Build](https://github.com/gkurbesov/YaCloudKit/actions/workflows/main.yml/badge.svg)](https://github.com/gkurbesov/YaCloudKit/actions/workflows/main.yml)
[![Nuget](https://img.shields.io/nuget/v/YaCloudKit.MQ?label=MQ)](https://www.nuget.org/packages/YaCloudKit.MQ)
[![Nuget](https://img.shields.io/nuget/v/YaCloudKit.TTS?label=TTS)](https://www.nuget.org/packages/YaCloudKit.TTS)
## Описание
YaCloudKit - это набор инструментов, который позволит взаимодействовать вашему приложению с сервисами облачной платформы Яндекс.Облако.
## Description
YaCloudKit is a set of tools that enables your application to interact with Yandex.Cloud platform services.

Поддерживаются .Net Standard 2.0 и выше
Supports .Net 8.0 and higher.

## Инструменты
В этом разделе представлен список инструментов, которые уже реализованы.
## Tools
This section lists the tools that are currently implemented.

**Реализованно:**
- [YaCloudKit.MQ](./src/MessageQueue) - клиент для работы с очередью сообщений Яндекс.Облака
- [YaCloudKit.MQ.Transport](./src/MessageQueue) - расширение для клиента очереди сообщений, отвечает за де/сериализацию и обработку сообщений
- [YaCloudKit.TTS](./src/TextToSpeech) - клиент SpeechKit для синтеза речи из текста
**Implemented:**
- [YaCloudKit.MQ](./src/MessageQueue) - a client for working with Yandex.Cloud Message Queue.
- [YaCloudKit.MQ.Transport](./src/MessageQueue) - an extension for the message queue client, responsible for message serialization/deserialization and processing.
- [YaCloudKit.TTS](./src/TextToSpeech) - a SpeechKit client for text-to-speech synthesis.

## YaCloudKit.MQ

YaCloudKit.MQ - это клиент для работы с очередью сообщений Яндекс.Облака.
Полностью адаптирова под сервис Yandex Message Queue и не имеет лишних неиспользуемых зависимостей и кода.
YaCloudKit.MQ is a client for working with Yandex.Cloud Message Queue.
It is fully tailored for the Yandex Message Queue service without unnecessary dependencies or code.

### Usage

### Использование
The client can be easily connected and used in three simple steps:

Клиент легко подкючить и использовать всего в три шага:
```csharp
// Step 1. create client instance
var client = new YandexMqClient("[Access Key Id]", "[Secret Access Key]");
Expand All @@ -41,16 +43,14 @@ var message = new SendMessageRequest()
await client.SendMessageAsync(message);
```

Больше примеров можно [посмотреть тут](./samples/YaCloudKit.MQ.Examples)
More examples can be found [here](./samples/YaCloudKit.MQ.Examples)

## YaCloudKit.MQ.Transport
YaCloudKit.MQ.Transport is a set of services and components designed to simplify message processing from the message queue.

YaCloudKit.MQ.Transport - это набор сервисов и компонентов призваных упростить обработку сообщений из очереди сообщений.


### Использование
### Usage

Создайте обработчик для сообщения:
Create a handler for your message:
```csharp
public class CustomerRegistrationHandler : IMessageHandler<CustomerRegistrationDto>
{
Expand All @@ -69,7 +69,7 @@ public class CustomerRegistrationHandler : IMessageHandler<CustomerRegistrationD
}
```

Сконфигурируйте зависимости:
Configure dependencies:

```csharp
services.AddYandexMqClient("[Access Key Id]", "[Secret Access Key]");
Expand All @@ -83,7 +83,8 @@ services.AddMqTransport(configure =>
Assembly.GetExecutingAssembly());
```

Получите одбновление из очереди и обработайте их:
Receive updates from the queue and process them:

```csharp
IYandexMq client = ... // Get IYandexMq
IMqTransportService transport = ... // Get IMqTransportService
Expand All @@ -107,8 +108,12 @@ if(response.HttpStatusCode == HttpStatusCode.OK && response.Messages.Count > 0)
}
```

Больше примеров можно [посмотреть тут](./samples/YaCloudKit.MQ.Transport.Examples)
More examples can be found [here](./samples/YaCloudKit.MQ.Transport.Examples)


## License
YaCloudKit is provided "as is" under the MIT License.

For more information, see [LICENSE](./LICENSE).

## Лицензия
YaCloudKit предоставляется как есть по лицензии MIT. Для получения дополнительной информации см. [LICENSE](./LICENSE).

21 changes: 0 additions & 21 deletions YaCloudKit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TextToSpeech", "src\TextToS
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YaCloudKit.TTS.Tests", "src\TextToSpeech\YaCloudKit.TTS.Tests\YaCloudKit.TTS.Tests.csproj", "{80BFD0AD-E1CD-42E8-BFAA-6687844FA735}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YaCloudKit.MQ.Extensions.DependencyInjection", "src\MessageQueue\YaCloudKit.MQ.Extensions.DependencyInjection\YaCloudKit.MQ.Extensions.DependencyInjection.csproj", "{EE9F6062-4AAE-497C-872B-3C6EF3BDF24F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YaCloudKit.MQ.Transport.Tests", "src\MessageQueue\YaCloudKit.MQ.Transport.Tests\YaCloudKit.MQ.Transport.Tests.csproj", "{56762F1C-98AA-4420-B60C-732CA325231F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YaCloudKit.MQ.Transport.Extensions.DependencyInjection", "src\MessageQueue\YaCloudKit.MQ.Transport.Extensions.DependencyInjection\YaCloudKit.MQ.Transport.Extensions.DependencyInjection.csproj", "{1700EA26-6DBC-457F-924F-CB1DFAE3374D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{3B55C34B-BA59-4ABB-87C5-59153FF74CB5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YaCloudKit.MQ.Examples", "samples\YaCloudKit.MQ.Examples\YaCloudKit.MQ.Examples.csproj", "{0BFD6AEA-01EB-47F3-A9B9-DB5F222877BB}"
Expand All @@ -31,8 +27,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YaCloudKit.MQ.Transport.Exa
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YaCloudKit.TTS.Example", "samples\YaCloudKit.TTS.Example\YaCloudKit.TTS.Example.csproj", "{8796825F-8B82-4EDA-B21C-9D552168407B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YaCloudKit.TTS.DependencyInjection", "src\TextToSpeech\YaCloudKit.TTS.DependencyInjection\YaCloudKit.TTS.DependencyInjection.csproj", "{85A09BEE-89D3-4C8E-84F2-8AA664F0308C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -59,18 +53,10 @@ Global
{80BFD0AD-E1CD-42E8-BFAA-6687844FA735}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80BFD0AD-E1CD-42E8-BFAA-6687844FA735}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80BFD0AD-E1CD-42E8-BFAA-6687844FA735}.Release|Any CPU.Build.0 = Release|Any CPU
{EE9F6062-4AAE-497C-872B-3C6EF3BDF24F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EE9F6062-4AAE-497C-872B-3C6EF3BDF24F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE9F6062-4AAE-497C-872B-3C6EF3BDF24F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE9F6062-4AAE-497C-872B-3C6EF3BDF24F}.Release|Any CPU.Build.0 = Release|Any CPU
{56762F1C-98AA-4420-B60C-732CA325231F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{56762F1C-98AA-4420-B60C-732CA325231F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{56762F1C-98AA-4420-B60C-732CA325231F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{56762F1C-98AA-4420-B60C-732CA325231F}.Release|Any CPU.Build.0 = Release|Any CPU
{1700EA26-6DBC-457F-924F-CB1DFAE3374D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1700EA26-6DBC-457F-924F-CB1DFAE3374D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1700EA26-6DBC-457F-924F-CB1DFAE3374D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1700EA26-6DBC-457F-924F-CB1DFAE3374D}.Release|Any CPU.Build.0 = Release|Any CPU
{0BFD6AEA-01EB-47F3-A9B9-DB5F222877BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0BFD6AEA-01EB-47F3-A9B9-DB5F222877BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0BFD6AEA-01EB-47F3-A9B9-DB5F222877BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -83,10 +69,6 @@ Global
{8796825F-8B82-4EDA-B21C-9D552168407B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8796825F-8B82-4EDA-B21C-9D552168407B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8796825F-8B82-4EDA-B21C-9D552168407B}.Release|Any CPU.Build.0 = Release|Any CPU
{85A09BEE-89D3-4C8E-84F2-8AA664F0308C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85A09BEE-89D3-4C8E-84F2-8AA664F0308C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85A09BEE-89D3-4C8E-84F2-8AA664F0308C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85A09BEE-89D3-4C8E-84F2-8AA664F0308C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -97,13 +79,10 @@ Global
{B8916BF5-47FC-4E1B-815B-093DF6A1E2B4} = {9C193C93-C9A9-4921-8BE1-3F52A2395232}
{3F849A41-F8DA-430A-BE18-52A8C12FE012} = {9C193C93-C9A9-4921-8BE1-3F52A2395232}
{80BFD0AD-E1CD-42E8-BFAA-6687844FA735} = {092A9018-57BC-42D7-85FD-3D4EA12EFC9D}
{EE9F6062-4AAE-497C-872B-3C6EF3BDF24F} = {9C193C93-C9A9-4921-8BE1-3F52A2395232}
{56762F1C-98AA-4420-B60C-732CA325231F} = {9C193C93-C9A9-4921-8BE1-3F52A2395232}
{1700EA26-6DBC-457F-924F-CB1DFAE3374D} = {9C193C93-C9A9-4921-8BE1-3F52A2395232}
{0BFD6AEA-01EB-47F3-A9B9-DB5F222877BB} = {3B55C34B-BA59-4ABB-87C5-59153FF74CB5}
{EDBDB339-B140-4832-A54F-004D244808EA} = {3B55C34B-BA59-4ABB-87C5-59153FF74CB5}
{8796825F-8B82-4EDA-B21C-9D552168407B} = {3B55C34B-BA59-4ABB-87C5-59153FF74CB5}
{85A09BEE-89D3-4C8E-84F2-8AA664F0308C} = {092A9018-57BC-42D7-85FD-3D4EA12EFC9D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EB60A6CA-F76D-40F9-BFDD-ACA1F097B83D}
Expand Down
4 changes: 2 additions & 2 deletions samples/YaCloudKit.MQ.Examples/YaCloudKit.MQ.Examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="YaCloudKit.MQ" Version="0.8.0" />
<ProjectReference Include="..\..\src\MessageQueue\YaCloudKit.MQ\YaCloudKit.MQ.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System.Runtime.Serialization;

namespace YaCloudKit.MQ.Transport.Examples;
namespace YaCloudKit.MQ.Transport.Examples;

public class NotificationDto
{
public int Id { get; set; }
public string Title { get; set; }
public string Message { get; set; }
public string? Title { get; set; }
public string? Message { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System.Runtime.Serialization;

namespace YaCloudKit.MQ.Transport.Examples;
namespace YaCloudKit.MQ.Transport.Examples;

public class UserRegistrationDto
{
public int UserId { get; set; }
public string Email { get; set; }
public string? Email { get; set; }
public DateTime RegistrationDateTime { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.Net;
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using YaCloudKit.MQ.Extensions.DependencyInjection;
using YaCloudKit.MQ.Model.Requests;
using YaCloudKit.MQ.Transport.Extensions.DependencyInjection;
using YaCloudKit.MQ.Transport.DependencyInjection;

namespace YaCloudKit.MQ.Transport.Examples;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using YaCloudKit.MQ.Extensions.DependencyInjection;
using YaCloudKit.MQ.Model.Responses;
using YaCloudKit.MQ.Transport.Extensions.DependencyInjection;
using YaCloudKit.MQ.Transport.DependencyInjection;

namespace YaCloudKit.MQ.Transport.Examples;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="YaCloudKit.MQ" Version="0.8.0" />
<PackageReference Include="YaCloudKit.MQ.Extensions.DependencyInjection" Version="0.8.0" />
<PackageReference Include="YaCloudKit.MQ.Transport" Version="0.8.0" />
<PackageReference Include="YaCloudKit.MQ.Transport.Extensions.DependencyInjection" Version="0.8.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\MessageQueue\YaCloudKit.MQ.Transport\YaCloudKit.MQ.Transport.csproj" />
<ProjectReference Include="..\..\src\MessageQueue\YaCloudKit.MQ\YaCloudKit.MQ.csproj" />
</ItemGroup>

</Project>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
Expand All @@ -22,7 +22,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\YaCloudKit.MQ.Extensions.DependencyInjection\YaCloudKit.MQ.Extensions.DependencyInjection.csproj" />
<ProjectReference Include="..\YaCloudKit.MQ\YaCloudKit.MQ.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using Xunit;
using YaCloudKit.MQ.Extensions.DependencyInjection;

namespace YaCloudKit.MQ.Tests;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@
<Version>$(VersionMajor).$(VersionMinor).$(BuildNumber)$(VersionTag)</Version>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\YaCloudKit.MQ.Transport\YaCloudKit.MQ.Transport.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\..\assets\logo-main.png">
Expand Down
Loading