Move Swagger doc to server.go

This commit is contained in:
stefanprodan
2019-08-07 15:22:05 +03:00
parent 94085d6dc6
commit 555450868e
4 changed files with 19 additions and 20 deletions
+1 -1
View File
@@ -58,4 +58,4 @@ release:
swagger:
GO111MODULE=on go get github.com/swaggo/swag/cmd/swag
cd pkg/api && $$(go env GOPATH)/bin/swag init
cd pkg/api && $$(go env GOPATH)/bin/swag init -g server.go
+1 -1
View File
@@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2019-08-07 15:15:38.193457 +0300 EEST m=+0.022158637
// 2019-08-07 15:19:14.198371 +0300 EEST m=+0.021097345
package docs
-18
View File
@@ -1,18 +0,0 @@
package api
// @title Podinfo API
// @version 2.0
// @description Go microservice template for Kubernetes.
// @contact.name Source Code
// @contact.url https://github.com/stefanprodan/podinfo
// @license.name MIT License
// @license.url https://github.com/stefanprodan/podinfo/blob/master/LICENSE
// @host localhost:9898
// @BasePath /
// @schemes http https
type ArrayResponse []string
type MapResponse map[string]string
+17
View File
@@ -20,6 +20,20 @@ import (
"go.uber.org/zap"
)
// @title Podinfo API
// @version 2.0
// @description Go microservice template for Kubernetes.
// @contact.name Source Code
// @contact.url https://github.com/stefanprodan/podinfo
// @license.name MIT License
// @license.url https://github.com/stefanprodan/podinfo/blob/master/LICENSE
// @host localhost:9898
// @BasePath /
// @schemes http https
var (
healthy int32
ready int32
@@ -222,3 +236,6 @@ func (s *Server) printRoutes() {
return nil
})
}
type ArrayResponse []string
type MapResponse map[string]string