aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/web/apiv1.go53
-rw-r--r--cmd/web/swagger.go79
2 files changed, 12 insertions, 120 deletions
diff --git a/cmd/web/apiv1.go b/cmd/web/apiv1.go
index a24746c..9a39033 100644
--- a/cmd/web/apiv1.go
+++ b/cmd/web/apiv1.go
@@ -11,27 +11,6 @@ import (
func (a *App) HandleShareLink(w http.ResponseWriter, r *http.Request) {
- // swagger:route GET /share-link share-link
- //
- // Returns the share link
- //
- // This will return the share link for the currently running server,
- // i.e. not 127.0.0.1 but a URL with (usually) an IPv4 RFC1918 address.
- //
- // Consumes:
- // - application/json
- //
- // Produces:
- // - application/json
- //
- // Schemes:
- // - http
- //
- // Deprecated: false
- //
- // Responses:
- // 200: shareLinkResp
-
w.Header().Add("Content-type", "application/json")
enc := json.NewEncoder(w)
err := enc.Encode(a.ShareLink)
@@ -40,40 +19,8 @@ func (a *App) HandleShareLink(w http.ResponseWriter, r *http.Request) {
}
}
-// A shareLinkResp is an error that is used when the required input fails
-// validation.
-// swagger:response shareLinkResp
-type shareLinkResp struct {
- //
- // in: body
- Body struct {
- // Example: http://10.0.0.99:8899/
- URL string
- }
-}
-
func (a *App) HandleDeleteV1(w http.ResponseWriter, r *http.Request) {
- // swagger:route DELETE /lib/game/{game} game
- //
- // Deletes a game
- //
- // Delete a given game where the url param game is the game in question
- //
- // Consumes:
- // - application/json
- //
- // Produces:
- // - application/json
- //
- // Schemes: http, https
- //
- // Deprecated: false
- //
- // Responses:
- // 200: ok
- // 409: conflict
-
vars := mux.Vars(r)
game, ok := vars["game"]
diff --git a/cmd/web/swagger.go b/cmd/web/swagger.go
index bf556d7..ac0601c 100644
--- a/cmd/web/swagger.go
+++ b/cmd/web/swagger.go
@@ -1,71 +1,16 @@
-// Package classification Steam Exporter API
-//
-// the purpose of this application is to allow one to easily and quickly
-// export their steam games to disk or across a network
-//
-//
-// Terms Of Service:
-//
-// there are no TOS at this moment, use at your own risk we take no
-// responsibility
-//
-// Schemes: http
-// Host: 127.0.0.1
-// BasePath: /api/v1
-// Version: 0.0.1
-// License: MIT http://opensource.org/licenses/MIT
-// Contact: Mitchell Riedstra <mitch@riedstra.dev> https://git.riedstra.dev/mitch/steam-export/about
-//
-// Consumes:
-// - application/json
-//
-// Produces:
-// - application/json
-// - application/tar
-//
-// Security:
-//
-// SecurityDefinitions:
-// api_key:
-// type: apiKey
-// name: KEY
-// in: header
-//
-// swagger:meta
package main
-// statusConflict is returned by the API whenever there's a conflicting action
-// swagger:response conflict
-type statusConflict struct {
- // The error message
- // in: body
- Body struct {
- // The validation message
- //
- // Example: false
- OK bool
- // Example: Game $game has other jobs running
- Error string
- }
-}
+// @title Swagger Example API
+// @version 1.0
+// @description This is a sample server Petstore server.
+// @termsOfService http://swagger.io/terms/
-// statusOK is returned by the API whenever there's an OK response
-// swagger:response ok
-type statusOK struct {
- // The error message
- // in: body
- Body struct {
- // The validation message
- //
- // Example: true
- OK bool
- }
-}
+// @contact.name API Support
+// @contact.url http://www.swagger.io/support
+// @contact.email support@swagger.io
-// swagger:parameters game-delete
-type gameParam struct {
- // a BarSlice has bars which are strings
- //
- // in: query
- Game string `json:"game"`
-}
+// @license.name Apache 2.0
+// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
+
+// @host petstore.swagger.io
+// @BasePath /v2