pomme/docs/docs.go
Sam Therapy 12b219bf45 Small nitpicks
gitignore: add default zones directory
upload: fix typo in swagger docs
config: simplify default save location
Signed-off-by: Sam Therapy <sam@samtherapy.net>
2023-02-06 14:39:08 +00:00

162 lines
5.5 KiB
Go

// 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}}",
"termsOfService": "http://freecumextremist.com/",
"contact": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/login": {
"post": {
"description": "login to Pomme\nRate limited: 5 requests every 5 second",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"accounts"
],
"summary": "authenticate as a regular user",
"parameters": [
{
"type": "string",
"description": "Username",
"name": "username",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Password",
"name": "password",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/internal.SwaggerGenericResponse-internal_Response"
}
},
"401": {
"description": "authFailed is a 401 error when logging in fails, includes realm",
"schema": {
"$ref": "#/definitions/internal.SwaggerGenericResponse-internal_Response"
}
}
}
}
},
"/api/upload": {
"post": {
"security": [
{
"Bearer": []
}
],
"description": "Upload takes a multipart form file as user input. It must not exceed 1 mb and must be of text/plain content type.\nIf a file uploads successfully it will be saved locally and parsed.\nIf parsing is successful pomme will save the file to your ZoneDir defined in your config.\nUploads are associated with a specific user.\nRate limited: 10 requests every 10 second\nyou must specify \"Bearer\" before entering your token",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"DNS"
],
"summary": "upload a zonefile",
"parameters": [
{
"type": "file",
"description": "Zonefile to upload",
"name": "file",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Bearer Token",
"name": "Authorization",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/internal.SwaggerGenericResponse-internal_Response"
}
},
"500": {
"description": "internalServerError is a 500 server error with a logged error call back",
"schema": {
"$ref": "#/definitions/internal.SwaggerGenericResponse-internal_Response"
}
}
}
}
}
},
"definitions": {
"internal.Response": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"internal.SwaggerGenericResponse-internal_Response": {
"type": "object",
"properties": {
"response": {
"description": "Response items",
"allOf": [
{
"$ref": "#/definitions/internal.Response"
}
]
}
}
}
},
"securityDefinitions": {
"Bearer": {
"description": "Type \"Bearer\" followed by a space and JWT token.",
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "0.0.1",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "Pomme",
Description: "Pomme is a service that parses zonefiles",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}