Documentation ¶
Overview ¶
Package api contains methods used by dendrite components in multi-process mode to send requests to the appservice component, typically in order to ask an application service for some information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RetrieveUserProfile ¶
func RetrieveUserProfile( ctx context.Context, userID string, asAPI AppServiceInternalAPI, profileAPI userapi.ClientUserAPI, ) (*authtypes.Profile, error)
RetrieveUserProfile is a wrapper that queries both the local database and application services for a given user's profile TODO: Remove this, it's called from federationapi and clientapi but is a pure function
Types ¶
type AppServiceInternalAPI ¶ added in v0.8.3
type AppServiceInternalAPI interface { // Check whether a room alias exists within any application service namespaces RoomAliasExists( ctx context.Context, req *RoomAliasExistsRequest, resp *RoomAliasExistsResponse, ) error // Check whether a user ID exists within any application service namespaces UserIDExists( ctx context.Context, req *UserIDExistsRequest, resp *UserIDExistsResponse, ) error }
AppServiceInternalAPI is used to query user and room alias data from application services
type RoomAliasExistsRequest ¶
type RoomAliasExistsRequest struct { // Alias we want to lookup Alias string `json:"alias"` }
RoomAliasExistsRequest is a request to an application service about whether a room alias exists
type RoomAliasExistsResponse ¶
type RoomAliasExistsResponse struct {
AliasExists bool `json:"exists"`
}
RoomAliasExistsResponse is a response from an application service about whether a room alias exists
type UserIDExistsRequest ¶
type UserIDExistsRequest struct { // UserID we want to lookup UserID string `json:"user_id"` }
UserIDExistsRequest is a request to an application service about whether a user ID exists
type UserIDExistsRequestAccessToken ¶
type UserIDExistsRequestAccessToken struct { // UserID we want to lookup UserID string `json:"user_id"` AccessToken string `json:"access_token"` }
UserIDExistsRequestAccessToken is a request to an application service about whether a user ID exists. Includes an access token
type UserIDExistsResponse ¶
type UserIDExistsResponse struct {
UserIDExists bool `json:"exists"`
}
UserIDExistsResponse is a response from an application service about whether a user ID exists