parent
d6480525db
commit
08cd51ef68
@ -0,0 +1,358 @@
|
||||
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
||||
// This file was generated by swaggo/swag
|
||||
|
||||
package docs
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"strings"
|
||||
|
||||
"github.com/alecthomas/template"
|
||||
"github.com/swaggo/swag"
|
||||
)
|
||||
|
||||
var doc = `{
|
||||
"schemes": {{ marshal .Schemes }},
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"description": "{{.Description}}",
|
||||
"title": "{{.Title}}",
|
||||
"contact": {
|
||||
"name": "Podgrab Github",
|
||||
"url": "https://www.github.com/akhilrex/podgrab"
|
||||
},
|
||||
"version": "{{.Version}}"
|
||||
},
|
||||
"host": "{{.Host}}",
|
||||
"basePath": "{{.BasePath}}",
|
||||
"paths": {
|
||||
"/podcasts": {
|
||||
"get": {
|
||||
"description": "Get all Podcasts",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"summary": "Get all Podcasts",
|
||||
"operationId": "get-all-podcasts",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Sort by property",
|
||||
"name": "sort",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Sort by asc/desc",
|
||||
"name": "order",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/db.Podcast"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/podcasts/{id}": {
|
||||
"get": {
|
||||
"description": "Get single podcast by ID",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"summary": "Get single podcast by ID",
|
||||
"operationId": "get-podcast-by-id",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Podcast id",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/db.Podcast"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"description": "Delete single podcast by ID",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"summary": "Delete single podcast by ID",
|
||||
"operationId": "delete-podcast-by-id",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Podcast id",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": ""
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"db.Podcast": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"allEpisodesCount": {
|
||||
"type": "integer"
|
||||
},
|
||||
"author": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"downloadedEpisodesCount": {
|
||||
"type": "integer"
|
||||
},
|
||||
"downloadingEpisodesCount": {
|
||||
"type": "integer"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"image": {
|
||||
"type": "string"
|
||||
},
|
||||
"lastEpisode": {
|
||||
"type": "string"
|
||||
},
|
||||
"podcastItems": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/db.PodcastItem"
|
||||
}
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/db.Tag"
|
||||
}
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"db.PodcastItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"bookmarkDate": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"downloadDate": {
|
||||
"type": "string"
|
||||
},
|
||||
"downloadPath": {
|
||||
"type": "string"
|
||||
},
|
||||
"downloadStatus": {
|
||||
"type": "integer"
|
||||
},
|
||||
"duration": {
|
||||
"type": "integer"
|
||||
},
|
||||
"episodeType": {
|
||||
"type": "string"
|
||||
},
|
||||
"fileURL": {
|
||||
"type": "string"
|
||||
},
|
||||
"guid": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"image": {
|
||||
"type": "string"
|
||||
},
|
||||
"isPlayed": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"localImage": {
|
||||
"type": "string"
|
||||
},
|
||||
"podcast": {
|
||||
"$ref": "#/definitions/db.Podcast"
|
||||
},
|
||||
"podcastID": {
|
||||
"type": "string"
|
||||
},
|
||||
"pubDate": {
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"db.Tag": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"label": {
|
||||
"type": "string"
|
||||
},
|
||||
"podcasts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/db.Podcast"
|
||||
}
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
type swaggerInfo struct {
|
||||
Version string
|
||||
Host string
|
||||
BasePath string
|
||||
Schemes []string
|
||||
Title string
|
||||
Description string
|
||||
}
|
||||
|
||||
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
||||
var SwaggerInfo = swaggerInfo{
|
||||
Version: "1.0",
|
||||
Host: "",
|
||||
BasePath: "",
|
||||
Schemes: []string{},
|
||||
Title: "Podgrab API",
|
||||
Description: "This is the api documentation for Podgrab.",
|
||||
}
|
||||
|
||||
type s struct{}
|
||||
|
||||
func (s *s) ReadDoc() string {
|
||||
sInfo := SwaggerInfo
|
||||
sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
|
||||
|
||||
t, err := template.New("swagger_info").Funcs(template.FuncMap{
|
||||
"marshal": func(v interface{}) string {
|
||||
a, _ := json.Marshal(v)
|
||||
return string(a)
|
||||
},
|
||||
}).Parse(doc)
|
||||
if err != nil {
|
||||
return doc
|
||||
}
|
||||
|
||||
var tpl bytes.Buffer
|
||||
if err := t.Execute(&tpl, sInfo); err != nil {
|
||||
return doc
|
||||
}
|
||||
|
||||
return tpl.String()
|
||||
}
|
||||
|
||||
func init() {
|
||||
swag.Register(swag.Name, &s{})
|
||||
}
|
@ -0,0 +1,294 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"description": "This is the api documentation for Podgrab.",
|
||||
"title": "Podgrab API",
|
||||
"contact": {
|
||||
"name": "Podgrab Github",
|
||||
"url": "https://www.github.com/akhilrex/podgrab"
|
||||
},
|
||||
"version": "1.0"
|
||||
},
|
||||
"paths": {
|
||||
"/podcasts": {
|
||||
"get": {
|
||||
"description": "Get all Podcasts",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"summary": "Get all Podcasts",
|
||||
"operationId": "get-all-podcasts",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Sort by property",
|
||||
"name": "sort",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Sort by asc/desc",
|
||||
"name": "order",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/db.Podcast"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/podcasts/{id}": {
|
||||
"get": {
|
||||
"description": "Get single podcast by ID",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"summary": "Get single podcast by ID",
|
||||
"operationId": "get-podcast-by-id",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Podcast id",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/db.Podcast"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"description": "Delete single podcast by ID",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"summary": "Delete single podcast by ID",
|
||||
"operationId": "delete-podcast-by-id",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Podcast id",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": ""
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"db.Podcast": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"allEpisodesCount": {
|
||||
"type": "integer"
|
||||
},
|
||||
"author": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"downloadedEpisodesCount": {
|
||||
"type": "integer"
|
||||
},
|
||||
"downloadingEpisodesCount": {
|
||||
"type": "integer"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"image": {
|
||||
"type": "string"
|
||||
},
|
||||
"lastEpisode": {
|
||||
"type": "string"
|
||||
},
|
||||
"podcastItems": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/db.PodcastItem"
|
||||
}
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/db.Tag"
|
||||
}
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"db.PodcastItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"bookmarkDate": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"downloadDate": {
|
||||
"type": "string"
|
||||
},
|
||||
"downloadPath": {
|
||||
"type": "string"
|
||||
},
|
||||
"downloadStatus": {
|
||||
"type": "integer"
|
||||
},
|
||||
"duration": {
|
||||
"type": "integer"
|
||||
},
|
||||
"episodeType": {
|
||||
"type": "string"
|
||||
},
|
||||
"fileURL": {
|
||||
"type": "string"
|
||||
},
|
||||
"guid": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"image": {
|
||||
"type": "string"
|
||||
},
|
||||
"isPlayed": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"localImage": {
|
||||
"type": "string"
|
||||
},
|
||||
"podcast": {
|
||||
"$ref": "#/definitions/db.Podcast"
|
||||
},
|
||||
"podcastID": {
|
||||
"type": "string"
|
||||
},
|
||||
"pubDate": {
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"db.Tag": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"label": {
|
||||
"type": "string"
|
||||
},
|
||||
"podcasts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/db.Podcast"
|
||||
}
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,196 @@
|
||||
definitions:
|
||||
db.Podcast:
|
||||
properties:
|
||||
allEpisodesCount:
|
||||
type: integer
|
||||
author:
|
||||
type: string
|
||||
createdAt:
|
||||
type: string
|
||||
deletedAt:
|
||||
type: string
|
||||
downloadedEpisodesCount:
|
||||
type: integer
|
||||
downloadingEpisodesCount:
|
||||
type: integer
|
||||
id:
|
||||
type: string
|
||||
image:
|
||||
type: string
|
||||
lastEpisode:
|
||||
type: string
|
||||
podcastItems:
|
||||
items:
|
||||
$ref: '#/definitions/db.PodcastItem'
|
||||
type: array
|
||||
summary:
|
||||
type: string
|
||||
tags:
|
||||
items:
|
||||
$ref: '#/definitions/db.Tag'
|
||||
type: array
|
||||
title:
|
||||
type: string
|
||||
updatedAt:
|
||||
type: string
|
||||
url:
|
||||
type: string
|
||||
type: object
|
||||
db.PodcastItem:
|
||||
properties:
|
||||
bookmarkDate:
|
||||
type: string
|
||||
createdAt:
|
||||
type: string
|
||||
deletedAt:
|
||||
type: string
|
||||
downloadDate:
|
||||
type: string
|
||||
downloadPath:
|
||||
type: string
|
||||
downloadStatus:
|
||||
type: integer
|
||||
duration:
|
||||
type: integer
|
||||
episodeType:
|
||||
type: string
|
||||
fileURL:
|
||||
type: string
|
||||
guid:
|
||||
type: string
|
||||
id:
|
||||
type: string
|
||||
image:
|
||||
type: string
|
||||
isPlayed:
|
||||
type: boolean
|
||||
localImage:
|
||||
type: string
|
||||
podcast:
|
||||
$ref: '#/definitions/db.Podcast'
|
||||
podcastID:
|
||||
type: string
|
||||
pubDate:
|
||||
type: string
|
||||
summary:
|
||||
type: string
|
||||
title:
|
||||
type: string
|
||||
updatedAt:
|
||||
type: string
|
||||
type: object
|
||||
db.Tag:
|
||||
properties:
|
||||
createdAt:
|
||||
type: string
|
||||
deletedAt:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
id:
|
||||
type: string
|
||||
label:
|
||||
type: string
|
||||
podcasts:
|
||||
items:
|
||||
$ref: '#/definitions/db.Podcast'
|
||||
type: array
|
||||
updatedAt:
|
||||
type: string
|
||||
type: object
|
||||
info:
|
||||
contact:
|
||||
name: Podgrab Github
|
||||
url: https://www.github.com/akhilrex/podgrab
|
||||
description: This is the api documentation for Podgrab.
|
||||
title: Podgrab API
|
||||
version: "1.0"
|
||||
paths:
|
||||
/podcasts:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Get all Podcasts
|
||||
operationId: get-all-podcasts
|
||||
parameters:
|
||||
- description: Sort by property
|
||||
in: query
|
||||
name: sort
|
||||
type: string
|
||||
- description: Sort by asc/desc
|
||||
in: query
|
||||
name: order
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/db.Podcast'
|
||||
type: array
|
||||
summary: Get all Podcasts
|
||||
/podcasts/{id}:
|
||||
delete:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Delete single podcast by ID
|
||||
operationId: delete-podcast-by-id
|
||||
parameters:
|
||||
- description: Podcast id
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"204":
|
||||
description: ""
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
"404":
|
||||
description: Bad Request
|
||||
schema:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
summary: Delete single podcast by ID
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Get single podcast by ID
|
||||
operationId: get-podcast-by-id
|
||||
parameters:
|
||||
- description: Podcast id
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/db.Podcast'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
"404":
|
||||
description: Bad Request
|
||||
schema:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
summary: Get single podcast by ID
|
||||
swagger: "2.0"
|
Loading…
Reference in new issue