-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b94be3d
commit 0ef8278
Showing
11 changed files
with
250 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// 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": {}, | ||
"license": {}, | ||
"version": "{{.Version}}" | ||
}, | ||
"host": "{{.Host}}", | ||
"basePath": "{{.BasePath}}", | ||
"paths": {} | ||
}` | ||
|
||
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: "", | ||
Host: "", | ||
BasePath: "", | ||
Schemes: []string{}, | ||
Title: "", | ||
Description: "", | ||
} | ||
|
||
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{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"contact": {}, | ||
"license": {} | ||
}, | ||
"paths": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
info: | ||
contact: {} | ||
license: {} | ||
paths: {} | ||
swagger: "2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package error | ||
|
||
type responseError struct { | ||
originalErr error | ||
contextInfo errorContext | ||
} | ||
|
||
type errorContext struct { | ||
Field string | ||
Message string | ||
} | ||
|
||
// Error returns the message of a responseError | ||
func (e responseError) Error() string { | ||
return e.originalErr.Error() | ||
} | ||
|
||
// //New register the new error | ||
// func New(err error, msg string) *responseError { | ||
// return responseError{ | ||
// originalError: err, | ||
// contextInfo: errorContext{ | ||
// Message: msg | ||
// } | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
package route | ||
|
||
import ( | ||
"github/bhattaraibishal50/blog/user/usecase" | ||
userUsecase "github/bhattaraibishal50/blog/user/usecase" | ||
|
||
"github.com/gin-gonic/gin" | ||
) | ||
|
||
// UserRoute exports user routes | ||
func UserRoute(routerGroup *gin.RouterGroup) { | ||
routerGroup.GET("/", usecase.GetUsers) | ||
routerGroup.GET("/", userUsecase.GetUsers) | ||
routerGroup.POST("/signup", userUsecase.Signup) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters