Mark the possible separation line for mailservers

This commit is contained in:
Devon Hudson 2022-12-05 13:14:58 -07:00
parent 1df1a597ec
commit fea8b5787a
No known key found for this signature in database
GPG key ID: CD06B18E77F6A628
3 changed files with 14 additions and 5 deletions

View file

@ -18,6 +18,7 @@ type FederationInternalAPI interface {
gomatrixserverlib.KeyDatabase gomatrixserverlib.KeyDatabase
ClientFederationAPI ClientFederationAPI
RoomserverFederationAPI RoomserverFederationAPI
MailserverAPI
QueryServerKeys(ctx context.Context, request *QueryServerKeysRequest, response *QueryServerKeysResponse) error QueryServerKeys(ctx context.Context, request *QueryServerKeysRequest, response *QueryServerKeysResponse) error
LookupServerKeys(ctx context.Context, s gomatrixserverlib.ServerName, keyRequests map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.Timestamp) ([]gomatrixserverlib.ServerKeys, error) LookupServerKeys(ctx context.Context, s gomatrixserverlib.ServerName, keyRequests map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.Timestamp) ([]gomatrixserverlib.ServerKeys, error)
@ -30,21 +31,27 @@ type FederationInternalAPI interface {
request *PerformBroadcastEDURequest, request *PerformBroadcastEDURequest,
response *PerformBroadcastEDUResponse, response *PerformBroadcastEDUResponse,
) error ) error
PerformWakeupServers(
ctx context.Context,
request *PerformWakeupServersRequest,
response *PerformWakeupServersResponse,
) error
}
type MailserverAPI interface {
// Store async transactions for forwarding to the destination at a later time.
PerformStoreAsync( PerformStoreAsync(
ctx context.Context, ctx context.Context,
request *PerformStoreAsyncRequest, request *PerformStoreAsyncRequest,
response *PerformStoreAsyncResponse, response *PerformStoreAsyncResponse,
) error ) error
// Obtain the oldest stored transaction for the specified userID.
QueryAsyncTransactions( QueryAsyncTransactions(
ctx context.Context, ctx context.Context,
request *QueryAsyncTransactionsRequest, request *QueryAsyncTransactionsRequest,
response *QueryAsyncTransactionsResponse, response *QueryAsyncTransactionsResponse,
) error ) error
PerformWakeupServers(
ctx context.Context,
request *PerformWakeupServersRequest,
response *PerformWakeupServersResponse,
) error
} }
type ClientFederationAPI interface { type ClientFederationAPI interface {

View file

@ -14,6 +14,7 @@ type AsyncEventsResponse struct {
} }
// GetAsyncEvents implements /_matrix/federation/v1/async_events/{userID} // GetAsyncEvents implements /_matrix/federation/v1/async_events/{userID}
// This endpoint can be extracted into a separate mailserver service.
func GetAsyncEvents( func GetAsyncEvents(
httpReq *http.Request, httpReq *http.Request,
fedReq *gomatrixserverlib.FederationRequest, fedReq *gomatrixserverlib.FederationRequest,

View file

@ -11,6 +11,7 @@ import (
) )
// ForwardAsync implements /_matrix/federation/v1/forward_async/{txnID}/{userID} // ForwardAsync implements /_matrix/federation/v1/forward_async/{txnID}/{userID}
// This endpoint can be extracted into a separate mailserver service.
func ForwardAsync( func ForwardAsync(
httpReq *http.Request, httpReq *http.Request,
fedReq *gomatrixserverlib.FederationRequest, fedReq *gomatrixserverlib.FederationRequest,