Move fedclient interface over to gmsl (#3061)

Companion PR: https://github.com/matrix-org/gomatrixserverlib/pull/366
This commit is contained in:
devonh 2023-04-24 16:23:25 +00:00 committed by GitHub
parent 4679098a64
commit ed19efc5d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 53 additions and 120 deletions

View file

@ -74,7 +74,7 @@ func CreateClient(cfg *config.Dendrite, dnsCache *fclient.DNSCache) *fclient.Cli
// CreateFederationClient creates a new federation client. Should only be called
// once per component.
func CreateFederationClient(cfg *config.Dendrite, dnsCache *fclient.DNSCache) *fclient.FederationClient {
func CreateFederationClient(cfg *config.Dendrite, dnsCache *fclient.DNSCache) fclient.FederationClient {
identities := cfg.Global.SigningIdentities()
if cfg.Global.DisableFederation {
return fclient.NewFederationClient(
@ -85,6 +85,7 @@ func CreateFederationClient(cfg *config.Dendrite, dnsCache *fclient.DNSCache) *f
fclient.WithTimeout(time.Minute * 5),
fclient.WithSkipVerify(cfg.FederationAPI.DisableTLSValidation),
fclient.WithKeepAlives(!cfg.FederationAPI.DisableHTTPKeepalives),
fclient.WithUserAgent(fmt.Sprintf("Dendrite/%s", internal.VersionString())),
}
if cfg.Global.DNSCache.Enabled {
opts = append(opts, fclient.WithDNSCache(dnsCache))
@ -92,7 +93,6 @@ func CreateFederationClient(cfg *config.Dendrite, dnsCache *fclient.DNSCache) *f
client := fclient.NewFederationClient(
identities, opts...,
)
client.SetUserAgent(fmt.Sprintf("Dendrite/%s", internal.VersionString()))
return client
}

View file

@ -43,7 +43,7 @@ type Monolith struct {
Config *config.Dendrite
KeyRing *gomatrixserverlib.KeyRing
Client *fclient.Client
FedClient *fclient.FederationClient
FedClient fclient.FederationClient
AppserviceAPI appserviceAPI.AppServiceInternalAPI
FederationAPI federationAPI.FederationInternalAPI