Namespace metric names

This commit is contained in:
Neil Alexander 2022-08-08 16:10:15 +01:00
parent 5eb60ac187
commit 85b34532e3
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
5 changed files with 106 additions and 106 deletions

View file

@ -17,33 +17,33 @@ import (
func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) {
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPIQueryJoinedHostServerNamesInRoomPath, FederationAPIQueryJoinedHostServerNamesInRoomPath,
httputil.MakeInternalRPCAPI("QueryJoinedHostServerNamesInRoom", intAPI.QueryJoinedHostServerNamesInRoom), httputil.MakeInternalRPCAPI("FederationAPIQueryJoinedHostServerNamesInRoom", intAPI.QueryJoinedHostServerNamesInRoom),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPIPerformInviteRequestPath, FederationAPIPerformInviteRequestPath,
httputil.MakeInternalRPCAPI("PerformInvite", intAPI.PerformInvite), httputil.MakeInternalRPCAPI("FederationAPIPerformInvite", intAPI.PerformInvite),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPIPerformLeaveRequestPath, FederationAPIPerformLeaveRequestPath,
httputil.MakeInternalRPCAPI("PerformLeave", intAPI.PerformLeave), httputil.MakeInternalRPCAPI("FederationAPIPerformLeave", intAPI.PerformLeave),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPIPerformDirectoryLookupRequestPath, FederationAPIPerformDirectoryLookupRequestPath,
httputil.MakeInternalRPCAPI("PerformDirectoryLookupRequest", intAPI.PerformDirectoryLookup), httputil.MakeInternalRPCAPI("FederationAPIPerformDirectoryLookupRequest", intAPI.PerformDirectoryLookup),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPIPerformBroadcastEDUPath, FederationAPIPerformBroadcastEDUPath,
httputil.MakeInternalRPCAPI("PerformBroadcastEDU", intAPI.PerformBroadcastEDU), httputil.MakeInternalRPCAPI("FederationAPIPerformBroadcastEDU", intAPI.PerformBroadcastEDU),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPIPerformJoinRequestPath, FederationAPIPerformJoinRequestPath,
httputil.MakeInternalRPCAPI( httputil.MakeInternalRPCAPI(
"PerformJoinRequest", "FederationAPIPerformJoinRequest",
func(ctx context.Context, req *api.PerformJoinRequest, res *api.PerformJoinResponse) error { func(ctx context.Context, req *api.PerformJoinRequest, res *api.PerformJoinResponse) error {
intAPI.PerformJoin(ctx, req, res) intAPI.PerformJoin(ctx, req, res)
return nil return nil
@ -54,7 +54,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) {
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPIPerformJoinRequestPath, FederationAPIPerformJoinRequestPath,
httputil.MakeInternalProxyAPI( httputil.MakeInternalProxyAPI(
"GetUserDevices", "FederationAPIGetUserDevices",
func(ctx context.Context, req *getUserDevices) (*gomatrixserverlib.RespUserDevices, error) { func(ctx context.Context, req *getUserDevices) (*gomatrixserverlib.RespUserDevices, error) {
res, err := intAPI.GetUserDevices(ctx, req.S, req.UserID) res, err := intAPI.GetUserDevices(ctx, req.S, req.UserID)
return &res, federationClientError(err) return &res, federationClientError(err)
@ -65,7 +65,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) {
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPIClaimKeysPath, FederationAPIClaimKeysPath,
httputil.MakeInternalProxyAPI( httputil.MakeInternalProxyAPI(
"ClaimKeys", "FederationAPIClaimKeys",
func(ctx context.Context, req *claimKeys) (*gomatrixserverlib.RespClaimKeys, error) { func(ctx context.Context, req *claimKeys) (*gomatrixserverlib.RespClaimKeys, error) {
res, err := intAPI.ClaimKeys(ctx, req.S, req.OneTimeKeys) res, err := intAPI.ClaimKeys(ctx, req.S, req.OneTimeKeys)
return &res, federationClientError(err) return &res, federationClientError(err)
@ -76,7 +76,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) {
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPIQueryKeysPath, FederationAPIQueryKeysPath,
httputil.MakeInternalProxyAPI( httputil.MakeInternalProxyAPI(
"QueryKeys", "FederationAPIQueryKeys",
func(ctx context.Context, req *queryKeys) (*gomatrixserverlib.RespQueryKeys, error) { func(ctx context.Context, req *queryKeys) (*gomatrixserverlib.RespQueryKeys, error) {
res, err := intAPI.QueryKeys(ctx, req.S, req.Keys) res, err := intAPI.QueryKeys(ctx, req.S, req.Keys)
return &res, federationClientError(err) return &res, federationClientError(err)
@ -87,7 +87,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) {
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPIBackfillPath, FederationAPIBackfillPath,
httputil.MakeInternalProxyAPI( httputil.MakeInternalProxyAPI(
"Backfill", "FederationAPIBackfill",
func(ctx context.Context, req *backfill) (*gomatrixserverlib.Transaction, error) { func(ctx context.Context, req *backfill) (*gomatrixserverlib.Transaction, error) {
res, err := intAPI.Backfill(ctx, req.S, req.RoomID, req.Limit, req.EventIDs) res, err := intAPI.Backfill(ctx, req.S, req.RoomID, req.Limit, req.EventIDs)
return &res, federationClientError(err) return &res, federationClientError(err)
@ -98,7 +98,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) {
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPILookupStatePath, FederationAPILookupStatePath,
httputil.MakeInternalProxyAPI( httputil.MakeInternalProxyAPI(
"LookupState", "FederationAPILookupState",
func(ctx context.Context, req *lookupState) (*gomatrixserverlib.RespState, error) { func(ctx context.Context, req *lookupState) (*gomatrixserverlib.RespState, error) {
res, err := intAPI.LookupState(ctx, req.S, req.RoomID, req.EventID, req.RoomVersion) res, err := intAPI.LookupState(ctx, req.S, req.RoomID, req.EventID, req.RoomVersion)
return &res, federationClientError(err) return &res, federationClientError(err)
@ -109,7 +109,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) {
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPILookupStateIDsPath, FederationAPILookupStateIDsPath,
httputil.MakeInternalProxyAPI( httputil.MakeInternalProxyAPI(
"LookupStateIDs", "FederationAPILookupStateIDs",
func(ctx context.Context, req *lookupStateIDs) (*gomatrixserverlib.RespStateIDs, error) { func(ctx context.Context, req *lookupStateIDs) (*gomatrixserverlib.RespStateIDs, error) {
res, err := intAPI.LookupStateIDs(ctx, req.S, req.RoomID, req.EventID) res, err := intAPI.LookupStateIDs(ctx, req.S, req.RoomID, req.EventID)
return &res, federationClientError(err) return &res, federationClientError(err)
@ -120,7 +120,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) {
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPILookupMissingEventsPath, FederationAPILookupMissingEventsPath,
httputil.MakeInternalProxyAPI( httputil.MakeInternalProxyAPI(
"LookupMissingEvents", "FederationAPILookupMissingEvents",
func(ctx context.Context, req *lookupMissingEvents) (*gomatrixserverlib.RespMissingEvents, error) { func(ctx context.Context, req *lookupMissingEvents) (*gomatrixserverlib.RespMissingEvents, error) {
res, err := intAPI.LookupMissingEvents(ctx, req.S, req.RoomID, req.Missing, req.RoomVersion) res, err := intAPI.LookupMissingEvents(ctx, req.S, req.RoomID, req.Missing, req.RoomVersion)
return &res, federationClientError(err) return &res, federationClientError(err)
@ -131,7 +131,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) {
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPIGetEventPath, FederationAPIGetEventPath,
httputil.MakeInternalProxyAPI( httputil.MakeInternalProxyAPI(
"GetEvent", "FederationAPIGetEvent",
func(ctx context.Context, req *getEvent) (*gomatrixserverlib.Transaction, error) { func(ctx context.Context, req *getEvent) (*gomatrixserverlib.Transaction, error) {
res, err := intAPI.GetEvent(ctx, req.S, req.EventID) res, err := intAPI.GetEvent(ctx, req.S, req.EventID)
return &res, federationClientError(err) return &res, federationClientError(err)
@ -142,7 +142,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) {
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPIGetEventAuthPath, FederationAPIGetEventAuthPath,
httputil.MakeInternalProxyAPI( httputil.MakeInternalProxyAPI(
"GetEventAuth", "FederationAPIGetEventAuth",
func(ctx context.Context, req *getEventAuth) (*gomatrixserverlib.RespEventAuth, error) { func(ctx context.Context, req *getEventAuth) (*gomatrixserverlib.RespEventAuth, error) {
res, err := intAPI.GetEventAuth(ctx, req.S, req.RoomVersion, req.RoomID, req.EventID) res, err := intAPI.GetEventAuth(ctx, req.S, req.RoomVersion, req.RoomID, req.EventID)
return &res, federationClientError(err) return &res, federationClientError(err)
@ -152,13 +152,13 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) {
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPIQueryServerKeysPath, FederationAPIQueryServerKeysPath,
httputil.MakeInternalRPCAPI("QueryServerKeys", intAPI.QueryServerKeys), httputil.MakeInternalRPCAPI("FederationAPIQueryServerKeys", intAPI.QueryServerKeys),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPILookupServerKeysPath, FederationAPILookupServerKeysPath,
httputil.MakeInternalProxyAPI( httputil.MakeInternalProxyAPI(
"LookupServerKeys", "FederationAPILookupServerKeys",
func(ctx context.Context, req *lookupServerKeys) (*[]gomatrixserverlib.ServerKeys, error) { func(ctx context.Context, req *lookupServerKeys) (*[]gomatrixserverlib.ServerKeys, error) {
res, err := intAPI.LookupServerKeys(ctx, req.S, req.KeyRequests) res, err := intAPI.LookupServerKeys(ctx, req.S, req.KeyRequests)
return &res, federationClientError(err) return &res, federationClientError(err)
@ -169,7 +169,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) {
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPIEventRelationshipsPath, FederationAPIEventRelationshipsPath,
httputil.MakeInternalProxyAPI( httputil.MakeInternalProxyAPI(
"MSC2836EventRelationships", "FederationAPIMSC2836EventRelationships",
func(ctx context.Context, req *eventRelationships) (*gomatrixserverlib.MSC2836EventRelationshipsResponse, error) { func(ctx context.Context, req *eventRelationships) (*gomatrixserverlib.MSC2836EventRelationshipsResponse, error) {
res, err := intAPI.MSC2836EventRelationships(ctx, req.S, req.Req, req.RoomVer) res, err := intAPI.MSC2836EventRelationships(ctx, req.S, req.Req, req.RoomVer)
return &res, federationClientError(err) return &res, federationClientError(err)
@ -180,7 +180,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) {
internalAPIMux.Handle( internalAPIMux.Handle(
FederationAPISpacesSummaryPath, FederationAPISpacesSummaryPath,
httputil.MakeInternalProxyAPI( httputil.MakeInternalProxyAPI(
"MSC2946SpacesSummary", "FederationAPIMSC2946SpacesSummary",
func(ctx context.Context, req *spacesReq) (*gomatrixserverlib.MSC2946SpacesResponse, error) { func(ctx context.Context, req *spacesReq) (*gomatrixserverlib.MSC2946SpacesResponse, error) {
res, err := intAPI.MSC2946Spaces(ctx, req.S, req.RoomID, req.SuggestedOnly) res, err := intAPI.MSC2946Spaces(ctx, req.S, req.RoomID, req.SuggestedOnly)
return &res, federationClientError(err) return &res, federationClientError(err)
@ -190,7 +190,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) {
// TODO: Look at this shape // TODO: Look at this shape
internalAPIMux.Handle(FederationAPIQueryPublicKeyPath, internalAPIMux.Handle(FederationAPIQueryPublicKeyPath,
httputil.MakeInternalAPI("queryPublicKeys", func(req *http.Request) util.JSONResponse { httputil.MakeInternalAPI("FederationAPIQueryPublicKeys", func(req *http.Request) util.JSONResponse {
request := api.QueryPublicKeysRequest{} request := api.QueryPublicKeysRequest{}
response := api.QueryPublicKeysResponse{} response := api.QueryPublicKeysResponse{}
if err := json.NewDecoder(req.Body).Decode(&request); err != nil { if err := json.NewDecoder(req.Body).Decode(&request); err != nil {
@ -207,7 +207,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) {
// TODO: Look at this shape // TODO: Look at this shape
internalAPIMux.Handle(FederationAPIInputPublicKeyPath, internalAPIMux.Handle(FederationAPIInputPublicKeyPath,
httputil.MakeInternalAPI("inputPublicKeys", func(req *http.Request) util.JSONResponse { httputil.MakeInternalAPI("FederationAPIInputPublicKeys", func(req *http.Request) util.JSONResponse {
request := api.InputPublicKeysRequest{} request := api.InputPublicKeysRequest{}
response := api.InputPublicKeysResponse{} response := api.InputPublicKeysResponse{}
if err := json.NewDecoder(req.Body).Decode(&request); err != nil { if err := json.NewDecoder(req.Body).Decode(&request); err != nil {

View file

@ -23,51 +23,51 @@ import (
func AddRoutes(internalAPIMux *mux.Router, s api.KeyInternalAPI) { func AddRoutes(internalAPIMux *mux.Router, s api.KeyInternalAPI) {
internalAPIMux.Handle( internalAPIMux.Handle(
PerformClaimKeysPath, PerformClaimKeysPath,
httputil.MakeInternalRPCAPI("PerformClaimKeys", s.PerformClaimKeys), httputil.MakeInternalRPCAPI("KeyserverPerformClaimKeys", s.PerformClaimKeys),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformClaimKeysPath, PerformClaimKeysPath,
httputil.MakeInternalRPCAPI("PerformDeleteKeys", s.PerformDeleteKeys), httputil.MakeInternalRPCAPI("KeyserverPerformDeleteKeys", s.PerformDeleteKeys),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformUploadKeysPath, PerformUploadKeysPath,
httputil.MakeInternalRPCAPI("PerformUploadKeys", s.PerformUploadKeys), httputil.MakeInternalRPCAPI("KeyserverPerformUploadKeys", s.PerformUploadKeys),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformUploadDeviceKeysPath, PerformUploadDeviceKeysPath,
httputil.MakeInternalRPCAPI("PerformUploadDeviceKeys", s.PerformUploadDeviceKeys), httputil.MakeInternalRPCAPI("KeyserverPerformUploadDeviceKeys", s.PerformUploadDeviceKeys),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformUploadDeviceSignaturesPath, PerformUploadDeviceSignaturesPath,
httputil.MakeInternalRPCAPI("PerformUploadDeviceSignatures", s.PerformUploadDeviceSignatures), httputil.MakeInternalRPCAPI("KeyserverPerformUploadDeviceSignatures", s.PerformUploadDeviceSignatures),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryKeysPath, QueryKeysPath,
httputil.MakeInternalRPCAPI("QueryKeys", s.QueryKeys), httputil.MakeInternalRPCAPI("KeyserverQueryKeys", s.QueryKeys),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryOneTimeKeysPath, QueryOneTimeKeysPath,
httputil.MakeInternalRPCAPI("QueryOneTimeKeys", s.QueryOneTimeKeys), httputil.MakeInternalRPCAPI("KeyserverQueryOneTimeKeys", s.QueryOneTimeKeys),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryDeviceMessagesPath, QueryDeviceMessagesPath,
httputil.MakeInternalRPCAPI("QueryDeviceMessages", s.QueryDeviceMessages), httputil.MakeInternalRPCAPI("KeyserverQueryDeviceMessages", s.QueryDeviceMessages),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryKeyChangesPath, QueryKeyChangesPath,
httputil.MakeInternalRPCAPI("queryKeyChanges", s.QueryKeyChanges), httputil.MakeInternalRPCAPI("KeyserverQueryKeyChanges", s.QueryKeyChanges),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QuerySignaturesPath, QuerySignaturesPath,
httputil.MakeInternalRPCAPI("QuerySignatures", s.QuerySignatures), httputil.MakeInternalRPCAPI("KeyserverQuerySignatures", s.QuerySignatures),
) )
} }

View file

@ -11,191 +11,191 @@ import (
func AddRoutes(r api.RoomserverInternalAPI, internalAPIMux *mux.Router) { func AddRoutes(r api.RoomserverInternalAPI, internalAPIMux *mux.Router) {
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverInputRoomEventsPath, RoomserverInputRoomEventsPath,
httputil.MakeInternalRPCAPI("InputRoomEvents", r.InputRoomEvents), httputil.MakeInternalRPCAPI("RoomserverInputRoomEvents", r.InputRoomEvents),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverPerformInvitePath, RoomserverPerformInvitePath,
httputil.MakeInternalRPCAPI("PerformInvite", r.PerformInvite), httputil.MakeInternalRPCAPI("RoomserverPerformInvite", r.PerformInvite),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverPerformJoinPath, RoomserverPerformJoinPath,
httputil.MakeInternalRPCAPI("PerformJoin", r.PerformJoin), httputil.MakeInternalRPCAPI("RoomserverPerformJoin", r.PerformJoin),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverPerformLeavePath, RoomserverPerformLeavePath,
httputil.MakeInternalRPCAPI("PerformLeave", r.PerformLeave), httputil.MakeInternalRPCAPI("RoomserverPerformLeave", r.PerformLeave),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverPerformPeekPath, RoomserverPerformPeekPath,
httputil.MakeInternalRPCAPI("PerformPeek", r.PerformPeek), httputil.MakeInternalRPCAPI("RoomserverPerformPeek", r.PerformPeek),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverPerformInboundPeekPath, RoomserverPerformInboundPeekPath,
httputil.MakeInternalRPCAPI("PerformInboundPeek", r.PerformInboundPeek), httputil.MakeInternalRPCAPI("RoomserverPerformInboundPeek", r.PerformInboundPeek),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverPerformUnpeekPath, RoomserverPerformUnpeekPath,
httputil.MakeInternalRPCAPI("PerformUnpeek", r.PerformUnpeek), httputil.MakeInternalRPCAPI("RoomserverPerformUnpeek", r.PerformUnpeek),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverPerformRoomUpgradePath, RoomserverPerformRoomUpgradePath,
httputil.MakeInternalRPCAPI("PerformRoomUpgrade", r.PerformRoomUpgrade), httputil.MakeInternalRPCAPI("RoomserverPerformRoomUpgrade", r.PerformRoomUpgrade),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverPerformPublishPath, RoomserverPerformPublishPath,
httputil.MakeInternalRPCAPI("PerformPublish", r.PerformPublish), httputil.MakeInternalRPCAPI("RoomserverPerformPublish", r.PerformPublish),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverPerformAdminEvacuateRoomPath, RoomserverPerformAdminEvacuateRoomPath,
httputil.MakeInternalRPCAPI("PerformAdminEvacuateRoom", r.PerformAdminEvacuateRoom), httputil.MakeInternalRPCAPI("RoomserverPerformAdminEvacuateRoom", r.PerformAdminEvacuateRoom),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverPerformAdminEvacuateUserPath, RoomserverPerformAdminEvacuateUserPath,
httputil.MakeInternalRPCAPI("PerformAdminEvacuateUser", r.PerformAdminEvacuateUser), httputil.MakeInternalRPCAPI("RoomserverPerformAdminEvacuateUser", r.PerformAdminEvacuateUser),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryPublishedRoomsPath, RoomserverQueryPublishedRoomsPath,
httputil.MakeInternalRPCAPI("QueryPublishedRooms", r.QueryPublishedRooms), httputil.MakeInternalRPCAPI("RoomserverQueryPublishedRooms", r.QueryPublishedRooms),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryLatestEventsAndStatePath, RoomserverQueryLatestEventsAndStatePath,
httputil.MakeInternalRPCAPI("QueryLatestEventsAndState", r.QueryLatestEventsAndState), httputil.MakeInternalRPCAPI("RoomserverQueryLatestEventsAndState", r.QueryLatestEventsAndState),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryStateAfterEventsPath, RoomserverQueryStateAfterEventsPath,
httputil.MakeInternalRPCAPI("QueryStateAfterEvents", r.QueryStateAfterEvents), httputil.MakeInternalRPCAPI("RoomserverQueryStateAfterEvents", r.QueryStateAfterEvents),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryEventsByIDPath, RoomserverQueryEventsByIDPath,
httputil.MakeInternalRPCAPI("QueryEventsByID", r.QueryEventsByID), httputil.MakeInternalRPCAPI("RoomserverQueryEventsByID", r.QueryEventsByID),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryMembershipForUserPath, RoomserverQueryMembershipForUserPath,
httputil.MakeInternalRPCAPI("QueryMembershipForUser", r.QueryMembershipForUser), httputil.MakeInternalRPCAPI("RoomserverQueryMembershipForUser", r.QueryMembershipForUser),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryMembershipsForRoomPath, RoomserverQueryMembershipsForRoomPath,
httputil.MakeInternalRPCAPI("QueryMembershipsForRoom", r.QueryMembershipsForRoom), httputil.MakeInternalRPCAPI("RoomserverQueryMembershipsForRoom", r.QueryMembershipsForRoom),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryServerJoinedToRoomPath, RoomserverQueryServerJoinedToRoomPath,
httputil.MakeInternalRPCAPI("QueryServerJoinedToRoom", r.QueryServerJoinedToRoom), httputil.MakeInternalRPCAPI("RoomserverQueryServerJoinedToRoom", r.QueryServerJoinedToRoom),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryServerJoinedToRoomPath, RoomserverQueryServerJoinedToRoomPath,
httputil.MakeInternalRPCAPI("QueryServerJoinedToRoom", r.QueryServerJoinedToRoom), httputil.MakeInternalRPCAPI("RoomserverQueryServerJoinedToRoom", r.QueryServerJoinedToRoom),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryServerAllowedToSeeEventPath, RoomserverQueryServerAllowedToSeeEventPath,
httputil.MakeInternalRPCAPI("QueryServerAllowedToSeeEvent", r.QueryServerAllowedToSeeEvent), httputil.MakeInternalRPCAPI("RoomserverQueryServerAllowedToSeeEvent", r.QueryServerAllowedToSeeEvent),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryMissingEventsPath, RoomserverQueryMissingEventsPath,
httputil.MakeInternalRPCAPI("QueryMissingEvents", r.QueryMissingEvents), httputil.MakeInternalRPCAPI("RoomserverQueryMissingEvents", r.QueryMissingEvents),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryStateAndAuthChainPath, RoomserverQueryStateAndAuthChainPath,
httputil.MakeInternalRPCAPI("QueryStateAndAuthChain", r.QueryStateAndAuthChain), httputil.MakeInternalRPCAPI("RoomserverQueryStateAndAuthChain", r.QueryStateAndAuthChain),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverPerformBackfillPath, RoomserverPerformBackfillPath,
httputil.MakeInternalRPCAPI("PerformBackfill", r.PerformBackfill), httputil.MakeInternalRPCAPI("RoomserverPerformBackfill", r.PerformBackfill),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverPerformForgetPath, RoomserverPerformForgetPath,
httputil.MakeInternalRPCAPI("PerformForget", r.PerformForget), httputil.MakeInternalRPCAPI("RoomserverPerformForget", r.PerformForget),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryRoomVersionCapabilitiesPath, RoomserverQueryRoomVersionCapabilitiesPath,
httputil.MakeInternalRPCAPI("QueryRoomVersionCapabilities", r.QueryRoomVersionCapabilities), httputil.MakeInternalRPCAPI("RoomserverQueryRoomVersionCapabilities", r.QueryRoomVersionCapabilities),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryRoomVersionForRoomPath, RoomserverQueryRoomVersionForRoomPath,
httputil.MakeInternalRPCAPI("QueryRoomVersionForRoom", r.QueryRoomVersionForRoom), httputil.MakeInternalRPCAPI("RoomserverQueryRoomVersionForRoom", r.QueryRoomVersionForRoom),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverSetRoomAliasPath, RoomserverSetRoomAliasPath,
httputil.MakeInternalRPCAPI("SetRoomAlias", r.SetRoomAlias), httputil.MakeInternalRPCAPI("RoomserverSetRoomAlias", r.SetRoomAlias),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverGetRoomIDForAliasPath, RoomserverGetRoomIDForAliasPath,
httputil.MakeInternalRPCAPI("GetRoomIDForAlias", r.GetRoomIDForAlias), httputil.MakeInternalRPCAPI("RoomserverGetRoomIDForAlias", r.GetRoomIDForAlias),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverGetAliasesForRoomIDPath, RoomserverGetAliasesForRoomIDPath,
httputil.MakeInternalRPCAPI("GetAliasesForRoomID", r.GetAliasesForRoomID), httputil.MakeInternalRPCAPI("RoomserverGetAliasesForRoomID", r.GetAliasesForRoomID),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverRemoveRoomAliasPath, RoomserverRemoveRoomAliasPath,
httputil.MakeInternalRPCAPI("RemoveRoomAlias", r.RemoveRoomAlias), httputil.MakeInternalRPCAPI("RoomserverRemoveRoomAlias", r.RemoveRoomAlias),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryCurrentStatePath, RoomserverQueryCurrentStatePath,
httputil.MakeInternalRPCAPI("QueryCurrentState", r.QueryCurrentState), httputil.MakeInternalRPCAPI("RoomserverQueryCurrentState", r.QueryCurrentState),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryRoomsForUserPath, RoomserverQueryRoomsForUserPath,
httputil.MakeInternalRPCAPI("QueryRoomsForUser", r.QueryRoomsForUser), httputil.MakeInternalRPCAPI("RoomserverQueryRoomsForUser", r.QueryRoomsForUser),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryBulkStateContentPath, RoomserverQueryBulkStateContentPath,
httputil.MakeInternalRPCAPI("QueryBulkStateContent", r.QueryBulkStateContent), httputil.MakeInternalRPCAPI("RoomserverQueryBulkStateContent", r.QueryBulkStateContent),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQuerySharedUsersPath, RoomserverQuerySharedUsersPath,
httputil.MakeInternalRPCAPI("QuerySharedUsers", r.QuerySharedUsers), httputil.MakeInternalRPCAPI("RoomserverQuerySharedUsers", r.QuerySharedUsers),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryKnownUsersPath, RoomserverQueryKnownUsersPath,
httputil.MakeInternalRPCAPI("QueryKnownUsers", r.QueryKnownUsers), httputil.MakeInternalRPCAPI("RoomserverQueryKnownUsers", r.QueryKnownUsers),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryServerBannedFromRoomPath, RoomserverQueryServerBannedFromRoomPath,
httputil.MakeInternalRPCAPI("QueryServerBannedFromRoom", r.QueryServerBannedFromRoom), httputil.MakeInternalRPCAPI("RoomserverQueryServerBannedFromRoom", r.QueryServerBannedFromRoom),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryAuthChainPath, RoomserverQueryAuthChainPath,
httputil.MakeInternalRPCAPI("QueryAuthChain", r.QueryAuthChain), httputil.MakeInternalRPCAPI("RoomserverQueryAuthChain", r.QueryAuthChain),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
RoomserverQueryRestrictedJoinAllowed, RoomserverQueryRestrictedJoinAllowed,
httputil.MakeInternalRPCAPI("QueryRestrictedJoinAllowed", r.QueryRestrictedJoinAllowed), httputil.MakeInternalRPCAPI("RoomserverQueryRestrictedJoinAllowed", r.QueryRestrictedJoinAllowed),
) )
} }

View file

@ -29,137 +29,137 @@ func AddRoutes(internalAPIMux *mux.Router, s api.UserInternalAPI) {
internalAPIMux.Handle( internalAPIMux.Handle(
PerformAccountCreationPath, PerformAccountCreationPath,
httputil.MakeInternalRPCAPI("PerformAccountCreation", s.PerformAccountCreation), httputil.MakeInternalRPCAPI("UserAPIPerformAccountCreation", s.PerformAccountCreation),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformPasswordUpdatePath, PerformPasswordUpdatePath,
httputil.MakeInternalRPCAPI("PerformPasswordUpdate", s.PerformPasswordUpdate), httputil.MakeInternalRPCAPI("UserAPIPerformPasswordUpdate", s.PerformPasswordUpdate),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformDeviceCreationPath, PerformDeviceCreationPath,
httputil.MakeInternalRPCAPI("PerformDeviceCreation", s.PerformDeviceCreation), httputil.MakeInternalRPCAPI("UserAPIPerformDeviceCreation", s.PerformDeviceCreation),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformLastSeenUpdatePath, PerformLastSeenUpdatePath,
httputil.MakeInternalRPCAPI("PerformLastSeenUpdate", s.PerformLastSeenUpdate), httputil.MakeInternalRPCAPI("UserAPIPerformLastSeenUpdate", s.PerformLastSeenUpdate),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformDeviceUpdatePath, PerformDeviceUpdatePath,
httputil.MakeInternalRPCAPI("PerformDeviceUpdate", s.PerformDeviceUpdate), httputil.MakeInternalRPCAPI("UserAPIPerformDeviceUpdate", s.PerformDeviceUpdate),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformDeviceDeletionPath, PerformDeviceDeletionPath,
httputil.MakeInternalRPCAPI("PerformDeviceDeletion", s.PerformDeviceDeletion), httputil.MakeInternalRPCAPI("UserAPIPerformDeviceDeletion", s.PerformDeviceDeletion),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformAccountDeactivationPath, PerformAccountDeactivationPath,
httputil.MakeInternalRPCAPI("PerformAccountDeactivation", s.PerformAccountDeactivation), httputil.MakeInternalRPCAPI("UserAPIPerformAccountDeactivation", s.PerformAccountDeactivation),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformOpenIDTokenCreationPath, PerformOpenIDTokenCreationPath,
httputil.MakeInternalRPCAPI("PerformOpenIDTokenCreation", s.PerformOpenIDTokenCreation), httputil.MakeInternalRPCAPI("UserAPIPerformOpenIDTokenCreation", s.PerformOpenIDTokenCreation),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryProfilePath, QueryProfilePath,
httputil.MakeInternalRPCAPI("QueryProfile", s.QueryProfile), httputil.MakeInternalRPCAPI("UserAPIQueryProfile", s.QueryProfile),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryAccessTokenPath, QueryAccessTokenPath,
httputil.MakeInternalRPCAPI("QueryAccessToken", s.QueryAccessToken), httputil.MakeInternalRPCAPI("UserAPIQueryAccessToken", s.QueryAccessToken),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryAccessTokenPath, QueryAccessTokenPath,
httputil.MakeInternalRPCAPI("QueryAccessToken", s.QueryAccessToken), httputil.MakeInternalRPCAPI("UserAPIQueryAccessToken", s.QueryAccessToken),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryDevicesPath, QueryDevicesPath,
httputil.MakeInternalRPCAPI("QueryDevices", s.QueryDevices), httputil.MakeInternalRPCAPI("UserAPIQueryDevices", s.QueryDevices),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryAccountDataPath, QueryAccountDataPath,
httputil.MakeInternalRPCAPI("QueryAccountData", s.QueryAccountData), httputil.MakeInternalRPCAPI("UserAPIQueryAccountData", s.QueryAccountData),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryDeviceInfosPath, QueryDeviceInfosPath,
httputil.MakeInternalRPCAPI("QueryDeviceInfos", s.QueryDeviceInfos), httputil.MakeInternalRPCAPI("UserAPIQueryDeviceInfos", s.QueryDeviceInfos),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QuerySearchProfilesPath, QuerySearchProfilesPath,
httputil.MakeInternalRPCAPI("QuerySearchProfiles", s.QuerySearchProfiles), httputil.MakeInternalRPCAPI("UserAPIQuerySearchProfiles", s.QuerySearchProfiles),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryOpenIDTokenPath, QueryOpenIDTokenPath,
httputil.MakeInternalRPCAPI("QueryOpenIDToken", s.QueryOpenIDToken), httputil.MakeInternalRPCAPI("UserAPIQueryOpenIDToken", s.QueryOpenIDToken),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
InputAccountDataPath, InputAccountDataPath,
httputil.MakeInternalRPCAPI("InputAccountData", s.InputAccountData), httputil.MakeInternalRPCAPI("UserAPIInputAccountData", s.InputAccountData),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryKeyBackupPath, QueryKeyBackupPath,
httputil.MakeInternalRPCAPI("QueryKeyBackup", s.QueryKeyBackup), httputil.MakeInternalRPCAPI("UserAPIQueryKeyBackup", s.QueryKeyBackup),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformKeyBackupPath, PerformKeyBackupPath,
httputil.MakeInternalRPCAPI("PerformKeyBackup", s.PerformKeyBackup), httputil.MakeInternalRPCAPI("UserAPIPerformKeyBackup", s.PerformKeyBackup),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryNotificationsPath, QueryNotificationsPath,
httputil.MakeInternalRPCAPI("QueryNotifications", s.QueryNotifications), httputil.MakeInternalRPCAPI("UserAPIQueryNotifications", s.QueryNotifications),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformPusherSetPath, PerformPusherSetPath,
httputil.MakeInternalRPCAPI("PerformPusherSet", s.PerformPusherSet), httputil.MakeInternalRPCAPI("UserAPIPerformPusherSet", s.PerformPusherSet),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformPusherDeletionPath, PerformPusherDeletionPath,
httputil.MakeInternalRPCAPI("PerformPusherDeletion", s.PerformPusherDeletion), httputil.MakeInternalRPCAPI("UserAPIPerformPusherDeletion", s.PerformPusherDeletion),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryPushersPath, QueryPushersPath,
httputil.MakeInternalRPCAPI("QueryPushers", s.QueryPushers), httputil.MakeInternalRPCAPI("UserAPIQueryPushers", s.QueryPushers),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformPushRulesPutPath, PerformPushRulesPutPath,
httputil.MakeInternalRPCAPI("PerformPushRulesPut", s.PerformPushRulesPut), httputil.MakeInternalRPCAPI("UserAPIPerformPushRulesPut", s.PerformPushRulesPut),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryPushRulesPath, QueryPushRulesPath,
httputil.MakeInternalRPCAPI("QueryPushRules", s.QueryPushRules), httputil.MakeInternalRPCAPI("UserAPIQueryPushRules", s.QueryPushRules),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformSetAvatarURLPath, PerformSetAvatarURLPath,
httputil.MakeInternalRPCAPI("PerformSetAvatarURL", s.SetAvatarURL), httputil.MakeInternalRPCAPI("UserAPIPerformSetAvatarURL", s.SetAvatarURL),
) )
// TODO: Look at the shape of this // TODO: Look at the shape of this
internalAPIMux.Handle(QueryNumericLocalpartPath, internalAPIMux.Handle(QueryNumericLocalpartPath,
httputil.MakeInternalAPI("queryNumericLocalpart", func(req *http.Request) util.JSONResponse { httputil.MakeInternalAPI("UserAPIQueryNumericLocalpart", func(req *http.Request) util.JSONResponse {
response := api.QueryNumericLocalpartResponse{} response := api.QueryNumericLocalpartResponse{}
if err := s.QueryNumericLocalpart(req.Context(), &response); err != nil { if err := s.QueryNumericLocalpart(req.Context(), &response); err != nil {
return util.ErrorResponse(err) return util.ErrorResponse(err)
@ -170,36 +170,36 @@ func AddRoutes(internalAPIMux *mux.Router, s api.UserInternalAPI) {
internalAPIMux.Handle( internalAPIMux.Handle(
QueryAccountAvailabilityPath, QueryAccountAvailabilityPath,
httputil.MakeInternalRPCAPI("QueryAccountAvailability", s.QueryAccountAvailability), httputil.MakeInternalRPCAPI("UserAPIQueryAccountAvailability", s.QueryAccountAvailability),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryAccountByPasswordPath, QueryAccountByPasswordPath,
httputil.MakeInternalRPCAPI("QueryAccountByPassword", s.QueryAccountByPassword), httputil.MakeInternalRPCAPI("UserAPIQueryAccountByPassword", s.QueryAccountByPassword),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformSetDisplayNamePath, PerformSetDisplayNamePath,
httputil.MakeInternalRPCAPI("SetDisplayName", s.SetDisplayName), httputil.MakeInternalRPCAPI("UserAPISetDisplayName", s.SetDisplayName),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryLocalpartForThreePIDPath, QueryLocalpartForThreePIDPath,
httputil.MakeInternalRPCAPI("QueryLocalpartForThreePID", s.QueryLocalpartForThreePID), httputil.MakeInternalRPCAPI("UserAPIQueryLocalpartForThreePID", s.QueryLocalpartForThreePID),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryThreePIDsForLocalpartPath, QueryThreePIDsForLocalpartPath,
httputil.MakeInternalRPCAPI("QueryThreePIDsForLocalpart", s.QueryThreePIDsForLocalpart), httputil.MakeInternalRPCAPI("UserAPIQueryThreePIDsForLocalpart", s.QueryThreePIDsForLocalpart),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformForgetThreePIDPath, PerformForgetThreePIDPath,
httputil.MakeInternalRPCAPI("PerformForgetThreePID", s.PerformForgetThreePID), httputil.MakeInternalRPCAPI("UserAPIPerformForgetThreePID", s.PerformForgetThreePID),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformSaveThreePIDAssociationPath, PerformSaveThreePIDAssociationPath,
httputil.MakeInternalRPCAPI("PerformSaveThreePIDAssociation", s.PerformSaveThreePIDAssociation), httputil.MakeInternalRPCAPI("UserAPIPerformSaveThreePIDAssociation", s.PerformSaveThreePIDAssociation),
) )
} }

View file

@ -24,16 +24,16 @@ import (
func addRoutesLoginToken(internalAPIMux *mux.Router, s api.UserInternalAPI) { func addRoutesLoginToken(internalAPIMux *mux.Router, s api.UserInternalAPI) {
internalAPIMux.Handle( internalAPIMux.Handle(
PerformLoginTokenCreationPath, PerformLoginTokenCreationPath,
httputil.MakeInternalRPCAPI("PerformLoginTokenCreation", s.PerformLoginTokenCreation), httputil.MakeInternalRPCAPI("UserAPIPerformLoginTokenCreation", s.PerformLoginTokenCreation),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
PerformLoginTokenDeletionPath, PerformLoginTokenDeletionPath,
httputil.MakeInternalRPCAPI("PerformLoginTokenDeletion", s.PerformLoginTokenDeletion), httputil.MakeInternalRPCAPI("UserAPIPerformLoginTokenDeletion", s.PerformLoginTokenDeletion),
) )
internalAPIMux.Handle( internalAPIMux.Handle(
QueryLoginTokenPath, QueryLoginTokenPath,
httputil.MakeInternalRPCAPI("QueryLoginToken", s.QueryLoginToken), httputil.MakeInternalRPCAPI("UserAPIQueryLoginToken", s.QueryLoginToken),
) )
} }