Files
OpenFlare/atsf_server/docs/docs.go
T
2026-03-11 14:53:45 +08:00

1439 lines
44 KiB
Go

// 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": {
"/api/agent/apply-logs": {
"post": {
"security": [
{
"AgentTokenAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Agent"
],
"summary": "Report agent apply result",
"parameters": [
{
"description": "Apply log payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service.ApplyLogPayload"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/agent/config-versions/active": {
"get": {
"security": [
{
"AgentTokenAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"Agent"
],
"summary": "Get active config for agent",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/agent/nodes/heartbeat": {
"post": {
"security": [
{
"AgentTokenAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Agent"
],
"summary": "Report agent heartbeat",
"parameters": [
{
"description": "Agent heartbeat payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service.AgentNodePayload"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/agent/nodes/register": {
"post": {
"security": [
{
"AgentTokenAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Agent"
],
"summary": "Register or discover agent node",
"parameters": [
{
"description": "Agent node payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service.AgentNodePayload"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/apply-logs/": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"ApplyLogs"
],
"summary": "List apply logs",
"parameters": [
{
"type": "string",
"description": "Node ID",
"name": "node_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/config-versions/": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"ConfigVersions"
],
"summary": "List config versions",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/config-versions/active": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"ConfigVersions"
],
"summary": "Get active config version",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/config-versions/diff": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"ConfigVersions"
],
"summary": "Diff current draft against active version",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/config-versions/preview": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"ConfigVersions"
],
"summary": "Preview config rendering",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/config-versions/publish": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"ConfigVersions"
],
"summary": "Publish a new config version",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/config-versions/{id}/activate": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"ConfigVersions"
],
"summary": "Activate an existing config version",
"parameters": [
{
"type": "integer",
"description": "Version ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/managed-domains/": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"ManagedDomains"
],
"summary": "List managed domains",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ManagedDomains"
],
"summary": "Create managed domain",
"parameters": [
{
"description": "Managed domain payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service.ManagedDomainInput"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/managed-domains/match": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"ManagedDomains"
],
"summary": "Match certificate for domain",
"parameters": [
{
"type": "string",
"description": "Domain",
"name": "domain",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/managed-domains/{id}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ManagedDomains"
],
"summary": "Update managed domain",
"parameters": [
{
"type": "integer",
"description": "Managed domain ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Managed domain payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service.ManagedDomainInput"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"ManagedDomains"
],
"summary": "Delete managed domain",
"parameters": [
{
"type": "integer",
"description": "Managed domain ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/nodes/": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"Nodes"
],
"summary": "List nodes",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Nodes"
],
"summary": "Create node",
"parameters": [
{
"description": "Node payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service.NodeInput"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/nodes/bootstrap-token": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"Nodes"
],
"summary": "Get global discovery token",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/nodes/bootstrap-token/rotate": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"Nodes"
],
"summary": "Rotate global discovery token",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/nodes/{id}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Nodes"
],
"summary": "Update node",
"parameters": [
{
"type": "integer",
"description": "Node ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Node payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service.NodeInput"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"Nodes"
],
"summary": "Delete node",
"parameters": [
{
"type": "integer",
"description": "Node ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/nodes/{id}/agent-update": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"Nodes"
],
"summary": "Request agent self-update on node",
"parameters": [
{
"type": "integer",
"description": "Node ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/option/": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Options"
],
"summary": "List editable options",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"put": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Options"
],
"summary": "Update option",
"parameters": [
{
"description": "Option payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.Option"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/proxy-routes/": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"ProxyRoutes"
],
"summary": "List proxy routes",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ProxyRoutes"
],
"summary": "Create proxy route",
"parameters": [
{
"description": "Proxy route payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service.ProxyRouteInput"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/proxy-routes/{id}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ProxyRoutes"
],
"summary": "Update proxy route",
"parameters": [
{
"type": "integer",
"description": "Route ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Proxy route payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service.ProxyRouteInput"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"ProxyRoutes"
],
"summary": "Delete proxy route",
"parameters": [
{
"type": "integer",
"description": "Route ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/status": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Public"
],
"summary": "Get server status",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/tls-certificates/": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"TLSCertificates"
],
"summary": "List TLS certificates",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"TLSCertificates"
],
"summary": "Create TLS certificate from PEM",
"parameters": [
{
"description": "TLS certificate payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service.TLSCertificateInput"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/tls-certificates/import-file": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"TLSCertificates"
],
"summary": "Import TLS certificate from files",
"parameters": [
{
"type": "string",
"description": "Certificate name",
"name": "name",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Remark",
"name": "remark",
"in": "formData"
},
{
"type": "file",
"description": "Certificate file",
"name": "cert_file",
"in": "formData",
"required": true
},
{
"type": "file",
"description": "Private key file",
"name": "key_file",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/tls-certificates/{id}": {
"delete": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"TLSCertificates"
],
"summary": "Delete TLS certificate",
"parameters": [
{
"type": "integer",
"description": "Certificate ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/update/latest-release": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Update"
],
"summary": "Get latest GitHub release",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
},
"definitions": {
"model.Option": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"service.AgentNodePayload": {
"type": "object",
"properties": {
"agent_version": {
"type": "string"
},
"current_version": {
"type": "string"
},
"ip": {
"type": "string"
},
"last_error": {
"type": "string"
},
"name": {
"type": "string"
},
"nginx_version": {
"type": "string"
},
"node_id": {
"type": "string"
}
}
},
"service.ApplyLogPayload": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"node_id": {
"type": "string"
},
"result": {
"type": "string"
},
"version": {
"type": "string"
}
}
},
"service.ManagedDomainInput": {
"type": "object",
"properties": {
"cert_id": {
"type": "integer"
},
"domain": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"remark": {
"type": "string"
}
}
},
"service.NodeInput": {
"type": "object",
"properties": {
"auto_update_enabled": {
"type": "boolean"
},
"name": {
"type": "string"
}
}
},
"service.ProxyRouteCustomHeaderInput": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"service.ProxyRouteInput": {
"type": "object",
"properties": {
"cert_id": {
"type": "integer"
},
"custom_headers": {
"type": "array",
"items": {
"$ref": "#/definitions/service.ProxyRouteCustomHeaderInput"
}
},
"domain": {
"type": "string"
},
"enable_https": {
"type": "boolean"
},
"enabled": {
"type": "boolean"
},
"origin_url": {
"type": "string"
},
"redirect_http": {
"type": "boolean"
},
"remark": {
"type": "string"
}
}
},
"service.TLSCertificateInput": {
"type": "object",
"properties": {
"cert_pem": {
"type": "string"
},
"key_pem": {
"type": "string"
},
"name": {
"type": "string"
},
"remark": {
"type": "string"
}
}
}
},
"securityDefinitions": {
"AgentTokenAuth": {
"description": "Agent API 使用节点专属 Agent Token 或全局 Discovery Token",
"type": "apiKey",
"name": "X-Agent-Token",
"in": "header"
},
"BearerAuth": {
"description": "管理端可使用 Bearer Token,例如:Bearer \u003ctoken\u003e",
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "3.0",
Host: "",
BasePath: "/",
Schemes: []string{"http", "https"},
Title: "ATSFlare Server API",
Description: "ATSFlare Server 管理端与 Agent API 文档。",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
//LeftDelim: "{{",
//RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}