Versions in this module Expand all Collapse all v0 v0.14.1 Jan 16, 2025 v0.14.0 Dec 18, 2024 Changes in this version + var Err3PIDInUse = errors.New("this third-party identifier is already in use") + type Account interface + CheckAccountAvailability func(ctx context.Context, localpart string, serverName spec.ServerName) (bool, error) + CreateAccount func(ctx context.Context, localpart string, serverName spec.ServerName, ...) (*api.Account, error) + DeactivateAccount func(ctx context.Context, localpart string, serverName spec.ServerName) (err error) + GetAccountByLocalpart func(ctx context.Context, localpart string, serverName spec.ServerName) (*api.Account, error) + GetAccountByPassword func(ctx context.Context, localpart string, serverName spec.ServerName, ...) (*api.Account, error) + GetNewNumericLocalpart func(ctx context.Context, serverName spec.ServerName) (int64, error) + SetPassword func(ctx context.Context, localpart string, serverName spec.ServerName, ...) error + type AccountData interface + GetAccountData func(ctx context.Context, localpart string, serverName spec.ServerName) (global map[string]json.RawMessage, rooms map[string]map[string]json.RawMessage, ...) + GetAccountDataByType func(ctx context.Context, localpart string, serverName spec.ServerName, ...) (data json.RawMessage, err error) + QueryPushRules func(ctx context.Context, localpart string, serverName spec.ServerName) (*pushrules.AccountRuleSets, error) + SaveAccountData func(ctx context.Context, localpart string, serverName spec.ServerName, ...) error + type Device interface + CreateDevice func(ctx context.Context, localpart string, serverName spec.ServerName, ...) (dev *api.Device, returnErr error) + GetDeviceByAccessToken func(ctx context.Context, token string) (*api.Device, error) + GetDeviceByID func(ctx context.Context, localpart string, serverName spec.ServerName, ...) (*api.Device, error) + GetDevicesByID func(ctx context.Context, deviceIDs []string) ([]api.Device, error) + GetDevicesByLocalpart func(ctx context.Context, localpart string, serverName spec.ServerName) ([]api.Device, error) + RemoveAllDevices func(ctx context.Context, localpart string, serverName spec.ServerName, ...) (devices []api.Device, err error) + RemoveDevices func(ctx context.Context, localpart string, serverName spec.ServerName, ...) error + UpdateDevice func(ctx context.Context, localpart string, serverName spec.ServerName, ...) error + UpdateDeviceLastSeen func(ctx context.Context, localpart string, serverName spec.ServerName, ...) error + type KeyBackup interface + CountBackupKeys func(ctx context.Context, version, userID string) (count int64, err error) + CreateKeyBackup func(ctx context.Context, userID, algorithm string, authData json.RawMessage) (version string, err error) + DeleteKeyBackup func(ctx context.Context, userID, version string) (exists bool, err error) + GetBackupKeys func(ctx context.Context, version, userID, filterRoomID, filterSessionID string) (result map[string]map[string]api.KeyBackupSession, err error) + GetKeyBackup func(ctx context.Context, userID, version string) (versionResult, algorithm string, authData json.RawMessage, etag string, ...) + UpdateKeyBackupAuthData func(ctx context.Context, userID, version string, authData json.RawMessage) (err error) + UpsertBackupKeys func(ctx context.Context, version, userID string, ...) (count int64, etag string, err error) + type KeyChangeDatabase interface + StoreKeyChange func(ctx context.Context, userID string) (int64, error) + type KeyDatabase interface + ClaimKeys func(ctx context.Context, userToDeviceToAlgorithm map[string]map[string]string) ([]api.OneTimeKeys, error) + CrossSigningKeysDataForUser func(ctx context.Context, userID string) (types.CrossSigningKeyMap, error) + CrossSigningKeysForUser func(ctx context.Context, userID string) (map[fclient.CrossSigningKeyPurpose]fclient.CrossSigningKey, error) + CrossSigningSigsForTarget func(ctx context.Context, originUserID, targetUserID string, ...) (types.CrossSigningSigMap, error) + DeleteDeviceKeys func(ctx context.Context, userID string, deviceIDs []gomatrixserverlib.KeyID) error + DeleteFallbackKeys func(ctx context.Context, userID, deviceID string) error + DeleteStaleDeviceLists func(ctx context.Context, userIDs []string) error + DeviceKeysForUser func(ctx context.Context, userID string, deviceIDs []string, includeEmpty bool) ([]api.DeviceMessage, error) + DeviceKeysJSON func(ctx context.Context, keys []api.DeviceMessage) error + ExistingOneTimeKeys func(ctx context.Context, userID, deviceID string, keyIDsWithAlgorithms []string) (map[string]json.RawMessage, error) + KeyChanges func(ctx context.Context, fromOffset, toOffset int64) (userIDs []string, latestOffset int64, err error) + MarkDeviceListStale func(ctx context.Context, userID string, isStale bool) error + OneTimeKeysCount func(ctx context.Context, userID, deviceID string) (*api.OneTimeKeysCount, error) + PrevIDsExists func(ctx context.Context, userID string, prevIDs []int64) (bool, error) + StaleDeviceLists func(ctx context.Context, domains []spec.ServerName) ([]string, error) + StoreCrossSigningKeysForUser func(ctx context.Context, userID string, keyMap types.CrossSigningKeyMap) error + StoreCrossSigningSigsForTarget func(ctx context.Context, originUserID string, originKeyID gomatrixserverlib.KeyID, ...) error + StoreFallbackKeys func(ctx context.Context, keys api.FallbackKeys) ([]string, error) + StoreLocalDeviceKeys func(ctx context.Context, keys []api.DeviceMessage) error + StoreOneTimeKeys func(ctx context.Context, keys api.OneTimeKeys) (*api.OneTimeKeysCount, error) + StoreRemoteDeviceKeys func(ctx context.Context, keys []api.DeviceMessage, clearUserIDs []string) error + UnusedFallbackKeyAlgorithms func(ctx context.Context, userID, deviceID string) ([]string, error) + func NewKeyDatabase(conMan *sqlutil.Connections, dbProperties *config.DatabaseOptions) (KeyDatabase, error) + func NewKeyDatabase(conMan sqlutil.Connections, dbProperties *config.DatabaseOptions) (KeyDatabase, error) + type LoginToken interface + CreateLoginToken func(ctx context.Context, data *api.LoginTokenData) (*api.LoginTokenMetadata, error) + GetLoginTokenDataByToken func(ctx context.Context, token string) (*api.LoginTokenData, error) + RemoveLoginToken func(ctx context.Context, token string) error + type Notification interface + DeleteNotificationsUpTo func(ctx context.Context, localpart string, serverName spec.ServerName, ...) (affected bool, err error) + DeleteOldNotifications func(ctx context.Context) error + GetNotificationCount func(ctx context.Context, localpart string, serverName spec.ServerName, ...) (int64, error) + GetNotifications func(ctx context.Context, localpart string, serverName spec.ServerName, ...) ([]*api.Notification, int64, error) + GetRoomNotificationCounts func(ctx context.Context, localpart string, serverName spec.ServerName, ...) (total int64, highlight int64, _ error) + InsertNotification func(ctx context.Context, localpart string, serverName spec.ServerName, ...) error + SetNotificationsRead func(ctx context.Context, localpart string, serverName spec.ServerName, ...) (affected bool, err error) + type OpenID interface + CreateOpenIDToken func(ctx context.Context, token, userID string) (exp int64, err error) + GetOpenIDTokenAttributes func(ctx context.Context, token string) (*api.OpenIDTokenAttributes, error) + type Profile interface + GetProfileByLocalpart func(ctx context.Context, localpart string, serverName spec.ServerName) (*authtypes.Profile, error) + SearchProfiles func(ctx context.Context, searchString string, limit int) ([]authtypes.Profile, error) + SetAvatarURL func(ctx context.Context, localpart string, serverName spec.ServerName, ...) (*authtypes.Profile, bool, error) + SetDisplayName func(ctx context.Context, localpart string, serverName spec.ServerName, ...) (*authtypes.Profile, bool, error) + type Pusher interface + GetPushers func(ctx context.Context, localpart string, serverName spec.ServerName) ([]api.Pusher, error) + RemovePusher func(ctx context.Context, appid, pushkey, localpart string, ...) error + RemovePushers func(ctx context.Context, appid, pushkey string) error + UpsertPusher func(ctx context.Context, p api.Pusher, localpart string, ...) error + type RegistrationTokens interface + DeleteRegistrationToken func(ctx context.Context, tokenString string) error + GetRegistrationToken func(ctx context.Context, tokenString string) (*clientapi.RegistrationToken, error) + InsertRegistrationToken func(ctx context.Context, registrationToken *clientapi.RegistrationToken) (bool, error) + ListRegistrationTokens func(ctx context.Context, returnAll bool, valid bool) ([]clientapi.RegistrationToken, error) + RegistrationTokenExists func(ctx context.Context, token string) (bool, error) + UpdateRegistrationToken func(ctx context.Context, tokenString string, newAttributes map[string]interface{}) (*clientapi.RegistrationToken, error) + type Statistics interface + DailyRoomsMessages func(ctx context.Context, serverName spec.ServerName) (stats types.MessageStats, activeRooms, activeE2EERooms int64, err error) + UpsertDailyRoomsMessages func(ctx context.Context, serverName spec.ServerName, stats types.MessageStats, ...) error + UserStatistics func(ctx context.Context) (*types.UserStatistics, *types.DatabaseEngine, error) + type ThreePID interface + GetLocalpartForThreePID func(ctx context.Context, threepid string, medium string) (localpart string, serverName spec.ServerName, err error) + GetThreePIDsForLocalpart func(ctx context.Context, localpart string, serverName spec.ServerName) (threepids []authtypes.ThreePID, err error) + RemoveThreePIDAssociation func(ctx context.Context, threepid string, medium string) (err error) + SaveThreePIDAssociation func(ctx context.Context, threepid, localpart string, serverName spec.ServerName, ...) (err error) + type UserDatabase interface + func NewUserDatabase(ctx context.Context, conMan *sqlutil.Connections, ...) (UserDatabase, error) + func NewUserDatabase(ctx context.Context, conMan sqlutil.Connections, ...) (UserDatabase, error)