forked from TrueCloudLab/frostfs-rest-gw
[#15] Use status code 200 with payload on success
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
686588bc1a
commit
e28c6e5375
10 changed files with 249 additions and 47 deletions
|
@ -440,7 +440,19 @@ func NewInteger(val int64) *int64 {
|
|||
return &val
|
||||
}
|
||||
|
||||
// NewBool returns pointer to provided bool.
|
||||
func NewBool(val bool) *bool {
|
||||
return &val
|
||||
}
|
||||
|
||||
// NewError wraps error into models.Error.
|
||||
func NewError(err error) models.Error {
|
||||
return models.Error(err.Error())
|
||||
}
|
||||
|
||||
// NewSuccessResponse forms model.SuccessResponse.
|
||||
func NewSuccessResponse() *models.SuccessResponse {
|
||||
return &models.SuccessResponse{
|
||||
Success: NewBool(true),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue