Not a thing that contains a list of messages.
-type FetchResponse struct {
- Messages []Message
- Time time.Time
-}
-
type StoreRequest struct {
StartTime time.Time
Messages chan<- []Message
type StoreRequest struct {
StartTime time.Time
Messages chan<- []Message
messages_from_store := make(chan []Message, 1)
store.Get <- StoreRequest{since, messages_from_store}
messages_from_store := make(chan []Message, 1)
store.Get <- StoreRequest{since, messages_from_store}
- json_encoded, err := json.Marshal(FetchResponse{<-messages_from_store, time.Now()})
+ json_encoded, err := json.Marshal(<-messages_from_store)
if err != nil {
log.Print("json encode: ", err)
w.WriteHeader(http.StatusInternalServerError)
if err != nil {
log.Print("json encode: ", err)
w.WriteHeader(http.StatusInternalServerError)