Documentation ¶
Index ¶
- func Backfill(httpReq *http.Request, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func ClaimOneTimeKeys(httpReq *http.Request, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func CreateInvitesFrom3PIDInvites(req *http.Request, rsAPI api.RoomserverInternalAPI, cfg *config.FederationAPI, ...) util.JSONResponse
- func ExchangeThirdPartyInvite(httpReq *http.Request, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func GetEvent(ctx context.Context, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func GetEventAuth(ctx context.Context, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func GetMissingEvents(httpReq *http.Request, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func GetPostPublicRooms(req *http.Request, rsAPI roomserverAPI.RoomserverInternalAPI) util.JSONResponse
- func GetProfile(httpReq *http.Request, userAPI userapi.UserInternalAPI, ...) util.JSONResponse
- func GetState(ctx context.Context, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func GetStateIDs(ctx context.Context, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func GetUserDevices(req *http.Request, keyAPI keyapi.KeyInternalAPI, userID string) util.JSONResponse
- func InviteV1(httpReq *http.Request, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func InviteV2(httpReq *http.Request, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func LocalKeys(cfg *config.FederationAPI) util.JSONResponse
- func MakeJoin(httpReq *http.Request, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func MakeLeave(httpReq *http.Request, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func NotaryKeys(httpReq *http.Request, cfg *config.FederationAPI, ...) util.JSONResponse
- func Peek(httpReq *http.Request, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func QueryDeviceKeys(httpReq *http.Request, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func RoomAliasToID(httpReq *http.Request, federation *gomatrixserverlib.FederationClient, ...) util.JSONResponse
- func Send(httpReq *http.Request, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func SendJoin(httpReq *http.Request, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func SendLeave(httpReq *http.Request, request *gomatrixserverlib.FederationRequest, ...) util.JSONResponse
- func Setup(fedMux, keyMux *mux.Router, cfg *config.FederationAPI, ...)
- func Version() util.JSONResponse
- type PublicRoomReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Backfill ¶
func Backfill( httpReq *http.Request, request *gomatrixserverlib.FederationRequest, rsAPI api.RoomserverInternalAPI, roomID string, cfg *config.FederationAPI, ) util.JSONResponse
Backfill implements the /backfill federation endpoint. https://matrix.org/docs/spec/server_server/unstable.html#get-matrix-federation-v1-backfill-roomid
func ClaimOneTimeKeys ¶
func ClaimOneTimeKeys( httpReq *http.Request, request *gomatrixserverlib.FederationRequest, keyAPI api.KeyInternalAPI, thisServer gomatrixserverlib.ServerName, ) util.JSONResponse
ClaimOneTimeKeys claims OTKs for users on this server. https://matrix.org/docs/spec/server_server/latest#post-matrix-federation-v1-user-keys-claim
func CreateInvitesFrom3PIDInvites ¶
func CreateInvitesFrom3PIDInvites( req *http.Request, rsAPI api.RoomserverInternalAPI, cfg *config.FederationAPI, federation *gomatrixserverlib.FederationClient, userAPI userapi.UserInternalAPI, ) util.JSONResponse
CreateInvitesFrom3PIDInvites implements POST /_matrix/federation/v1/3pid/onbind
func ExchangeThirdPartyInvite ¶
func ExchangeThirdPartyInvite( httpReq *http.Request, request *gomatrixserverlib.FederationRequest, roomID string, rsAPI api.RoomserverInternalAPI, cfg *config.FederationAPI, federation *gomatrixserverlib.FederationClient, ) util.JSONResponse
ExchangeThirdPartyInvite implements PUT /_matrix/federation/v1/exchange_third_party_invite/{roomID}
func GetEvent ¶
func GetEvent( ctx context.Context, request *gomatrixserverlib.FederationRequest, rsAPI api.RoomserverInternalAPI, eventID string, origin gomatrixserverlib.ServerName, ) util.JSONResponse
GetEvent returns the requested event
func GetEventAuth ¶
func GetEventAuth( ctx context.Context, request *gomatrixserverlib.FederationRequest, rsAPI api.RoomserverInternalAPI, roomID string, eventID string, ) util.JSONResponse
GetEventAuth returns event auth for the roomID and eventID
func GetMissingEvents ¶
func GetMissingEvents( httpReq *http.Request, request *gomatrixserverlib.FederationRequest, rsAPI api.RoomserverInternalAPI, roomID string, ) util.JSONResponse
GetMissingEvents returns missing events between earliest_events & latest_events. Events are fetched from room DAG starting from latest_events until we reach earliest_events or the limit.
func GetPostPublicRooms ¶
func GetPostPublicRooms(req *http.Request, rsAPI roomserverAPI.RoomserverInternalAPI) util.JSONResponse
GetPostPublicRooms implements GET and POST /publicRooms
func GetProfile ¶
func GetProfile( httpReq *http.Request, userAPI userapi.UserInternalAPI, cfg *config.FederationAPI, ) util.JSONResponse
GetProfile implements GET /_matrix/federation/v1/query/profile
func GetState ¶
func GetState( ctx context.Context, request *gomatrixserverlib.FederationRequest, rsAPI api.RoomserverInternalAPI, roomID string, ) util.JSONResponse
GetState returns state events & auth events for the roomID, eventID
func GetStateIDs ¶
func GetStateIDs( ctx context.Context, request *gomatrixserverlib.FederationRequest, rsAPI api.RoomserverInternalAPI, roomID string, ) util.JSONResponse
GetStateIDs returns state event IDs & auth event IDs for the roomID, eventID
func GetUserDevices ¶
func GetUserDevices( req *http.Request, keyAPI keyapi.KeyInternalAPI, userID string, ) util.JSONResponse
GetUserDevices for the given user id
func InviteV1 ¶
func InviteV1( httpReq *http.Request, request *gomatrixserverlib.FederationRequest, roomID string, eventID string, cfg *config.FederationAPI, rsAPI api.RoomserverInternalAPI, keys gomatrixserverlib.JSONVerifier, ) util.JSONResponse
InviteV1 implements /_matrix/federation/v1/invite/{roomID}/{eventID}
func InviteV2 ¶
func InviteV2( httpReq *http.Request, request *gomatrixserverlib.FederationRequest, roomID string, eventID string, cfg *config.FederationAPI, rsAPI api.RoomserverInternalAPI, keys gomatrixserverlib.JSONVerifier, ) util.JSONResponse
InviteV2 implements /_matrix/federation/v2/invite/{roomID}/{eventID}
func LocalKeys ¶
func LocalKeys(cfg *config.FederationAPI) util.JSONResponse
LocalKeys returns the local keys for the server. See https://matrix.org/docs/spec/server_server/unstable.html#publishing-keys
func MakeJoin ¶
func MakeJoin( httpReq *http.Request, request *gomatrixserverlib.FederationRequest, cfg *config.FederationAPI, rsAPI api.RoomserverInternalAPI, roomID, userID string, remoteVersions []gomatrixserverlib.RoomVersion, ) util.JSONResponse
MakeJoin implements the /make_join API nolint:gocyclo
func MakeLeave ¶
func MakeLeave( httpReq *http.Request, request *gomatrixserverlib.FederationRequest, cfg *config.FederationAPI, rsAPI api.RoomserverInternalAPI, roomID, userID string, ) util.JSONResponse
MakeLeave implements the /make_leave API nolint:gocyclo
func NotaryKeys ¶
func NotaryKeys( httpReq *http.Request, cfg *config.FederationAPI, fsAPI federationSenderAPI.FederationSenderInternalAPI, req *gomatrixserverlib.PublicKeyNotaryLookupRequest, ) util.JSONResponse
func Peek ¶ added in v0.3.7
func Peek( httpReq *http.Request, request *gomatrixserverlib.FederationRequest, cfg *config.FederationAPI, rsAPI api.RoomserverInternalAPI, roomID, peekID string, remoteVersions []gomatrixserverlib.RoomVersion, ) util.JSONResponse
Peek implements the SS /peek API, handling inbound peeks
func QueryDeviceKeys ¶
func QueryDeviceKeys( httpReq *http.Request, request *gomatrixserverlib.FederationRequest, keyAPI api.KeyInternalAPI, thisServer gomatrixserverlib.ServerName, ) util.JSONResponse
QueryDeviceKeys returns device keys for users on this server. https://matrix.org/docs/spec/server_server/latest#post-matrix-federation-v1-user-keys-query
func RoomAliasToID ¶
func RoomAliasToID( httpReq *http.Request, federation *gomatrixserverlib.FederationClient, cfg *config.FederationAPI, rsAPI roomserverAPI.RoomserverInternalAPI, senderAPI federationSenderAPI.FederationSenderInternalAPI, ) util.JSONResponse
RoomAliasToID converts the queried alias into a room ID and returns it
func Send ¶
func Send( httpReq *http.Request, request *gomatrixserverlib.FederationRequest, txnID gomatrixserverlib.TransactionID, cfg *config.FederationAPI, rsAPI api.RoomserverInternalAPI, eduAPI eduserverAPI.EDUServerInputAPI, keyAPI keyapi.KeyInternalAPI, keys gomatrixserverlib.JSONVerifier, federation *gomatrixserverlib.FederationClient, ) util.JSONResponse
Send implements /_matrix/federation/v1/send/{txnID}
func SendJoin ¶
func SendJoin( httpReq *http.Request, request *gomatrixserverlib.FederationRequest, cfg *config.FederationAPI, rsAPI api.RoomserverInternalAPI, keys gomatrixserverlib.JSONVerifier, roomID, eventID string, ) util.JSONResponse
SendJoin implements the /send_join API The make-join send-join dance makes much more sense as a single flow so the cyclomatic complexity is high: nolint:gocyclo
func SendLeave ¶
func SendLeave( httpReq *http.Request, request *gomatrixserverlib.FederationRequest, cfg *config.FederationAPI, rsAPI api.RoomserverInternalAPI, keys gomatrixserverlib.JSONVerifier, roomID, eventID string, ) util.JSONResponse
SendLeave implements the /send_leave API nolint:gocyclo
func Setup ¶
func Setup( fedMux, keyMux *mux.Router, cfg *config.FederationAPI, rsAPI roomserverAPI.RoomserverInternalAPI, eduAPI eduserverAPI.EDUServerInputAPI, fsAPI federationSenderAPI.FederationSenderInternalAPI, keys gomatrixserverlib.JSONVerifier, federation *gomatrixserverlib.FederationClient, userAPI userapi.UserInternalAPI, keyAPI keyserverAPI.KeyInternalAPI, mscCfg *config.MSCs, )
Setup registers HTTP handlers with the given ServeMux. The provided publicAPIMux MUST have `UseEncodedPath()` enabled or else routes will incorrectly path unescape twice (once from the router, once from MakeFedAPI). We need to have this enabled so we can decode paths like foo/bar%2Fbaz as [foo, bar/baz] - by default it will decode to [foo, bar, baz]
Due to Setup being used to call many other functions, a gocyclo nolint is applied: nolint: gocyclo