mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-17 11:03:11 -06:00
28 lines
854 B
Go
28 lines
854 B
Go
package inthttp
|
|
|
|
import (
|
|
"github.com/gorilla/mux"
|
|
|
|
"github.com/matrix-org/dendrite/internal/httputil"
|
|
"github.com/matrix-org/dendrite/relayapi/api"
|
|
)
|
|
|
|
// AddRoutes adds the RelayInternalAPI handlers to the http.ServeMux.
|
|
// nolint:gocyclo
|
|
func AddRoutes(intAPI api.RelayInternalAPI, internalAPIMux *mux.Router, enableMetrics bool) {
|
|
internalAPIMux.Handle(
|
|
RelayAPIPerformRelayServerSyncPath,
|
|
httputil.MakeInternalRPCAPI("RelayAPIPerformRelayServerSync", enableMetrics, intAPI.PerformRelayServerSync),
|
|
)
|
|
|
|
internalAPIMux.Handle(
|
|
RelayAPIPerformStoreAsyncPath,
|
|
httputil.MakeInternalRPCAPI("RelayAPIPerformStoreAsync", enableMetrics, intAPI.PerformStoreAsync),
|
|
)
|
|
|
|
internalAPIMux.Handle(
|
|
RelayAPIQueryAsyncTransactionsPath,
|
|
httputil.MakeInternalRPCAPI("RelayAPIQueryAsyncTransactions", enableMetrics, intAPI.QueryAsyncTransactions),
|
|
)
|
|
}
|