mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
Remove unused internal APIs (#1117)
This commit is contained in:
parent
89d61c4877
commit
25cd2dd1c9
11 changed files with 3 additions and 165 deletions
|
@ -12,7 +12,6 @@ import (
|
|||
|
||||
// HTTP paths for the internal HTTP API
|
||||
const (
|
||||
FederationSenderQueryJoinedHostsInRoomPath = "/federationsender/queryJoinedHostsInRoom"
|
||||
FederationSenderQueryJoinedHostServerNamesInRoomPath = "/federationsender/queryJoinedHostServerNamesInRoom"
|
||||
|
||||
FederationSenderPerformDirectoryLookupRequestPath = "/federationsender/performDirectoryLookup"
|
||||
|
@ -73,19 +72,6 @@ func (h *httpFederationSenderInternalAPI) QueryJoinedHostServerNamesInRoom(
|
|||
return internalHTTP.PostJSON(ctx, span, h.httpClient, apiURL, request, response)
|
||||
}
|
||||
|
||||
// QueryJoinedHostsInRoom implements FederationSenderInternalAPI
|
||||
func (h *httpFederationSenderInternalAPI) QueryJoinedHostsInRoom(
|
||||
ctx context.Context,
|
||||
request *api.QueryJoinedHostsInRoomRequest,
|
||||
response *api.QueryJoinedHostsInRoomResponse,
|
||||
) error {
|
||||
span, ctx := opentracing.StartSpanFromContext(ctx, "QueryJoinedHostsInRoom")
|
||||
defer span.Finish()
|
||||
|
||||
apiURL := h.federationSenderURL + FederationSenderQueryJoinedHostsInRoomPath
|
||||
return internalHTTP.PostJSON(ctx, span, h.httpClient, apiURL, request, response)
|
||||
}
|
||||
|
||||
// Handle an instruction to make_join & send_join with a remote server.
|
||||
func (h *httpFederationSenderInternalAPI) PerformJoin(
|
||||
ctx context.Context,
|
||||
|
|
|
@ -12,20 +12,6 @@ import (
|
|||
|
||||
// AddRoutes adds the FederationSenderInternalAPI handlers to the http.ServeMux.
|
||||
func AddRoutes(intAPI api.FederationSenderInternalAPI, internalAPIMux *mux.Router) {
|
||||
internalAPIMux.Handle(
|
||||
FederationSenderQueryJoinedHostsInRoomPath,
|
||||
internal.MakeInternalAPI("QueryJoinedHostsInRoom", func(req *http.Request) util.JSONResponse {
|
||||
var request api.QueryJoinedHostsInRoomRequest
|
||||
var response api.QueryJoinedHostsInRoomResponse
|
||||
if err := json.NewDecoder(req.Body).Decode(&request); err != nil {
|
||||
return util.ErrorResponse(err)
|
||||
}
|
||||
if err := intAPI.QueryJoinedHostsInRoom(req.Context(), &request, &response); err != nil {
|
||||
return util.ErrorResponse(err)
|
||||
}
|
||||
return util.JSONResponse{Code: http.StatusOK, JSON: &response}
|
||||
}),
|
||||
)
|
||||
internalAPIMux.Handle(
|
||||
FederationSenderQueryJoinedHostServerNamesInRoomPath,
|
||||
internal.MakeInternalAPI("QueryJoinedHostServerNamesInRoom", func(req *http.Request) util.JSONResponse {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue