shared

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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) ClaimKeys

func (d *Database) ClaimKeys(ctx context.Context, userToDeviceToAlgorithm map[string]map[string]string) ([]api.OneTimeKeys, error)

func (*Database) DeviceKeysForUser

func (d *Database) DeviceKeysForUser(ctx context.Context, userID string, deviceIDs []string) ([]api.DeviceMessage, error)

func (*Database) DeviceKeysJSON

func (d *Database) DeviceKeysJSON(ctx context.Context, keys []api.DeviceMessage) error

func (*Database) ExistingOneTimeKeys

func (d *Database) ExistingOneTimeKeys(ctx context.Context, userID, deviceID string, keyIDsWithAlgorithms []string) (map[string]json.RawMessage, error)

func (*Database) KeyChanges

func (d *Database) KeyChanges(ctx context.Context, partition int32, fromOffset, toOffset int64) (userIDs []string, latestOffset int64, err error)

func (*Database) MarkDeviceListStale

func (d *Database) MarkDeviceListStale(ctx context.Context, userID string, isStale bool) error

MarkDeviceListStale sets the stale bit for this user to isStale.

func (*Database) OneTimeKeysCount

func (d *Database) OneTimeKeysCount(ctx context.Context, userID, deviceID string) (*api.OneTimeKeysCount, error)

func (*Database) PrevIDsExists

func (d *Database) PrevIDsExists(ctx context.Context, userID string, prevIDs []int) (bool, error)

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 (d *Database) StoreKeyChange(ctx context.Context, partition int32, offset int64, userID string) error

func (*Database) StoreLocalDeviceKeys

func (d *Database) StoreLocalDeviceKeys(ctx context.Context, keys []api.DeviceMessage) error

func (*Database) StoreOneTimeKeys

func (d *Database) StoreOneTimeKeys(ctx context.Context, keys api.OneTimeKeys) (counts *api.OneTimeKeysCount, err error)

func (*Database) StoreRemoteDeviceKeys

func (d *Database) StoreRemoteDeviceKeys(ctx context.Context, keys []api.DeviceMessage, clearUserIDs []string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL