added: template responses package
This commit is contained in:
parent
6ea5edb017
commit
f4c4065812
2 changed files with 27 additions and 0 deletions
21
pkg/responses/errorResp.go
Normal file
21
pkg/responses/errorResp.go
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
package responses
|
||||||
|
|
||||||
|
type ErrorResponse400 struct {
|
||||||
|
Error string `json:"error" example:"Bad Request"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ErrorResponse401 struct {
|
||||||
|
Error string `json:"error" example:"Unauthorized"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ErrorResponse403 struct {
|
||||||
|
Error string `json:"error" example:"Forbidden"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ErrorResponse500 struct {
|
||||||
|
Error string `json:"error" example:"Internal Server Error"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ErrorResponse501 struct {
|
||||||
|
Error string `json:"error" example:"Unimplemented"`
|
||||||
|
}
|
||||||
6
pkg/responses/successResp.go
Normal file
6
pkg/responses/successResp.go
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
package responses
|
||||||
|
|
||||||
|
type ResponseOK struct {
|
||||||
|
Message string `json:"message" example:"OK"`
|
||||||
|
Info any `json:"info,omitempty"`
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue