Documentation ¶
Index ¶
- type Database
- func (d *Database) AddInboundPeek(ctx context.Context, serverName gomatrixserverlib.ServerName, ...) error
- func (d *Database) AddOutboundPeek(ctx context.Context, serverName gomatrixserverlib.ServerName, ...) error
- func (d *Database) AddServerToBlacklist(serverName gomatrixserverlib.ServerName) error
- func (d *Database) AssociateEDUWithDestination(ctx context.Context, serverName gomatrixserverlib.ServerName, receipt *Receipt) error
- func (d *Database) AssociatePDUWithDestination(ctx context.Context, transactionID gomatrixserverlib.TransactionID, ...) error
- func (d *Database) CleanEDUs(ctx context.Context, serverName gomatrixserverlib.ServerName, ...) error
- func (d *Database) CleanPDUs(ctx context.Context, serverName gomatrixserverlib.ServerName, ...) error
- func (d *Database) GetAllJoinedHosts(ctx context.Context) ([]gomatrixserverlib.ServerName, error)
- func (d *Database) GetInboundPeek(ctx context.Context, serverName gomatrixserverlib.ServerName, ...) (*types.InboundPeek, error)
- func (d *Database) GetInboundPeeks(ctx context.Context, roomID string) ([]types.InboundPeek, error)
- func (d *Database) GetJoinedHosts(ctx context.Context, roomID string) ([]types.JoinedHost, error)
- func (d *Database) GetJoinedHostsForRooms(ctx context.Context, roomIDs []string) ([]gomatrixserverlib.ServerName, error)
- func (d *Database) GetNotaryKeys(ctx context.Context, serverName gomatrixserverlib.ServerName, ...) (sks []gomatrixserverlib.ServerKeys, err error)
- func (d *Database) GetOutboundPeek(ctx context.Context, serverName gomatrixserverlib.ServerName, ...) (*types.OutboundPeek, error)
- func (d *Database) GetOutboundPeeks(ctx context.Context, roomID string) ([]types.OutboundPeek, error)
- func (d *Database) GetPendingEDUCount(ctx context.Context, serverName gomatrixserverlib.ServerName) (int64, error)
- func (d *Database) GetPendingEDUServerNames(ctx context.Context) ([]gomatrixserverlib.ServerName, error)
- func (d *Database) GetPendingEDUs(ctx context.Context, serverName gomatrixserverlib.ServerName, limit int) (edus map[*Receipt]*gomatrixserverlib.EDU, err error)
- func (d *Database) GetPendingPDUCount(ctx context.Context, serverName gomatrixserverlib.ServerName) (int64, error)
- func (d *Database) GetPendingPDUServerNames(ctx context.Context) ([]gomatrixserverlib.ServerName, error)
- func (d *Database) GetPendingPDUs(ctx context.Context, serverName gomatrixserverlib.ServerName, limit int) (events map[*Receipt]*gomatrixserverlib.HeaderedEvent, err error)
- func (d *Database) IsServerBlacklisted(serverName gomatrixserverlib.ServerName) (bool, error)
- func (d *Database) PurgeRoomState(ctx context.Context, roomID string) error
- func (d *Database) RemoveAllServersFromBlacklist() error
- func (d *Database) RemoveServerFromBlacklist(serverName gomatrixserverlib.ServerName) error
- func (d *Database) RenewInboundPeek(ctx context.Context, serverName gomatrixserverlib.ServerName, ...) error
- func (d *Database) RenewOutboundPeek(ctx context.Context, serverName gomatrixserverlib.ServerName, ...) error
- func (d *Database) StoreJSON(ctx context.Context, js string) (*Receipt, error)
- func (d *Database) UpdateNotaryKeys(ctx context.Context, serverName gomatrixserverlib.ServerName, ...) error
- func (d *Database) UpdateRoom(ctx context.Context, roomID, oldEventID, newEventID string, ...) (joinedHosts []types.JoinedHost, err error)
- type Receipt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct { DB *sql.DB Cache caching.FederationSenderCache Writer sqlutil.Writer FederationSenderQueuePDUs tables.FederationSenderQueuePDUs FederationSenderQueueEDUs tables.FederationSenderQueueEDUs FederationSenderQueueJSON tables.FederationSenderQueueJSON FederationSenderJoinedHosts tables.FederationSenderJoinedHosts FederationSenderBlacklist tables.FederationSenderBlacklist FederationSenderOutboundPeeks tables.FederationSenderOutboundPeeks FederationSenderInboundPeeks tables.FederationSenderInboundPeeks NotaryServerKeysJSON tables.FederationSenderNotaryServerKeysJSON NotaryServerKeysMetadata tables.FederationSenderNotaryServerKeysMetadata }
func (*Database) AddInboundPeek ¶ added in v0.3.7
func (d *Database) AddInboundPeek(ctx context.Context, serverName gomatrixserverlib.ServerName, roomID, peekID string, renewalInterval int64) error
func (*Database) AddOutboundPeek ¶ added in v0.3.7
func (d *Database) AddOutboundPeek(ctx context.Context, serverName gomatrixserverlib.ServerName, roomID, peekID string, renewalInterval int64) error
func (*Database) AddServerToBlacklist ¶
func (d *Database) AddServerToBlacklist(serverName gomatrixserverlib.ServerName) error
func (*Database) AssociateEDUWithDestination ¶
func (d *Database) AssociateEDUWithDestination( ctx context.Context, serverName gomatrixserverlib.ServerName, receipt *Receipt, ) error
AssociateEDUWithDestination creates an association that the destination queues will use to determine which JSON blobs to send to which servers.
func (*Database) AssociatePDUWithDestination ¶
func (d *Database) AssociatePDUWithDestination( ctx context.Context, transactionID gomatrixserverlib.TransactionID, serverName gomatrixserverlib.ServerName, receipt *Receipt, ) error
AssociatePDUWithDestination creates an association that the destination queues will use to determine which JSON blobs to send to which servers.
func (*Database) CleanEDUs ¶
func (d *Database) CleanEDUs( ctx context.Context, serverName gomatrixserverlib.ServerName, receipts []*Receipt, ) error
CleanEDUs cleans up all specified EDUs. This is done when a transaction was sent successfully.
func (*Database) CleanPDUs ¶
func (d *Database) CleanPDUs( ctx context.Context, serverName gomatrixserverlib.ServerName, receipts []*Receipt, ) error
CleanTransactionPDUs cleans up all associated events for a given transaction. This is done when the transaction was sent successfully.
func (*Database) GetAllJoinedHosts ¶
func (d *Database) GetAllJoinedHosts(ctx context.Context) ([]gomatrixserverlib.ServerName, error)
GetAllJoinedHosts returns the currently joined hosts for all rooms known to the federation sender. Returns an error if something goes wrong.
func (*Database) GetInboundPeek ¶ added in v0.3.7
func (d *Database) GetInboundPeek(ctx context.Context, serverName gomatrixserverlib.ServerName, roomID, peekID string) (*types.InboundPeek, error)
func (*Database) GetInboundPeeks ¶ added in v0.3.7
func (*Database) GetJoinedHosts ¶
func (d *Database) GetJoinedHosts( ctx context.Context, roomID string, ) ([]types.JoinedHost, error)
GetJoinedHosts returns the currently joined hosts for room, as known to federationserver. Returns an error if something goes wrong.
func (*Database) GetJoinedHostsForRooms ¶
func (d *Database) GetJoinedHostsForRooms(ctx context.Context, roomIDs []string) ([]gomatrixserverlib.ServerName, error)
func (*Database) GetNotaryKeys ¶ added in v0.4.1
func (d *Database) GetNotaryKeys( ctx context.Context, serverName gomatrixserverlib.ServerName, optKeyIDs []gomatrixserverlib.KeyID, ) (sks []gomatrixserverlib.ServerKeys, err error)
func (*Database) GetOutboundPeek ¶ added in v0.3.7
func (d *Database) GetOutboundPeek(ctx context.Context, serverName gomatrixserverlib.ServerName, roomID, peekID string) (*types.OutboundPeek, error)
func (*Database) GetOutboundPeeks ¶ added in v0.3.7
func (*Database) GetPendingEDUCount ¶
func (d *Database) GetPendingEDUCount( ctx context.Context, serverName gomatrixserverlib.ServerName, ) (int64, error)
GetPendingEDUCount returns the number of EDUs waiting to be sent for a given servername.
func (*Database) GetPendingEDUServerNames ¶
func (d *Database) GetPendingEDUServerNames( ctx context.Context, ) ([]gomatrixserverlib.ServerName, error)
GetPendingServerNames returns the server names that have EDUs waiting to be sent.
func (*Database) GetPendingEDUs ¶ added in v0.3.3
func (d *Database) GetPendingEDUs( ctx context.Context, serverName gomatrixserverlib.ServerName, limit int, ) ( edus map[*Receipt]*gomatrixserverlib.EDU, err error, )
GetNextTransactionEDUs retrieves events from the database for the next pending transaction, up to the limit specified.
func (*Database) GetPendingPDUCount ¶
func (d *Database) GetPendingPDUCount( ctx context.Context, serverName gomatrixserverlib.ServerName, ) (int64, error)
GetPendingPDUCount returns the number of PDUs waiting to be sent for a given servername.
func (*Database) GetPendingPDUServerNames ¶
func (d *Database) GetPendingPDUServerNames( ctx context.Context, ) ([]gomatrixserverlib.ServerName, error)
GetPendingServerNames returns the server names that have PDUs waiting to be sent.
func (*Database) GetPendingPDUs ¶ added in v0.3.3
func (d *Database) GetPendingPDUs( ctx context.Context, serverName gomatrixserverlib.ServerName, limit int, ) ( events map[*Receipt]*gomatrixserverlib.HeaderedEvent, err error, )
GetNextTransactionPDUs retrieves events from the database for the next pending transaction, up to the limit specified.
func (*Database) IsServerBlacklisted ¶
func (d *Database) IsServerBlacklisted(serverName gomatrixserverlib.ServerName) (bool, error)
func (*Database) PurgeRoomState ¶ added in v0.2.1
func (*Database) RemoveAllServersFromBlacklist ¶ added in v0.4.0
func (*Database) RemoveServerFromBlacklist ¶
func (d *Database) RemoveServerFromBlacklist(serverName gomatrixserverlib.ServerName) error
func (*Database) RenewInboundPeek ¶ added in v0.3.7
func (d *Database) RenewInboundPeek(ctx context.Context, serverName gomatrixserverlib.ServerName, roomID, peekID string, renewalInterval int64) error
func (*Database) RenewOutboundPeek ¶ added in v0.3.7
func (d *Database) RenewOutboundPeek(ctx context.Context, serverName gomatrixserverlib.ServerName, roomID, peekID string, renewalInterval int64) error
func (*Database) StoreJSON ¶
StoreJSON adds a JSON blob into the queue JSON table and returns a NID. The NID will then be used when inserting the per-destination metadata entries.
func (*Database) UpdateNotaryKeys ¶ added in v0.4.1
func (d *Database) UpdateNotaryKeys(ctx context.Context, serverName gomatrixserverlib.ServerName, serverKeys gomatrixserverlib.ServerKeys) error
func (*Database) UpdateRoom ¶
func (d *Database) UpdateRoom( ctx context.Context, roomID, oldEventID, newEventID string, addHosts []types.JoinedHost, removeHosts []string, ) (joinedHosts []types.JoinedHost, err error)
UpdateRoom updates the joined hosts for a room and returns what the joined hosts were before the update, or nil if this was a duplicate message. This is called when we receive a message from kafka, so we pass in oldEventID and newEventID to check that we haven't missed any messages or this isn't a duplicate message.
type Receipt ¶
type Receipt struct {
// contains filtered or unexported fields
}
An Receipt contains the NIDs of a call to GetNextTransactionPDUs/EDUs. We don't actually export the NIDs but we need the caller to be able to pass them back so that we can clean up if the transaction sends successfully.