/
AngelCareMe
/
task_queue
Обзор
Документация
Войти
/
AngelCareMe
/
task_queue
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/docs.go
605 строк
19 KB
AngelCareMe
done
28 июл 2025, 21:07
28 июл 2025, 21:07
c70014b
Код
Авторство
О чём код?
// 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": { "/health": { "get": { "description": "Check overall system health status", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "health" ], "summary": "Check system health", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/service.HealthStatus" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/service.HealthStatus" } } } } }, "/metrics": { "get": { "description": "Get overall system metrics", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "metrics" ], "summary": "Get system metrics", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/service.SystemMetrics" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/metrics.errorResponse" } } } } }, "/metrics/tasks": { "get": { "description": "Get task-specific metrics", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "metrics" ], "summary": "Get task metrics", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/service.TaskMetrics" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/metrics.errorResponse" } } } } }, "/tasks": { "get": { "description": "List tasks with optional filtering and pagination", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tasks" ], "summary": "List tasks", "parameters": [ { "type": "string", "description": "Filter by status", "name": "status", "in": "query" }, { "type": "string", "description": "Filter by name", "name": "name", "in": "query" }, { "type": "integer", "default": 10, "description": "Limit results", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset results", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/service.TaskListResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/task.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/task.ErrorResponse" } } } }, "post": { "description": "Create new task and put it to queue", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tasks" ], "summary": "Create new task", "parameters": [ { "description": "Task creation request", "name": "task", "in": "body", "required": true, "schema": { "$ref": "#/definitions/task.CreateRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/entity.Task" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/task.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/task.ErrorResponse" } } } } }, "/tasks/stats": { "get": { "description": "Get statistics about all tasks", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tasks" ], "summary": "Get task statistics", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/service.TaskStatsResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/task.ErrorResponse" } } } } }, "/tasks/{id}": { "get": { "description": "Get task details by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tasks" ], "summary": "Get task by ID", "parameters": [ { "type": "string", "description": "Task ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Task" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/task.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/task.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/task.ErrorResponse" } } } }, "delete": { "description": "Delete task by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tasks" ], "summary": "Delete task", "parameters": [ { "type": "string", "description": "Task ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/task.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/task.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/task.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/task.ErrorResponse" } } } } }, "/tasks/{id}/retry": { "post": { "description": "Put task back to queue for reprocessing", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tasks" ], "summary": "Retry task", "parameters": [ { "type": "string", "description": "Task ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/task.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/task.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/task.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/task.ErrorResponse" } } } } } }, "definitions": { "entity.Task": { "type": "object", "properties": { "created_at": { "type": "string" }, "delay": { "type": "integer" }, "id": { "type": "string" }, "max_retry": { "type": "integer" }, "name": { "type": "string" }, "payload": { "type": "string" }, "retry": { "type": "integer" }, "status": { "$ref": "#/definitions/entity.TaskStatus" }, "updated_at": { "type": "string" } } }, "entity.TaskStatus": { "type": "string", "enum": [ "pending", "processing", "success", "failed" ], "x-enum-varnames": [ "TaskStatusPending", "TaskStatusProcessing", "TaskStatusSuccess", "TaskStatusFailed" ] }, "metrics.errorResponse": { "type": "object", "properties": { "error": { "type": "string" } } }, "service.HealthStatus": { "type": "object", "properties": { "services": { "type": "object", "additionalProperties": { "type": "string" } }, "status": { "type": "string" }, "timestamp": { "type": "string" } } }, "service.SystemMetrics": { "type": "object", "properties": { "task_metrics": { "$ref": "#/definitions/service.TaskMetrics" }, "timestamp": { "type": "string" }, "uptime": { "type": "string" } } }, "service.TaskListResponse": { "type": "object", "properties": { "tasks": { "type": "array", "items": { "$ref": "#/definitions/entity.Task" } }, "total": { "type": "integer" } } }, "service.TaskMetrics": { "type": "object", "properties": { "failed_tasks": { "type": "integer" }, "pending_tasks": { "type": "integer" }, "processing_tasks": { "type": "integer" }, "success_tasks": { "type": "integer" }, "tasks_by_date": { "type": "object", "additionalProperties": { "type": "integer", "format": "int64" } }, "total_tasks": { "type": "integer" } } }, "service.TaskStatsResponse": { "type": "object", "properties": { "by_date": { "type": "object", "additionalProperties": { "type": "integer", "format": "int64" } }, "failed": { "type": "integer" }, "pending": { "type": "integer" }, "processing": { "type": "integer" }, "success": { "type": "integer" }, "total": { "type": "integer" } } }, "task.CreateRequest": { "type": "object", "required": [ "name" ], "properties": { "delay": { "type": "integer", "maximum": 3600, "minimum": 0 }, "max_retry": { "type": "integer", "maximum": 10, "minimum": 0 }, "name": { "type": "string" }, "payload": { "type": "string", "maxLength": 1000 } } }, "task.ErrorResponse": { "type": "object", "properties": { "error": { "type": "string" } } }, "task.MessageResponse": { "type": "object", "properties": { "message": { "type": "string" } } } } }` // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "", Host: "", BasePath: "", Schemes: []string{}, Title: "", Description: "", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", RightDelim: "}}", } func init() { swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) }