-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage.go
More file actions
28 lines (23 loc) · 716 Bytes
/
message.go
File metadata and controls
28 lines (23 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package grest
// DeleteMsg is delete result
type DeleteMsg struct {
Count int `json:"count" description:"delete count"`
}
// NewDeleteMsg is create DeleteMsg
func NewDeleteMsg(count int) (msg *DeleteMsg) {
return &DeleteMsg{Count: count}
}
// ErrorMsg is err message
type ErrorMsg struct {
Error errorMsg `json:"error"`
}
// errorMsg is err messages
type errorMsg struct {
StatusCode int `json:"statusCode"`
Name string `json:"name"`
Message interface{} `json:"message"`
}
// NewErrorMsg is create errorMsg
func NewErrorMsg(statusCode int, name string, message interface{}) (err *ErrorMsg) {
return &ErrorMsg{Error: errorMsg{StatusCode: statusCode, Name: name, Message: message}}
}