chore: proj struct and swagger docs for backend
ci-agent / build (push) Failing after 28s

This commit is contained in:
d3m0k1d
2026-04-03 21:04:49 +03:00
parent 8913353e64
commit 3293915062
9 changed files with 105 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
package cmd
import (
"gitea.d3m0k1d.ru/d3m0k1d/HellreigN/backend/docs"
"github.com/gin-gonic/gin"
swaggerFiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"
)
// @securityDefinitions.apikey Bearer
// @in header
// @name Authorization
// @description Type "Bearer" followed by a space and the JWT token.
func main() {
router := gin.Default()
docs.SwaggerInfo.BasePath = "/api/v1"
docs.SwaggerInfo.Title = "HellreigN"
docs.SwaggerInfo.Version = "1.0"
docs.SwaggerInfo.Description = "API for HellreigN"
docs.SwaggerInfo.Schemes = []string{"http"}
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
}
+44
View File
@@ -0,0 +1,44 @@
// 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": {},
"securityDefinitions": {
"Bearer": {
"description": "Type \"Bearer\" followed by a space and the JWT token.",
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}`
// 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)
}
+15
View File
@@ -0,0 +1,15 @@
{
"swagger": "2.0",
"info": {
"contact": {}
},
"paths": {},
"securityDefinitions": {
"Bearer": {
"description": "Type \"Bearer\" followed by a space and the JWT token.",
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}
+10
View File
@@ -0,0 +1,10 @@
info:
contact: {}
paths: {}
securityDefinitions:
Bearer:
description: Type "Bearer" followed by a space and the JWT token.
in: header
name: Authorization
type: apiKey
swagger: "2.0"
+1
View File
@@ -0,0 +1 @@
package config
+4
View File
@@ -0,0 +1,4 @@
package config
type Config struct {
}
+1
View File
@@ -0,0 +1 @@
package handlers
+1
View File
@@ -0,0 +1 @@
package storage
+6
View File
@@ -0,0 +1,6 @@
.PHONY: docs lint
docs:
swag init -g ./cmd/main.go --parseDependency --parseInternal
lint:
golangci-lint run --fix