Output db.Response instead of generc interface
This commit is contained in:
parent
ff8a2f03a9
commit
1606be22ff
1 changed files with 5 additions and 5 deletions
10
db/db.go
10
db/db.go
|
@ -32,10 +32,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Response struct {
|
type Response struct {
|
||||||
Time string `json:"time,omitempty"`
|
Time string `codec:"time,omitempty"`
|
||||||
Status interface{} `json:"status,omitempty"`
|
Status interface{} `codec:"status,omitempty"`
|
||||||
Detail interface{} `json:"detail,omitempty"`
|
Detail interface{} `codec:"detail,omitempty"`
|
||||||
Result interface{} `json:"result,omitempty"`
|
Result interface{} `codec:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var db *kvs.DB
|
var db *kvs.DB
|
||||||
|
@ -76,7 +76,7 @@ func Execute(ctx *fibre.Context, txt interface{}, vars map[string]interface{}) (
|
||||||
switch res := msg.(type) {
|
switch res := msg.(type) {
|
||||||
case error:
|
case error:
|
||||||
return nil, res
|
return nil, res
|
||||||
default:
|
case *Response:
|
||||||
out = append(out, res)
|
out = append(out, res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue