feat: integrated swagger
This commit is contained in:
70
backend/docs/docs.go
Normal file
70
backend/docs/docs.go
Normal file
@@ -0,0 +1,70 @@
|
||||
// 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": {
|
||||
"/service/health": {
|
||||
"get": {
|
||||
"description": "Used internally for checking service health",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Service"
|
||||
],
|
||||
"summary": "Get health status",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "desc",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/controllers.HealthStatus"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"controllers.HealthStatus": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"healthy": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
// 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)
|
||||
}
|
||||
41
backend/docs/swagger.json
Normal file
41
backend/docs/swagger.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"contact": {}
|
||||
},
|
||||
"paths": {
|
||||
"/service/health": {
|
||||
"get": {
|
||||
"description": "Used internally for checking service health",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Service"
|
||||
],
|
||||
"summary": "Get health status",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "desc",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/controllers.HealthStatus"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"controllers.HealthStatus": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"healthy": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
25
backend/docs/swagger.yaml
Normal file
25
backend/docs/swagger.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
definitions:
|
||||
controllers.HealthStatus:
|
||||
properties:
|
||||
healthy:
|
||||
type: boolean
|
||||
type: object
|
||||
info:
|
||||
contact: {}
|
||||
paths:
|
||||
/service/health:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Used internally for checking service health
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: desc
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.HealthStatus'
|
||||
summary: Get health status
|
||||
tags:
|
||||
- Service
|
||||
swagger: "2.0"
|
||||
Reference in New Issue
Block a user