mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-08 14:43:09 -06:00
tidy up interfaces
This commit is contained in:
parent
9957752a9d
commit
aa758e4826
|
|
@ -53,7 +53,7 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
type testRoomserverAPI struct {
|
type testRoomserverAPI struct {
|
||||||
api.RoomserverInternalAPITrace
|
api.FederationRoomserverAPITrace
|
||||||
inputRoomEvents []api.InputRoomEvent
|
inputRoomEvents []api.InputRoomEvent
|
||||||
queryStateAfterEvents func(*api.QueryStateAfterEventsRequest) api.QueryStateAfterEventsResponse
|
queryStateAfterEvents func(*api.QueryStateAfterEventsRequest) api.QueryStateAfterEventsResponse
|
||||||
queryEventsByID func(req *api.QueryEventsByIDRequest) api.QueryEventsByIDResponse
|
queryEventsByID func(req *api.QueryEventsByIDRequest) api.QueryEventsByIDResponse
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,6 @@ import (
|
||||||
|
|
||||||
// RoomserverInputAPI is used to write events to the room server.
|
// RoomserverInputAPI is used to write events to the room server.
|
||||||
type RoomserverInternalAPI interface {
|
type RoomserverInternalAPI interface {
|
||||||
InputRoomEventsAPI
|
|
||||||
QueryLatestEventsAndStateAPI
|
|
||||||
QueryEventsAPI
|
|
||||||
|
|
||||||
SyncRoomserverAPI
|
SyncRoomserverAPI
|
||||||
AppserviceRoomserverAPI
|
AppserviceRoomserverAPI
|
||||||
ClientRoomserverAPI
|
ClientRoomserverAPI
|
||||||
|
|
@ -28,98 +24,22 @@ type RoomserverInternalAPI interface {
|
||||||
SetAppserviceAPI(asAPI asAPI.AppServiceQueryAPI)
|
SetAppserviceAPI(asAPI asAPI.AppServiceQueryAPI)
|
||||||
SetUserAPI(userAPI userapi.UserInternalAPI)
|
SetUserAPI(userAPI userapi.UserInternalAPI)
|
||||||
|
|
||||||
PerformInvite(
|
|
||||||
ctx context.Context,
|
|
||||||
req *PerformInviteRequest,
|
|
||||||
res *PerformInviteResponse,
|
|
||||||
) error
|
|
||||||
|
|
||||||
PerformJoin(
|
|
||||||
ctx context.Context,
|
|
||||||
req *PerformJoinRequest,
|
|
||||||
res *PerformJoinResponse,
|
|
||||||
)
|
|
||||||
|
|
||||||
PerformLeave(
|
|
||||||
ctx context.Context,
|
|
||||||
req *PerformLeaveRequest,
|
|
||||||
res *PerformLeaveResponse,
|
|
||||||
) error
|
|
||||||
|
|
||||||
PerformPeek(
|
|
||||||
ctx context.Context,
|
|
||||||
req *PerformPeekRequest,
|
|
||||||
res *PerformPeekResponse,
|
|
||||||
)
|
|
||||||
|
|
||||||
PerformUnpeek(
|
|
||||||
ctx context.Context,
|
|
||||||
req *PerformUnpeekRequest,
|
|
||||||
res *PerformUnpeekResponse,
|
|
||||||
)
|
|
||||||
|
|
||||||
PerformPublish(
|
|
||||||
ctx context.Context,
|
|
||||||
req *PerformPublishRequest,
|
|
||||||
res *PerformPublishResponse,
|
|
||||||
)
|
|
||||||
|
|
||||||
// QueryAuthChain returns the entire auth chain for the event IDs given.
|
// QueryAuthChain returns the entire auth chain for the event IDs given.
|
||||||
// The response includes the events in the request.
|
// The response includes the events in the request.
|
||||||
// Omits without error for any missing auth events. There will be no duplicates.
|
// Omits without error for any missing auth events. There will be no duplicates.
|
||||||
|
// Used in MSC2836.
|
||||||
QueryAuthChain(
|
QueryAuthChain(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
req *QueryAuthChainRequest,
|
req *QueryAuthChainRequest,
|
||||||
res *QueryAuthChainResponse,
|
res *QueryAuthChainResponse,
|
||||||
) error
|
) error
|
||||||
|
|
||||||
// QueryRoomsForUser retrieves a list of room IDs matching the given query.
|
|
||||||
QueryRoomsForUser(ctx context.Context, req *QueryRoomsForUserRequest, res *QueryRoomsForUserResponse) error
|
|
||||||
|
|
||||||
// PerformRoomUpgrade upgrades a room to a newer version
|
|
||||||
PerformRoomUpgrade(ctx context.Context, req *PerformRoomUpgradeRequest, resp *PerformRoomUpgradeResponse)
|
|
||||||
|
|
||||||
// Asks for the default room version as preferred by the server.
|
|
||||||
QueryRoomVersionCapabilities(
|
|
||||||
ctx context.Context,
|
|
||||||
req *QueryRoomVersionCapabilitiesRequest,
|
|
||||||
res *QueryRoomVersionCapabilitiesResponse,
|
|
||||||
) error
|
|
||||||
|
|
||||||
// Asks for the room version for a given room.
|
|
||||||
QueryRoomVersionForRoom(
|
|
||||||
ctx context.Context,
|
|
||||||
req *QueryRoomVersionForRoomRequest,
|
|
||||||
res *QueryRoomVersionForRoomResponse,
|
|
||||||
) error
|
|
||||||
|
|
||||||
// Set a room alias
|
|
||||||
SetRoomAlias(
|
|
||||||
ctx context.Context,
|
|
||||||
req *SetRoomAliasRequest,
|
|
||||||
res *SetRoomAliasResponse,
|
|
||||||
) error
|
|
||||||
|
|
||||||
// Get the room ID for an alias
|
|
||||||
GetRoomIDForAlias(
|
|
||||||
ctx context.Context,
|
|
||||||
req *GetRoomIDForAliasRequest,
|
|
||||||
res *GetRoomIDForAliasResponse,
|
|
||||||
) error
|
|
||||||
|
|
||||||
// Get the user ID of the creator of an alias
|
// Get the user ID of the creator of an alias
|
||||||
GetCreatorIDForAlias(
|
GetCreatorIDForAlias(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
req *GetCreatorIDForAliasRequest,
|
req *GetCreatorIDForAliasRequest,
|
||||||
res *GetCreatorIDForAliasResponse,
|
res *GetCreatorIDForAliasResponse,
|
||||||
) error
|
) error
|
||||||
|
|
||||||
// Remove a room alias
|
|
||||||
RemoveRoomAlias(
|
|
||||||
ctx context.Context,
|
|
||||||
req *RemoveRoomAliasRequest,
|
|
||||||
res *RemoveRoomAliasResponse,
|
|
||||||
) error
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type InputRoomEventsAPI interface {
|
type InputRoomEventsAPI interface {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue