v1 := req.Header.Get("Accept") == "application/vnd.nsq; version=1.0"
if !v1 {
value = struct {
StatusCode int `json:"status_code"`
StatusText string `json:"status_txt"`
Data interface{} `json:"data"`
}{
StatusCode: status,
StatusText: text,
Data: value,
}
}
We could also do something similar here to support both versions.. a bit more refactoring would need to happen through, to bubble up the headers alongside the ret, or the ret could be a channel of more structured objects, like the LookupResult itself..
I noticed in
handler.go
:We could also do something similar here to support both versions.. a bit more refactoring would need to happen through, to bubble up the headers alongside the
ret
, or theret
could be a channel of more structured objects, like theLookupResult
itself..