Init: lab4 done
This commit is contained in:
123
docs/docs.go
Normal file
123
docs/docs.go
Normal file
@@ -0,0 +1,123 @@
|
||||
// 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}}",
|
||||
"termsOfService": "http://swagger.io/terms",
|
||||
"contact": {},
|
||||
"license": {
|
||||
"name": "0BSD"
|
||||
},
|
||||
"version": "{{.Version}}"
|
||||
},
|
||||
"host": "{{.Host}}",
|
||||
"basePath": "{{.BasePath}}",
|
||||
"paths": {
|
||||
"/url": {
|
||||
"get": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "url",
|
||||
"name": "url",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.UrlState"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"description": "query params",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/handlers.PostUrlInput"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "url",
|
||||
"name": "url",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"handlers.PostUrlInput": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.UrlState": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"isSuccess": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"latency": {
|
||||
"type": "integer"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
||||
var SwaggerInfo = &swag.Spec{
|
||||
Version: "0.0.1-rc1",
|
||||
Host: "",
|
||||
BasePath: "/",
|
||||
Schemes: []string{},
|
||||
Title: "Golang Lab4",
|
||||
Description: "",
|
||||
InfoInstanceName: "swagger",
|
||||
SwaggerTemplate: docTemplate,
|
||||
LeftDelim: "{{",
|
||||
RightDelim: "}}",
|
||||
}
|
||||
|
||||
func init() {
|
||||
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
||||
}
|
||||
97
docs/swagger.json
Normal file
97
docs/swagger.json
Normal file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "Golang Lab4",
|
||||
"termsOfService": "http://swagger.io/terms",
|
||||
"contact": {},
|
||||
"license": {
|
||||
"name": "0BSD"
|
||||
},
|
||||
"version": "0.0.1-rc1"
|
||||
},
|
||||
"basePath": "/",
|
||||
"paths": {
|
||||
"/url": {
|
||||
"get": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "url",
|
||||
"name": "url",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.UrlState"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"description": "query params",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/handlers.PostUrlInput"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "url",
|
||||
"name": "url",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"handlers.PostUrlInput": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.UrlState": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"isSuccess": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"latency": {
|
||||
"type": "integer"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
61
docs/swagger.yaml
Normal file
61
docs/swagger.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
basePath: /
|
||||
definitions:
|
||||
handlers.PostUrlInput:
|
||||
properties:
|
||||
url:
|
||||
type: string
|
||||
type: object
|
||||
models.UrlState:
|
||||
properties:
|
||||
isSuccess:
|
||||
type: boolean
|
||||
latency:
|
||||
type: integer
|
||||
url:
|
||||
type: string
|
||||
type: object
|
||||
info:
|
||||
contact: {}
|
||||
license:
|
||||
name: 0BSD
|
||||
termsOfService: http://swagger.io/terms
|
||||
title: Golang Lab4
|
||||
version: 0.0.1-rc1
|
||||
paths:
|
||||
/url:
|
||||
delete:
|
||||
parameters:
|
||||
- description: url
|
||||
in: query
|
||||
name: url
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
get:
|
||||
parameters:
|
||||
- description: url
|
||||
in: query
|
||||
name: url
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/models.UrlState'
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: query params
|
||||
in: body
|
||||
name: request
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/handlers.PostUrlInput'
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
swagger: "2.0"
|
||||
Reference in New Issue
Block a user