Documentation ¶
Index ¶
- type Database
- func (d *Database) ClaimKeys(ctx context.Context, userToDeviceToAlgorithm map[string]map[string]string) ([]api.OneTimeKeys, error)
- func (d *Database) DeviceKeysForUser(ctx context.Context, userID string, deviceIDs []string) ([]api.DeviceMessage, error)
- func (d *Database) DeviceKeysJSON(ctx context.Context, keys []api.DeviceMessage) error
- func (d *Database) ExistingOneTimeKeys(ctx context.Context, userID, deviceID string, keyIDsWithAlgorithms []string) (map[string]json.RawMessage, error)
- func (d *Database) KeyChanges(ctx context.Context, partition int32, fromOffset, toOffset int64) (userIDs []string, latestOffset int64, err error)
- func (d *Database) MarkDeviceListStale(ctx context.Context, userID string, isStale bool) error
- func (d *Database) OneTimeKeysCount(ctx context.Context, userID, deviceID string) (*api.OneTimeKeysCount, error)
- func (d *Database) PrevIDsExists(ctx context.Context, userID string, prevIDs []int) (bool, error)
- func (d *Database) StaleDeviceLists(ctx context.Context, domains []gomatrixserverlib.ServerName) ([]string, error)
- func (d *Database) StoreKeyChange(ctx context.Context, partition int32, offset int64, userID string) error
- func (d *Database) StoreLocalDeviceKeys(ctx context.Context, keys []api.DeviceMessage) error
- func (d *Database) StoreOneTimeKeys(ctx context.Context, keys api.OneTimeKeys) (counts *api.OneTimeKeysCount, err error)
- func (d *Database) StoreRemoteDeviceKeys(ctx context.Context, keys []api.DeviceMessage, clearUserIDs []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct { DB *sql.DB Writer sqlutil.Writer OneTimeKeysTable tables.OneTimeKeys DeviceKeysTable tables.DeviceKeys KeyChangesTable tables.KeyChanges StaleDeviceListsTable tables.StaleDeviceLists }
func (*Database) DeviceKeysForUser ¶
func (*Database) DeviceKeysJSON ¶
func (*Database) ExistingOneTimeKeys ¶
func (*Database) KeyChanges ¶
func (*Database) MarkDeviceListStale ¶
MarkDeviceListStale sets the stale bit for this user to isStale.
func (*Database) OneTimeKeysCount ¶
func (*Database) PrevIDsExists ¶
func (*Database) StaleDeviceLists ¶
func (d *Database) StaleDeviceLists(ctx context.Context, domains []gomatrixserverlib.ServerName) ([]string, error)
StaleDeviceLists returns a list of user IDs ending with the domains provided who have stale device lists. If no domains are given, all user IDs with stale device lists are returned.
func (*Database) StoreKeyChange ¶
func (*Database) StoreLocalDeviceKeys ¶
func (*Database) StoreOneTimeKeys ¶
func (d *Database) StoreOneTimeKeys(ctx context.Context, keys api.OneTimeKeys) (counts *api.OneTimeKeysCount, err error)
func (*Database) StoreRemoteDeviceKeys ¶
Click to show internal directories.
Click to hide internal directories.