sqlstatestore

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const VersionTableName = "mx_version"

Variables

View Source
var UpgradeTable dbutil.UpgradeTable

Functions

This section is empty.

Types

type Member added in v0.18.1

type Member struct {
	id.UserID
	event.MemberEventContent
}

type SQLStateStore

type SQLStateStore struct {
	*dbutil.Database
	IsBridge bool
}

func NewSQLStateStore

func NewSQLStateStore(db *dbutil.Database, log dbutil.DatabaseLogger, isBridge bool) *SQLStateStore

func (*SQLStateStore) ClearCachedMembers

func (store *SQLStateStore) ClearCachedMembers(ctx context.Context, roomID id.RoomID, memberships ...event.Membership) error

func (*SQLStateStore) FindSharedRooms

func (store *SQLStateStore) FindSharedRooms(ctx context.Context, userID id.UserID) ([]id.RoomID, error)

func (*SQLStateStore) GetEncryptionEvent

func (store *SQLStateStore) GetEncryptionEvent(ctx context.Context, roomID id.RoomID) (*event.EncryptionEventContent, error)

func (*SQLStateStore) GetMember

func (store *SQLStateStore) GetMember(ctx context.Context, roomID id.RoomID, userID id.UserID) (*event.MemberEventContent, error)

func (*SQLStateStore) GetMembership

func (store *SQLStateStore) GetMembership(ctx context.Context, roomID id.RoomID, userID id.UserID) (membership event.Membership, err error)

func (*SQLStateStore) GetPowerLevel

func (store *SQLStateStore) GetPowerLevel(ctx context.Context, roomID id.RoomID, userID id.UserID) (int, error)

func (*SQLStateStore) GetPowerLevelRequirement

func (store *SQLStateStore) GetPowerLevelRequirement(ctx context.Context, roomID id.RoomID, eventType event.Type) (int, error)

func (*SQLStateStore) GetPowerLevels

func (store *SQLStateStore) GetPowerLevels(ctx context.Context, roomID id.RoomID) (levels *event.PowerLevelsEventContent, err error)

func (*SQLStateStore) GetRoomJoinedOrInvitedMembers

func (store *SQLStateStore) GetRoomJoinedOrInvitedMembers(ctx context.Context, roomID id.RoomID) (members []id.UserID, err error)

func (*SQLStateStore) GetRoomMembers

func (store *SQLStateStore) GetRoomMembers(ctx context.Context, roomID id.RoomID, memberships ...event.Membership) (map[id.UserID]*event.MemberEventContent, error)

func (*SQLStateStore) HasPowerLevel

func (store *SQLStateStore) HasPowerLevel(ctx context.Context, roomID id.RoomID, userID id.UserID, eventType event.Type) (bool, error)

func (*SQLStateStore) IsEncrypted

func (store *SQLStateStore) IsEncrypted(ctx context.Context, roomID id.RoomID) (bool, error)

func (*SQLStateStore) IsInRoom

func (store *SQLStateStore) IsInRoom(ctx context.Context, roomID id.RoomID, userID id.UserID) bool

func (*SQLStateStore) IsInvited

func (store *SQLStateStore) IsInvited(ctx context.Context, roomID id.RoomID, userID id.UserID) bool

func (*SQLStateStore) IsMembership

func (store *SQLStateStore) IsMembership(ctx context.Context, roomID id.RoomID, userID id.UserID, allowedMemberships ...event.Membership) bool

func (*SQLStateStore) IsRegistered

func (store *SQLStateStore) IsRegistered(ctx context.Context, userID id.UserID) (bool, error)

func (*SQLStateStore) MarkRegistered

func (store *SQLStateStore) MarkRegistered(ctx context.Context, userID id.UserID) error

func (*SQLStateStore) SetEncryptionEvent

func (store *SQLStateStore) SetEncryptionEvent(ctx context.Context, roomID id.RoomID, content *event.EncryptionEventContent) error

func (*SQLStateStore) SetMember

func (store *SQLStateStore) SetMember(ctx context.Context, roomID id.RoomID, userID id.UserID, member *event.MemberEventContent) error

func (*SQLStateStore) SetMembership

func (store *SQLStateStore) SetMembership(ctx context.Context, roomID id.RoomID, userID id.UserID, membership event.Membership) error

func (*SQLStateStore) SetPowerLevels

func (store *SQLStateStore) SetPowerLevels(ctx context.Context, roomID id.RoomID, levels *event.PowerLevelsEventContent) error

func (*SQLStateStore) TryGetMember

func (store *SQLStateStore) TryGetMember(ctx context.Context, roomID id.RoomID, userID id.UserID) (*event.MemberEventContent, error)

Jump to

Keyboard shortcuts

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