(w http.ResponseWriter, data interface{})
| 359 | } |
| 360 | |
| 361 | func WriteJsonSuccess(w http.ResponseWriter, data interface{}) { |
| 362 | w.Header().Set(ContentTypeHeaderKey, ContentTypeJson) |
| 363 | rtnMap := make(map[string]interface{}) |
| 364 | rtnMap["success"] = true |
| 365 | if data != nil { |
| 366 | rtnMap["data"] = data |
| 367 | } |
| 368 | barr, err := json.Marshal(rtnMap) |
| 369 | if err != nil { |
| 370 | WriteJsonError(w, err) |
| 371 | return |
| 372 | } |
| 373 | w.WriteHeader(http.StatusOK) |
| 374 | w.Write(barr) |
| 375 | } |
| 376 | |
| 377 | type ClientActiveState struct { |
| 378 | Fg bool `json:"fg"` |
nothing calls this directly
no test coverage detected