MCPcopy Create free account
hub / github.com/daodst/chat / DelTmpAuthInfo

Function DelTmpAuthInfo

clientapi/routing/voip.go:206–225  ·  view source on GitHub ↗

DelTmpAuthInfo implements: POST /voip/turnAuthTmpDel

(req *http.Request, device *api.Device, cfg *config.ClientAPI)

Source from the content-addressed store, hash-verified

204
205// POST /voip/turnAuthTmpDel
206func DelTmpAuthInfo(req *http.Request, device *api.Device, cfg *config.ClientAPI) util.JSONResponse {
207 apiClient := getHttpClient(time.Second * 5)
208 defer apiClient.CloseIdleConnections()
209 reqHttp := turnReq{}
210 reqHttp.Username = device.UserID
211
212 respHttp := turnReq{}
213
214 if err := PostJSON(req.Context(), &apiClient, fmt.Sprintf("http://%s:23478/turn/delTmpAuth", turnHost), reqHttp, &respHttp); err != nil {
215 return jsonerror.InternalServerError()
216 }
217 //if err := turn_server.DelTmpAuth(device.UserID); err != nil {
218 // return jsonerror.InternalServerError()
219 //}
220 return util.JSONResponse{
221 Code: http.StatusOK,
222 JSON: struct {
223 }{},
224 }
225}
226
227func getHttpClient(options ...interface{}) http.Client {
228 timeout0 := time.Minute * 1

Callers 1

SetupFunction · 0.85

Calls 3

getHttpClientFunction · 0.85
ContextMethod · 0.80
PostJSONFunction · 0.70

Tested by

no test coverage detected