api

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2022 License: Apache-2.0 Imports: 6 Imported by: 36

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 AppServiceQueryAPI,
	accountDB accounts.Database,
) (*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 AppServiceQueryAPI

type AppServiceQueryAPI 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
}

AppServiceQueryAPI 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL