Documentation
¶
Index ¶
- Constants
- func MatrixHttpError(w http.ResponseWriter, code int, errcode string, msg string)
- type Config
- type ExcludeUnsafeKeysFetcher
- type Homeserver
- func (h *Homeserver) BindTo(mux *http.ServeMux) error
- func (h *Homeserver) DownloadMedia(ctx context.Context, origin string, mediaId string) ([]byte, error)
- func (h *Homeserver) FetchKeys(ctx context.Context, ...) (...)
- func (h *Homeserver) FetcherName() string
- func (h *Homeserver) GetPublicEventSigningKey() ed25519.PublicKey
- func (h *Homeserver) JoinRoom(ctx context.Context, roomId string, via string, communityId string) (*storage.StoredRoom, error)
- func (h *Homeserver) JoinRooms(ctx context.Context, roomIds []string, via string, communityId string) error
- func (h *Homeserver) LearnStateIfExpired(ctx context.Context, roomId string, atEventId string, via string) error
- func (h *Homeserver) Ping(ctx context.Context, serverName string) error
- func (h *Homeserver) StoreKeys(ctx context.Context, ...) error
- type KeyQueryServer
Constants ¶
View Source
const PolicyServerKeyID gomatrixserverlib.KeyID = "ed25519:policy_server"
Variables ¶
This section is empty.
Functions ¶
func MatrixHttpError ¶
func MatrixHttpError(w http.ResponseWriter, code int, errcode string, msg string)
Types ¶
type Config ¶
type Config struct {
ServerName string
PrivateSigningKey ed25519.PrivateKey
// The key used to sign events as neutral. This key is not published or used as a server key.
PrivateEventSigningKey ed25519.PrivateKey
SigningKeyVersion string
KeyQueryServer *KeyQueryServer
ActorLocalpart string
CacheRoomStateFor time.Duration
TrustedOrigins []string
EnableDirectKeyFetching bool
MediaClientUrl string
MediaClientAccessToken string
AdminContacts []config.SupportContact
SecurityContacts []config.SupportContact
SupportUrl string
}
type ExcludeUnsafeKeysFetcher ¶ added in v1.2.0
type ExcludeUnsafeKeysFetcher struct {
// contains filtered or unexported fields
}
func NewExcludeUnsafeKeysFetcher ¶ added in v1.2.0
func NewExcludeUnsafeKeysFetcher(downstream gomatrixserverlib.KeyFetcher) *ExcludeUnsafeKeysFetcher
func (*ExcludeUnsafeKeysFetcher) FetchKeys ¶ added in v1.2.0
func (f *ExcludeUnsafeKeysFetcher) FetchKeys(ctx context.Context, reqs map[gomatrixserverlib.PublicKeyLookupRequest]spec.Timestamp) (map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult, error)
func (*ExcludeUnsafeKeysFetcher) FetcherName ¶ added in v1.2.0
func (f *ExcludeUnsafeKeysFetcher) FetcherName() string
type Homeserver ¶
type Homeserver struct {
ServerName spec.ServerName
KeyId gomatrixserverlib.KeyID
// contains filtered or unexported fields
}
func NewHomeserver ¶
func NewHomeserver(config *Config, storage storage.PersistentStorage, pool *queue.Pool, pubsubClient pubsub.Client) (*Homeserver, error)
func (*Homeserver) DownloadMedia ¶
func (h *Homeserver) DownloadMedia(ctx context.Context, origin string, mediaId string) ([]byte, error)
DownloadMedia - Implements `media.Downloader`
func (*Homeserver) FetchKeys ¶
func (h *Homeserver) FetchKeys(ctx context.Context, requests map[gomatrixserverlib.PublicKeyLookupRequest]spec.Timestamp) (map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult, error)
func (*Homeserver) FetcherName ¶
func (h *Homeserver) FetcherName() string
func (*Homeserver) GetPublicEventSigningKey ¶
func (h *Homeserver) GetPublicEventSigningKey() ed25519.PublicKey
func (*Homeserver) JoinRoom ¶
func (h *Homeserver) JoinRoom(ctx context.Context, roomId string, via string, communityId string) (*storage.StoredRoom, error)
func (*Homeserver) JoinRooms ¶
func (h *Homeserver) JoinRooms(ctx context.Context, roomIds []string, via string, communityId string) error
JoinRooms - Attempts to join rooms in order, retrying a number of times if required. This is a non-idempotent function: it will store successful joins until an error occurs.
func (*Homeserver) LearnStateIfExpired ¶
func (*Homeserver) Ping ¶
func (h *Homeserver) Ping(ctx context.Context, serverName string) error
Ping - Sends an authenticated request to the given server name in an attempt to encourage it to send us transactions/requests.
func (*Homeserver) StoreKeys ¶
func (h *Homeserver) StoreKeys(ctx context.Context, results map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult) error
Click to show internal directories.
Click to hide internal directories.