/
Anabol1ks
/
test_hack
Обзор
Документация
Войти
/
Anabol1ks
/
test_hack
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
docs/docs.go
304 строки
13 KB
Anabol1ks
docker
22 ноя 2025, 14:35
22 ноя 2025, 14:35
94000cb
Код
Авторство
О чём код?
// Package docs Code generated by swaggo/swag. DO NOT EDIT package docs import "github.com/swaggo/swag" const docTemplate = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { "description": "{{escape .Description}}", "title": "{{.Title}}", "contact": {}, "version": "{{.Version}}" }, "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { "/analyze": { "post": { "description": "Анализирует локальный проект или удалённый Git репозиторий\nОпределяет языки программирования, фреймворки, менеджеры пакетов и команды сборки/тестирования\n\n**Параметры запроса:**\n- ` + "`" + `path` + "`" + ` - путь к локальному проекту (например: \".\", \"./my-project\")\n- ` + "`" + `repo_url` + "`" + ` - URL Git репозитория (например: \"https://github.com/user/repo\")\n- ` + "`" + `ref` + "`" + ` - ветка/тег репозитория (опционально, по умолчанию HEAD)\n\n**Важно:** Укажите либо ` + "`" + `path` + "`" + ` (для локального проекта), либо ` + "`" + `repo_url` + "`" + ` (для удалённого), но не оба одновременно.\n\n**Поддерживаемые технологии:**\n- Go (go.mod, версия, фреймворки: gin, fiber, echo, grpc)\n- Node.js (package.json, npm/yarn/pnpm, версия Node)\n- Python (requirements.txt, pyproject.toml, pytest, flask, django)\n- Docker (Dockerfile, docker-compose)\n- Makefile (targets: build, test)\n- Environment variables (.env.example, код)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "analyze" ], "summary": "Анализ проекта", "parameters": [ { "description": "Параметры анализа", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.analyzeReq" } } ], "responses": { "200": { "description": "Результат анализа с детальной информацией о проекте", "schema": { "$ref": "#/definitions/core.AnalysisResult" } }, "400": { "description": "Ошибка валидации: неверные параметры или оба source указаны", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Внутренняя ошибка сервера или timeout анализа", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/generate": { "post": { "description": "Анализирует проект и генерирует готовую к использованию CI/CD конфигурацию для указанной платформы\n\n**Параметры запроса:**\n- ` + "`" + `platform` + "`" + ` - **ОБЯЗАТЕЛЬНЫЙ** - целевая платформа (сейчас только \"gitlab\")\n- ` + "`" + `path` + "`" + ` - путь к локальному проекту (например: \".\", \"./my-project\")\n- ` + "`" + `repo_url` + "`" + ` - URL Git репозитория (например: \"https://github.com/user/repo\")\n- ` + "`" + `ref` + "`" + ` - ветка/тег репозитория (опционально, по умолчанию HEAD)\n- ` + "`" + `options` + "`" + ` - дополнительные настройки (опционально, зарезервировано)\n\n**Важно:** Укажите либо ` + "`" + `path` + "`" + `, либо ` + "`" + `repo_url` + "`" + `, но не оба одновременно.\n\n**Возможности генератора:**\n- Автоматический выбор оптимальных Docker образов (alpine/slim варианты)\n- Определение версий языков и их использование в образах\n- Генерация команд build и test на основе найденных инструментов\n- Поддержка Makefile targets\n- Добавление необходимых переменных окружения для CI/CD\n- Оптимизация для GitLab CI (stages, rules, artifacts)\n\n**Пример запроса для локального проекта:**\n` + "`" + `` + "`" + `` + "`" + `json\n{\n\"path\": \".\",\n\"platform\": \"gitlab\"\n}\n` + "`" + `` + "`" + `` + "`" + `\n\n**Пример запроса для удалённого репозитория:**\n` + "`" + `` + "`" + `` + "`" + `json\n{\n\"repo_url\": \"https://github.com/user/repo\",\n\"ref\": \"main\",\n\"platform\": \"gitlab\"\n}\n` + "`" + `` + "`" + `` + "`" + `", "consumes": [ "application/json" ], "produces": [ "text/yaml" ], "tags": [ "generate" ], "summary": "Генерация CI/CD конфигурации", "parameters": [ { "description": "Параметры генерации CI/CD конфигурации", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.genReq" } } ], "responses": { "200": { "description": "Готовая GitLab CI YAML конфигурация (.gitlab-ci.yml)", "schema": { "type": "string" } }, "400": { "description": "Ошибка: неверная платформа, отсутствуют параметры или оба source указаны", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Ошибка генерации: не удалось проанализировать проект или создать конфигурацию", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } } }, "definitions": { "api.analyzeReq": { "type": "object", "properties": { "path": { "type": "string", "example": "." }, "ref": { "type": "string", "example": "main" }, "repo_url": { "type": "string", "example": "https://github.com/user/repo" } } }, "api.genReq": { "type": "object", "required": [ "platform" ], "properties": { "options": { "type": "object", "additionalProperties": {} }, "path": { "type": "string", "example": "." }, "platform": { "type": "string", "example": "gitlab" }, "ref": { "type": "string", "example": "main" }, "repo_url": { "type": "string", "example": "https://github.com/user/repo" } } }, "core.AnalysisResult": { "type": "object", "properties": { "build": { "type": "array", "items": { "type": "string" }, "example": [ "go build ./...", "npm run build" ] }, "detectors": { "type": "array", "items": { "type": "string" }, "example": [ "go", "node", "docker", "makefile" ] }, "dockerfile": { "type": "boolean", "example": true }, "env_variables": { "type": "object", "additionalProperties": { "$ref": "#/definitions/core.EnvVariable" } }, "frameworks": { "type": "array", "items": { "type": "string" }, "example": [ "gin", "react" ] }, "languages": { "type": "array", "items": { "type": "string" }, "example": [ "go", "javascript" ] }, "package_managers": { "type": "array", "items": { "type": "string" }, "example": [ "go", "npm" ] }, "repo_ref": { "type": "string", "example": "." }, "test": { "type": "array", "items": { "type": "string" }, "example": [ "go test ./...", "npm test" ] }, "versions": { "type": "object", "additionalProperties": { "type": "string" }, "example": { "go": "1.23", "node": "20" } } } }, "core.EnvVariable": { "type": "object", "properties": { "description": { "type": "string", "example": "PostgreSQL connection string" }, "example": { "type": "string", "example": "postgresql://user:pass@localhost:5432/db" }, "is_ci_needed": { "type": "boolean", "example": true }, "name": { "type": "string", "example": "DATABASE_URL" }, "required": { "type": "boolean", "example": true } } } } }` // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "1.0", Host: "localhost:8080", BasePath: "/", Schemes: []string{}, Title: "CI Wizard API", Description: "REST API для анализа проектов и генерации CI/CD конфигураций\nПоддерживает Go, Node.js, Python, Docker и автоматическое определение окружения", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", RightDelim: "}}", } func init() { swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) }