Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf36b023d3 | ||
|
|
a8127cc381 |
@@ -19,6 +19,10 @@ func (r *Response) SendError(msg string) {
|
||||
r.Message = msg
|
||||
}
|
||||
|
||||
func (r *Response) SendMessage(msg string) {
|
||||
r.Message = msg
|
||||
}
|
||||
|
||||
func (r *Response) AddGet(get Get) {
|
||||
get.Query = nil
|
||||
r.Get = append(r.Get, get)
|
||||
@@ -32,6 +36,13 @@ func (r *Response) AddSubscription(sub Subscribe) {
|
||||
r.Subscribe = append(r.Subscribe, sub)
|
||||
}
|
||||
|
||||
func (r *Response) AddUnsubscription(sub Subscribe) {
|
||||
r.Subscribe = append(r.Subscribe, sub)
|
||||
}
|
||||
|
||||
func (r *Response) AddUPublish(pub Publish) {
|
||||
r.Publish = append(r.Publish, pub)
|
||||
}
|
||||
func (r *Response) IsValid() bool {
|
||||
return !r.Error
|
||||
}
|
||||
|
||||
@@ -6,6 +6,10 @@ import (
|
||||
"github.com/tecamino/tecamino-json_data/models"
|
||||
)
|
||||
|
||||
func NewResponse() *models.Response {
|
||||
return &models.Response{}
|
||||
}
|
||||
|
||||
func ParseResponse(b []byte) (*models.Response, error) {
|
||||
r := models.Response{}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user