aicra/response/response.go

27 lines
417 B
Go
Raw Normal View History

2018-07-08 22:15:29 +00:00
package response
2018-06-01 08:51:51 +00:00
import (
2018-07-05 17:15:57 +00:00
"git.xdrm.io/go/aicra/err"
2018-06-01 08:51:51 +00:00
)
func NewResponse() *Response {
return &Response{
data: make(map[string]interface{}),
Err: err.Success,
}
}
func (i *Response) Set(name string, value interface{}) {
i.data[name] = value
}
func (i *Response) Get(name string) interface{} {
value, _ := i.data[name]
return value
}
func (i *Response) Dump() map[string]interface{} {
return i.data
}