Define component interfaces based on consumers (2/2) (#2425)

* convert remaining interfaces

* Tidy up the userapi interfaces
This commit is contained in:
kegsay 2022-05-05 19:30:38 +01:00 committed by GitHub
parent e4da04e75b
commit 9957752a9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 153 additions and 162 deletions

View file

@ -43,7 +43,7 @@ type RoomserverInternalAPI struct {
ServerName gomatrixserverlib.ServerName
KeyRing gomatrixserverlib.JSONVerifier
ServerACLs *acls.ServerACLs
fsAPI fsAPI.FederationInternalAPI
fsAPI fsAPI.RoomserverFederationAPI
asAPI asAPI.AppServiceQueryAPI
NATSClient *nats.Conn
JetStream nats.JetStreamContext
@ -87,7 +87,7 @@ func NewRoomserverAPI(
// SetFederationInputAPI passes in a federation input API reference so that we can
// avoid the chicken-and-egg problem of both the roomserver input API and the
// federation input API being interdependent.
func (r *RoomserverInternalAPI) SetFederationAPI(fsAPI fsAPI.FederationInternalAPI, keyRing *gomatrixserverlib.KeyRing) {
func (r *RoomserverInternalAPI) SetFederationAPI(fsAPI fsAPI.RoomserverFederationAPI, keyRing *gomatrixserverlib.KeyRing) {
r.fsAPI = fsAPI
r.KeyRing = keyRing

View file

@ -82,7 +82,7 @@ type Inputer struct {
JetStream nats.JetStreamContext
Durable nats.SubOpt
ServerName gomatrixserverlib.ServerName
FSAPI fedapi.FederationInternalAPI
FSAPI fedapi.RoomserverFederationAPI
KeyRing gomatrixserverlib.JSONVerifier
ACLs *acls.ServerACLs
InputRoomEventTopic string

View file

@ -44,7 +44,7 @@ type missingStateReq struct {
roomInfo *types.RoomInfo
inputer *Inputer
keys gomatrixserverlib.JSONVerifier
federation fedapi.FederationInternalAPI
federation fedapi.RoomserverFederationAPI
roomsMu *internal.MutexByRoom
servers []gomatrixserverlib.ServerName
hadEvents map[string]bool

View file

@ -38,7 +38,7 @@ const maxBackfillServers = 5
type Backfiller struct {
ServerName gomatrixserverlib.ServerName
DB storage.Database
FSAPI federationAPI.FederationInternalAPI
FSAPI federationAPI.RoomserverFederationAPI
KeyRing gomatrixserverlib.JSONVerifier
// The servers which should be preferred above other servers when backfilling
@ -228,7 +228,7 @@ func (r *Backfiller) fetchAndStoreMissingEvents(ctx context.Context, roomVer gom
// backfillRequester implements gomatrixserverlib.BackfillRequester
type backfillRequester struct {
db storage.Database
fsAPI federationAPI.FederationInternalAPI
fsAPI federationAPI.RoomserverFederationAPI
thisServer gomatrixserverlib.ServerName
preferServer map[gomatrixserverlib.ServerName]bool
bwExtrems map[string][]string
@ -240,7 +240,7 @@ type backfillRequester struct {
}
func newBackfillRequester(
db storage.Database, fsAPI federationAPI.FederationInternalAPI, thisServer gomatrixserverlib.ServerName,
db storage.Database, fsAPI federationAPI.RoomserverFederationAPI, thisServer gomatrixserverlib.ServerName,
bwExtrems map[string][]string, preferServers []gomatrixserverlib.ServerName,
) *backfillRequester {
preferServer := make(map[gomatrixserverlib.ServerName]bool)

View file

@ -35,7 +35,7 @@ import (
type Inviter struct {
DB storage.Database
Cfg *config.RoomServer
FSAPI federationAPI.FederationInternalAPI
FSAPI federationAPI.RoomserverFederationAPI
Inputer *input.Inputer
}

View file

@ -38,7 +38,7 @@ import (
type Joiner struct {
ServerName gomatrixserverlib.ServerName
Cfg *config.RoomServer
FSAPI fsAPI.FederationInternalAPI
FSAPI fsAPI.RoomserverFederationAPI
RSAPI rsAPI.RoomserverInternalAPI
DB storage.Database

View file

@ -37,7 +37,7 @@ import (
type Leaver struct {
Cfg *config.RoomServer
DB storage.Database
FSAPI fsAPI.FederationInternalAPI
FSAPI fsAPI.RoomserverFederationAPI
UserAPI userapi.UserInternalAPI
Inputer *input.Inputer
}

View file

@ -33,7 +33,7 @@ import (
type Peeker struct {
ServerName gomatrixserverlib.ServerName
Cfg *config.RoomServer
FSAPI fsAPI.FederationInternalAPI
FSAPI fsAPI.RoomserverFederationAPI
DB storage.Database
Inputer *input.Inputer

View file

@ -30,7 +30,7 @@ import (
type Unpeeker struct {
ServerName gomatrixserverlib.ServerName
Cfg *config.RoomServer
FSAPI fsAPI.FederationInternalAPI
FSAPI fsAPI.RoomserverFederationAPI
DB storage.Database
Inputer *input.Inputer