feat: добавить поддержку GitLab (api, clients, tools) и обновить документацию

This commit is contained in:
2026-04-14 12:57:47 +03:00
parent e96bab114e
commit b5fe2623b3
17 changed files with 3479 additions and 39 deletions

View File

@@ -0,0 +1,40 @@
using Microsoft.Extensions.Configuration;
using RestSharp;
namespace LazyBear.MCP.Services.GitLab;
/// <summary>
/// Фабрика клиента RestSharp для GitLab API
/// </summary>
public static class GitLabClientFactory
{
private static readonly TimeSpan[] BackoffDurations =
{
TimeSpan.FromMilliseconds(1000),
TimeSpan.FromMilliseconds(2000),
TimeSpan.FromMilliseconds(4000)
};
/// <summary>
/// Создание клиента RestSharp для GitLab API
/// </summary>
/// <param name="configuration">Конфигурация из DI</param>
/// <returns>Client или null при ошибке инициализации</returns>
public static RestClient? CreateClient(IConfiguration configuration)
{
var gitlabUrl = configuration["GitLab:Url"] ?? string.Empty;
if (string.IsNullOrWhiteSpace(gitlabUrl))
{
return null;
}
var config = new RestClientOptions(gitlabUrl)
{
UserAgent = "LazyBear-GitLab-MCP",
Timeout = TimeSpan.FromMilliseconds(30000)
};
return new RestClient(config);
}
}