MCPcopy Create free account
hub / github.com/daodst/chat / fetchServerKeysDirectly

Method fetchServerKeysDirectly

federationapi/internal/query.go:28–39  ·  view source on GitHub ↗
(ctx context.Context, serverName gomatrixserverlib.ServerName)

Source from the content-addressed store, hash-verified

26}
27
28func (a *FederationInternalAPI) fetchServerKeysDirectly(ctx context.Context, serverName gomatrixserverlib.ServerName) (*gomatrixserverlib.ServerKeys, error) {
29 ctx, cancel := context.WithTimeout(ctx, time.Second*30)
30 defer cancel()
31 ires, err := a.doRequestIfNotBackingOffOrBlacklisted(serverName, func() (interface{}, error) {
32 return a.federation.GetServerKeys(ctx, serverName)
33 })
34 if err != nil {
35 return nil, err
36 }
37 sks := ires.(gomatrixserverlib.ServerKeys)
38 return &sks, nil
39}
40
41func (a *FederationInternalAPI) fetchServerKeysFromCache(
42 ctx context.Context, req *api.QueryServerKeysRequest,

Callers 1

QueryServerKeysMethod · 0.95

Calls 2

GetServerKeysMethod · 0.80

Tested by

no test coverage detected