Skip to content
Merged

docs #64

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
264 changes: 264 additions & 0 deletions MyMusicBoxApi/docs/docs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
// 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/v1/download:sourceId": {
"get": {
"description": "Enables playback for song/file using http 206 partial content",
"produces": [
"application/json"
],
"parameters": [
{
"description": "message/rfc8259 see models.DownloadRequestModel",
"name": "download",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"0": {
"description": "",
"schema": {
"$ref": "#/definitions/models.DownloadRequestModel"
}
},
"200": {
"description": "serve song/file with range request (http 206)"
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.ApiResponseModel"
}
}
}
}
},
"/api/v1/play/:sourceId": {
"get": {
"description": "Enables playback for song/file using http 206 partial content",
"produces": [
"application/json"
],
"parameters": [
{
"type": "string",
"description": "Id of song/file to serve using http 206 partial content",
"name": "sourceId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "serve song/file with range request (http 206)"
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.ApiResponseModel"
}
}
}
}
},
"/api/v1/playlist": {
"get": {
"description": "Returns data for all playlist, if lastKnowPlaylistId then only the playlist after lastKnowPlaylistId",
"produces": [
"application/json"
],
"parameters": [
{
"type": "integer",
"description": "Last know playlist id by the client, default is 0",
"name": "lastKnowPlaylistId",
"in": "path"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Playlist"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.ApiResponseModel"
}
}
}
}
},
"/api/v1/playlist/:playlistId": {
"get": {
"description": "Returns data for a playlist, if lastKnowSongPosition then only songs added after lastKnowSongPosition",
"produces": [
"application/json"
],
"parameters": [
{
"type": "integer",
"description": "Id of playlist",
"name": "playlistId",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Last song that is know by the client, pass this in to only get the latest songs",
"name": "lastKnowSongPosition",
"in": "path"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Song"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.ApiResponseModel"
}
}
}
}
},
"/api/v1/songs": {
"get": {
"description": "Returns data for all songs",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Song"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.ApiResponseModel"
}
}
}
}
}
},
"definitions": {
"models.ApiResponseModel": {
"type": "object",
"properties": {
"data": {},
"message": {
"type": "string"
}
}
},
"models.DownloadRequestModel": {
"type": "object",
"properties": {
"url": {
"type": "string"
}
}
},
"models.Playlist": {
"type": "object",
"properties": {
"creationDate": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "integer"
},
"isPublic": {
"type": "boolean"
},
"name": {
"type": "string"
},
"thumbnailPath": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
"models.Song": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"duration": {
"type": "integer"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"source_id": {
"type": "string"
},
"thumbnail_path": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
}
}
}`

// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "",
BasePath: "/api/v1",
Schemes: []string{},
Title: "MusicBoxApi API",
Description: "",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}

func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
Loading