Documentation ¶
Index ¶
- type Database
- func (d *Database) ClaimKeys(ctx context.Context, userToDeviceToAlgorithm map[string]map[string]string) ([]api.OneTimeKeys, error)
- func (d *Database) CrossSigningKeysDataForUser(ctx context.Context, userID string) (types.CrossSigningKeyMap, error)
- func (d *Database) CrossSigningKeysForUser(ctx context.Context, userID string) (map[gomatrixserverlib.CrossSigningKeyPurpose]gomatrixserverlib.CrossSigningKey, ...)
- func (d *Database) CrossSigningSigsForTarget(ctx context.Context, originUserID, targetUserID string, ...) (types.CrossSigningSigMap, error)
- func (d *Database) DeleteDeviceKeys(ctx context.Context, userID string, deviceIDs []gomatrixserverlib.KeyID) error
- func (d *Database) DeviceKeysForUser(ctx context.Context, userID string, deviceIDs []string, includeEmpty bool) ([]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, 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 []int64) (bool, error)
- func (d *Database) StaleDeviceLists(ctx context.Context, domains []gomatrixserverlib.ServerName) ([]string, error)
- func (d *Database) StoreCrossSigningKeysForUser(ctx context.Context, userID string, keyMap types.CrossSigningKeyMap) error
- func (d *Database) StoreCrossSigningSigsForTarget(ctx context.Context, originUserID string, originKeyID gomatrixserverlib.KeyID, ...) error
- func (d *Database) StoreKeyChange(ctx context.Context, userID string) (id int64, err 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 CrossSigningKeysTable tables.CrossSigningKeys CrossSigningSigsTable tables.CrossSigningSigs }
func (*Database) CrossSigningKeysDataForUser ¶ added in v0.5.0
func (d *Database) CrossSigningKeysDataForUser(ctx context.Context, userID string) (types.CrossSigningKeyMap, error)
CrossSigningKeysForUser returns the latest known cross-signing keys for a user, if any.
func (*Database) CrossSigningKeysForUser ¶ added in v0.5.0
func (d *Database) CrossSigningKeysForUser(ctx context.Context, userID string) (map[gomatrixserverlib.CrossSigningKeyPurpose]gomatrixserverlib.CrossSigningKey, error)
CrossSigningKeysForUser returns the latest known cross-signing keys for a user, if any.
func (*Database) CrossSigningSigsForTarget ¶ added in v0.5.0
func (d *Database) CrossSigningSigsForTarget(ctx context.Context, originUserID, targetUserID string, targetKeyID gomatrixserverlib.KeyID) (types.CrossSigningSigMap, error)
CrossSigningSigsForTarget returns the signatures for a given user's key ID, if any.
func (*Database) DeleteDeviceKeys ¶ added in v0.5.0
func (d *Database) DeleteDeviceKeys(ctx context.Context, userID string, deviceIDs []gomatrixserverlib.KeyID) error
DeleteDeviceKeys removes the device keys for a given user/device, and any accompanying cross-signing signatures relating to that device.
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) StoreCrossSigningKeysForUser ¶ added in v0.5.0
func (d *Database) StoreCrossSigningKeysForUser(ctx context.Context, userID string, keyMap types.CrossSigningKeyMap) error
StoreCrossSigningKeysForUser stores the latest known cross-signing keys for a user.
func (*Database) StoreCrossSigningSigsForTarget ¶ added in v0.5.0
func (d *Database) StoreCrossSigningSigsForTarget( ctx context.Context, originUserID string, originKeyID gomatrixserverlib.KeyID, targetUserID string, targetKeyID gomatrixserverlib.KeyID, signature gomatrixserverlib.Base64Bytes, ) error
StoreCrossSigningSigsForTarget stores a signature for a target user ID and key/dvice.
func (*Database) StoreKeyChange ¶
func (*Database) StoreLocalDeviceKeys ¶
func (*Database) StoreOneTimeKeys ¶
func (d *Database) StoreOneTimeKeys(ctx context.Context, keys api.OneTimeKeys) (counts *api.OneTimeKeysCount, err error)