api

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FederationClient

FederationClient is a subset of gomatrixserverlib.FederationClient functions which the fedsender implements as proxy calls, with built-in backoff/retries/etc. Errors returned from functions in this interface are of type FederationClientError

type FederationClientError

type FederationClientError struct {
	Err         string
	RetryAfter  time.Duration
	Blacklisted bool
}

FederationClientError is returned from FederationClient methods in the event of a problem.

func (*FederationClientError) Error

func (e *FederationClientError) Error() string

type FederationSenderInternalAPI

type FederationSenderInternalAPI interface {
	FederationClient

	// PerformDirectoryLookup looks up a remote room ID from a room alias.
	PerformDirectoryLookup(
		ctx context.Context,
		request *PerformDirectoryLookupRequest,
		response *PerformDirectoryLookupResponse,
	) error
	// Query the server names of the joined hosts in a room.
	// Unlike QueryJoinedHostsInRoom, this function returns a de-duplicated slice
	// containing only the server names (without information for membership events).
	// The response will include this server if they are joined to the room.
	QueryJoinedHostServerNamesInRoom(
		ctx context.Context,
		request *QueryJoinedHostServerNamesInRoomRequest,
		response *QueryJoinedHostServerNamesInRoomResponse,
	) error
	// Handle an instruction to make_join & send_join with a remote server.
	PerformJoin(
		ctx context.Context,
		request *PerformJoinRequest,
		response *PerformJoinResponse,
	)
	// Handle an instruction to make_leave & send_leave with a remote server.
	PerformLeave(
		ctx context.Context,
		request *PerformLeaveRequest,
		response *PerformLeaveResponse,
	) error
	// Handle sending an invite to a remote server.
	PerformInvite(
		ctx context.Context,
		request *PerformInviteRequest,
		response *PerformInviteResponse,
	) error
	// Notifies the federation sender that these servers may be online and to retry sending messages.
	PerformServersAlive(
		ctx context.Context,
		request *PerformServersAliveRequest,
		response *PerformServersAliveResponse,
	) error
	// Broadcasts an EDU to all servers in rooms we are joined to.
	PerformBroadcastEDU(
		ctx context.Context,
		request *PerformBroadcastEDURequest,
		response *PerformBroadcastEDUResponse,
	) error
}

FederationSenderInternalAPI is used to query information from the federation sender.

type PerformBroadcastEDURequest

type PerformBroadcastEDURequest struct {
}

type PerformBroadcastEDUResponse

type PerformBroadcastEDUResponse struct {
}

type PerformDirectoryLookupRequest

type PerformDirectoryLookupRequest struct {
	RoomAlias  string                       `json:"room_alias"`
	ServerName gomatrixserverlib.ServerName `json:"server_name"`
}

type PerformDirectoryLookupResponse

type PerformDirectoryLookupResponse struct {
	RoomID      string                         `json:"room_id"`
	ServerNames []gomatrixserverlib.ServerName `json:"server_names"`
}

type PerformInviteRequest

type PerformInviteRequest struct {
	RoomVersion     gomatrixserverlib.RoomVersion             `json:"room_version"`
	Event           *gomatrixserverlib.HeaderedEvent          `json:"event"`
	InviteRoomState []gomatrixserverlib.InviteV2StrippedState `json:"invite_room_state"`
}

type PerformInviteResponse

type PerformInviteResponse struct {
	Event *gomatrixserverlib.HeaderedEvent `json:"event"`
}

type PerformJoinRequest

type PerformJoinRequest struct {
	RoomID string `json:"room_id"`
	UserID string `json:"user_id"`
	// The sorted list of servers to try. Servers will be tried sequentially, after de-duplication.
	ServerNames types.ServerNames      `json:"server_names"`
	Content     map[string]interface{} `json:"content"`
}

type PerformJoinResponse

type PerformJoinResponse struct {
	JoinedVia gomatrixserverlib.ServerName
	LastError *gomatrix.HTTPError
}

type PerformLeaveRequest

type PerformLeaveRequest struct {
	RoomID      string            `json:"room_id"`
	UserID      string            `json:"user_id"`
	ServerNames types.ServerNames `json:"server_names"`
}

type PerformLeaveResponse

type PerformLeaveResponse struct {
}

type PerformServersAliveRequest

type PerformServersAliveRequest struct {
	Servers []gomatrixserverlib.ServerName
}

type PerformServersAliveResponse

type PerformServersAliveResponse struct {
}

type QueryJoinedHostServerNamesInRoomRequest

type QueryJoinedHostServerNamesInRoomRequest struct {
	RoomID string `json:"room_id"`
}

QueryJoinedHostServerNamesInRoomRequest is a request to QueryJoinedHostServerNames

type QueryJoinedHostServerNamesInRoomResponse

type QueryJoinedHostServerNamesInRoomResponse struct {
	ServerNames []gomatrixserverlib.ServerName `json:"server_names"`
}

QueryJoinedHostServerNamesInRoomResponse is a response to QueryJoinedHostServerNames

Jump to

Keyboard shortcuts

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