Initial commit

This commit is contained in:
2022-04-27 20:48:21 -04:00
commit edaa99a45f
28 changed files with 21629 additions and 0 deletions

260
docs/docs.go Normal file
View File

@ -0,0 +1,260 @@
// Package docs GENERATED BY SWAG; DO NOT EDIT
// This file was generated by swaggo/swag
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "ccatss",
"url": "https://ccatss.dev",
"email": "admin@meow.tf"
},
"license": {
"name": "ISC License",
"url": "/LICENSE.txt"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/": {
"post": {
"description": "Minify content based on input type",
"consumes": [
"text/html",
"text/css",
"image/svg+xml",
"application/javascript",
"application/json",
"text/xml"
],
"produces": [
"text/plain"
],
"summary": "Minify content",
"parameters": [
{
"description": "Input text",
"name": "input",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Minified content",
"schema": {
"type": "string"
}
}
}
}
},
"/css": {
"post": {
"description": "Minify CSS Input",
"consumes": [
"text/css"
],
"produces": [
"text/css"
],
"summary": "Minify CSS",
"parameters": [
{
"description": "Input CSS",
"name": "input",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Minified CSS",
"schema": {
"type": "string"
}
}
}
}
},
"/html": {
"post": {
"description": "Minify HTML Input",
"consumes": [
"text/html"
],
"produces": [
"text/html"
],
"summary": "Minify HTML",
"parameters": [
{
"description": "Input HTML",
"name": "input",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Minified HTML",
"schema": {
"type": "string"
}
}
}
}
},
"/js": {
"post": {
"description": "Minify JavaScript Input",
"consumes": [
"application/javascript"
],
"produces": [
"application/javascript"
],
"summary": "Minify JavaScript",
"parameters": [
{
"description": "Input JavaScript",
"name": "input",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Minified JavaScript",
"schema": {
"type": "string"
}
}
}
}
},
"/json": {
"post": {
"description": "Minify JSON Input",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "Minify JSON",
"parameters": [
{
"description": "Input JSON",
"name": "input",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Minified JSON",
"schema": {
"type": "string"
}
}
}
}
},
"/svg": {
"post": {
"description": "Minify SVG Input",
"consumes": [
"image/svg+xml"
],
"produces": [
"image/svg+xml"
],
"summary": "Minify SVG",
"parameters": [
{
"description": "Input SVG",
"name": "input",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Minified SVG",
"schema": {
"type": "string"
}
}
}
}
},
"/xml": {
"post": {
"description": "Minify XML Input",
"consumes": [
"text/xml"
],
"produces": [
"text/xml"
],
"summary": "Minify XML",
"parameters": [
{
"description": "Input XML",
"name": "input",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Minified XML",
"schema": {
"type": "string"
}
}
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "minify.ccatss.dev",
BasePath: "/api",
Schemes: []string{},
Title: "Minifier API",
Description: "An API Implementation of tdewolfe's minify package",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}

237
docs/swagger.json Normal file
View File

@ -0,0 +1,237 @@
{
"swagger": "2.0",
"info": {
"description": "An API Implementation of tdewolfe's minify package",
"title": "Minifier API",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "ccatss",
"url": "https://ccatss.dev",
"email": "admin@meow.tf"
},
"license": {
"name": "ISC License",
"url": "/LICENSE.txt"
},
"version": "1.0"
},
"host": "minify.ccatss.dev",
"basePath": "/api",
"paths": {
"/": {
"post": {
"description": "Minify content based on input type",
"consumes": [
"text/html",
"text/css",
"image/svg+xml",
"application/javascript",
"application/json",
"text/xml"
],
"produces": [
"text/plain"
],
"summary": "Minify content",
"parameters": [
{
"description": "Input text",
"name": "input",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Minified content",
"schema": {
"type": "string"
}
}
}
}
},
"/css": {
"post": {
"description": "Minify CSS Input",
"consumes": [
"text/css"
],
"produces": [
"text/css"
],
"summary": "Minify CSS",
"parameters": [
{
"description": "Input CSS",
"name": "input",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Minified CSS",
"schema": {
"type": "string"
}
}
}
}
},
"/html": {
"post": {
"description": "Minify HTML Input",
"consumes": [
"text/html"
],
"produces": [
"text/html"
],
"summary": "Minify HTML",
"parameters": [
{
"description": "Input HTML",
"name": "input",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Minified HTML",
"schema": {
"type": "string"
}
}
}
}
},
"/js": {
"post": {
"description": "Minify JavaScript Input",
"consumes": [
"application/javascript"
],
"produces": [
"application/javascript"
],
"summary": "Minify JavaScript",
"parameters": [
{
"description": "Input JavaScript",
"name": "input",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Minified JavaScript",
"schema": {
"type": "string"
}
}
}
}
},
"/json": {
"post": {
"description": "Minify JSON Input",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "Minify JSON",
"parameters": [
{
"description": "Input JSON",
"name": "input",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Minified JSON",
"schema": {
"type": "string"
}
}
}
}
},
"/svg": {
"post": {
"description": "Minify SVG Input",
"consumes": [
"image/svg+xml"
],
"produces": [
"image/svg+xml"
],
"summary": "Minify SVG",
"parameters": [
{
"description": "Input SVG",
"name": "input",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Minified SVG",
"schema": {
"type": "string"
}
}
}
}
},
"/xml": {
"post": {
"description": "Minify XML Input",
"consumes": [
"text/xml"
],
"produces": [
"text/xml"
],
"summary": "Minify XML",
"parameters": [
{
"description": "Input XML",
"name": "input",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Minified XML",
"schema": {
"type": "string"
}
}
}
}
}
}
}

154
docs/swagger.yaml Normal file
View File

@ -0,0 +1,154 @@
basePath: /api
host: minify.ccatss.dev
info:
contact:
email: admin@meow.tf
name: ccatss
url: https://ccatss.dev
description: An API Implementation of tdewolfe's minify package
license:
name: ISC License
url: /LICENSE.txt
termsOfService: http://swagger.io/terms/
title: Minifier API
version: "1.0"
paths:
/:
post:
consumes:
- text/html
- text/css
- image/svg+xml
- application/javascript
- application/json
- text/xml
description: Minify content based on input type
parameters:
- description: Input text
in: body
name: input
schema:
type: string
produces:
- text/plain
responses:
"200":
description: Minified content
schema:
type: string
summary: Minify content
/css:
post:
consumes:
- text/css
description: Minify CSS Input
parameters:
- description: Input CSS
in: body
name: input
schema:
type: string
produces:
- text/css
responses:
"200":
description: Minified CSS
schema:
type: string
summary: Minify CSS
/html:
post:
consumes:
- text/html
description: Minify HTML Input
parameters:
- description: Input HTML
in: body
name: input
schema:
type: string
produces:
- text/html
responses:
"200":
description: Minified HTML
schema:
type: string
summary: Minify HTML
/js:
post:
consumes:
- application/javascript
description: Minify JavaScript Input
parameters:
- description: Input JavaScript
in: body
name: input
schema:
type: string
produces:
- application/javascript
responses:
"200":
description: Minified JavaScript
schema:
type: string
summary: Minify JavaScript
/json:
post:
consumes:
- application/json
description: Minify JSON Input
parameters:
- description: Input JSON
in: body
name: input
schema:
type: string
produces:
- application/json
responses:
"200":
description: Minified JSON
schema:
type: string
summary: Minify JSON
/svg:
post:
consumes:
- image/svg+xml
description: Minify SVG Input
parameters:
- description: Input SVG
in: body
name: input
schema:
type: string
produces:
- image/svg+xml
responses:
"200":
description: Minified SVG
schema:
type: string
summary: Minify SVG
/xml:
post:
consumes:
- text/xml
description: Minify XML Input
parameters:
- description: Input XML
in: body
name: input
schema:
type: string
produces:
- text/xml
responses:
"200":
description: Minified XML
schema:
type: string
summary: Minify XML
swagger: "2.0"