database

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MPL-2.0 Imports: 23 Imported by: 38

Documentation

Index

Constants

View Source
const (
	DisappearingTypeNone      = event.DisappearingTypeNone
	DisappearingTypeAfterRead = event.DisappearingTypeAfterRead
	DisappearingTypeAfterSend = event.DisappearingTypeAfterSend
)

Deprecated: use constants in event package

View Source
const FakeMXIDPrefix = "~fake:"
View Source
const NetworkTxnMXIDPrefix = TxnMXIDPrefix + "network:"
View Source
const RandomTxnMXIDPrefix = TxnMXIDPrefix + "random:"
View Source
const TxnMXIDPrefix = "~txn:"
View Source
const UnfinishedBackfillBackoff = 1 * time.Hour

Variables

View Source
var BackfillNextDispatchNever = time.Unix(0, (1<<63)-1)

Functions

This section is empty.

Types

type BackfillTask added in v0.20.0

type BackfillTask struct {
	BridgeID    networkid.BridgeID
	PortalKey   networkid.PortalKey
	UserLoginID networkid.UserLoginID

	BatchCount        int
	IsDone            bool
	QueueDone         bool
	Cursor            networkid.PaginationCursor
	OldestMessageID   networkid.MessageID
	DispatchedAt      time.Time
	CompletedAt       time.Time
	NextDispatchMinTS time.Time

	FromQueue bool
}

func (*BackfillTask) Scan added in v0.20.0

func (bt *BackfillTask) Scan(row dbutil.Scannable) (*BackfillTask, error)

type BackfillTaskQuery added in v0.20.0

type BackfillTaskQuery struct {
	BridgeID networkid.BridgeID
	*dbutil.QueryHelper[*BackfillTask]
}

func (*BackfillTaskQuery) Delete added in v0.20.0

func (btq *BackfillTaskQuery) Delete(ctx context.Context, portalKey networkid.PortalKey) error

func (*BackfillTaskQuery) EnsureExists added in v0.20.0

func (btq *BackfillTaskQuery) EnsureExists(ctx context.Context, portal networkid.PortalKey, loginID networkid.UserLoginID) error

func (*BackfillTaskQuery) GetNext added in v0.20.0

func (btq *BackfillTaskQuery) GetNext(ctx context.Context) (*BackfillTask, error)

func (*BackfillTaskQuery) GetNextForPortal added in v0.23.2

func (btq *BackfillTaskQuery) GetNextForPortal(ctx context.Context, portalKey networkid.PortalKey, allowCompletedTask bool) (*BackfillTask, error)

func (*BackfillTaskQuery) MarkDispatched added in v0.20.0

func (btq *BackfillTaskQuery) MarkDispatched(ctx context.Context, bq *BackfillTask) error

func (*BackfillTaskQuery) MarkNotDone added in v0.25.0

func (btq *BackfillTaskQuery) MarkNotDone(ctx context.Context, portalKey networkid.PortalKey, userLoginID networkid.UserLoginID) error

func (*BackfillTaskQuery) Update added in v0.20.0

func (btq *BackfillTaskQuery) Update(ctx context.Context, bq *BackfillTask) error

func (*BackfillTaskQuery) Upsert added in v0.20.0

func (btq *BackfillTaskQuery) Upsert(ctx context.Context, bq *BackfillTask) error

type CapStateFlags added in v0.25.1

type CapStateFlags uint32
const (
	CapStateFlagDisappearingTimerSet CapStateFlags = 1 << iota
)

func (CapStateFlags) Has added in v0.25.1

func (csf CapStateFlags) Has(flag CapStateFlags) bool

type CapabilityState added in v0.23.0

type CapabilityState struct {
	Source networkid.UserLoginID `json:"source"`
	ID     string                `json:"id"`
	Flags  CapStateFlags         `json:"flags"`
}

type Database

type Database struct {
	*dbutil.Database

	BridgeID            networkid.BridgeID
	Portal              *PortalQuery
	Ghost               *GhostQuery
	Message             *MessageQuery
	DisappearingMessage *DisappearingMessageQuery
	Reaction            *ReactionQuery
	User                *UserQuery
	UserLogin           *UserLoginQuery
	UserPortal          *UserPortalQuery
	BackfillTask        *BackfillTaskQuery
	KV                  *KVQuery
	PublicMedia         *PublicMediaQuery
}

func New

func New(bridgeID networkid.BridgeID, mt MetaTypes, db *dbutil.Database) *Database

type DisappearingMessage

type DisappearingMessage struct {
	BridgeID  networkid.BridgeID
	RoomID    id.RoomID
	EventID   id.EventID
	Timestamp time.Time
	DisappearingSetting
}

func (*DisappearingMessage) Scan

type DisappearingMessageQuery

type DisappearingMessageQuery struct {
	BridgeID networkid.BridgeID
	*dbutil.QueryHelper[*DisappearingMessage]
}

func (*DisappearingMessageQuery) Delete

func (dmq *DisappearingMessageQuery) Delete(ctx context.Context, eventID id.EventID) error

func (*DisappearingMessageQuery) GetUpcoming

func (dmq *DisappearingMessageQuery) GetUpcoming(ctx context.Context, duration time.Duration, limit int) ([]*DisappearingMessage, error)

func (*DisappearingMessageQuery) Put

func (*DisappearingMessageQuery) StartAllBefore added in v0.26.0

func (dmq *DisappearingMessageQuery) StartAllBefore(ctx context.Context, roomID id.RoomID, beforeTS time.Time) ([]*DisappearingMessage, error)

type DisappearingSetting

type DisappearingSetting struct {
	Type        event.DisappearingType
	Timer       time.Duration
	DisappearAt time.Time
}

DisappearingSetting represents a disappearing message timer setting by combining a type with a timer and an optional start timestamp.

func DisappearingSettingFromEvent added in v0.26.0

func DisappearingSettingFromEvent(evt *event.BeeperDisappearingTimer) DisappearingSetting

func (DisappearingSetting) Normalize added in v0.25.1

func (DisappearingSetting) StartingAt added in v0.25.1

func (ds DisappearingSetting) StartingAt(start time.Time) DisappearingSetting

func (DisappearingSetting) ToEventContent added in v0.25.1

func (ds DisappearingSetting) ToEventContent() *event.BeeperDisappearingTimer

type DisappearingType deprecated

type DisappearingType = event.DisappearingType

Deprecated: use event.DisappearingType

type ExtraProfile added in v0.26.4

type ExtraProfile map[string]json.RawMessage

func (*ExtraProfile) CopyTo added in v0.26.4

func (ep *ExtraProfile) CopyTo(dest *ExtraProfile) (changed bool)

func (*ExtraProfile) Set added in v0.26.4

func (ep *ExtraProfile) Set(key string, value any) error

func (*ExtraProfile) With added in v0.26.4

func (ep *ExtraProfile) With(key string, value any) *ExtraProfile

type Ghost

type Ghost struct {
	BridgeID networkid.BridgeID
	ID       networkid.UserID

	Name           string
	AvatarID       networkid.AvatarID
	AvatarHash     [32]byte
	AvatarMXC      id.ContentURIString
	NameSet        bool
	AvatarSet      bool
	ContactInfoSet bool
	IsBot          bool
	Identifiers    []string
	ExtraProfile   ExtraProfile
	Metadata       any
}

func (*Ghost) Scan

func (g *Ghost) Scan(row dbutil.Scannable) (*Ghost, error)

type GhostQuery

type GhostQuery struct {
	BridgeID networkid.BridgeID
	MetaType MetaTypeCreator
	*dbutil.QueryHelper[*Ghost]
}

func (*GhostQuery) GetByID

func (gq *GhostQuery) GetByID(ctx context.Context, id networkid.UserID) (*Ghost, error)

func (*GhostQuery) GetByMetadata added in v0.20.0

func (gq *GhostQuery) GetByMetadata(ctx context.Context, key string, value any) ([]*Ghost, error)

GetByMetadata returns the ghosts whose metadata field at the given JSON key matches the given value.

func (*GhostQuery) Insert

func (gq *GhostQuery) Insert(ctx context.Context, ghost *Ghost) error

func (*GhostQuery) Update

func (gq *GhostQuery) Update(ctx context.Context, ghost *Ghost) error

type KVQuery added in v0.21.0

type KVQuery struct {
	BridgeID networkid.BridgeID
	*dbutil.Database
}

func (*KVQuery) Get added in v0.21.0

func (kvq *KVQuery) Get(ctx context.Context, key Key) string

func (*KVQuery) Set added in v0.21.0

func (kvq *KVQuery) Set(ctx context.Context, key Key, value string)

type Key added in v0.21.0

type Key string
const (
	KeySplitPortalsEnabled     Key = "split_portals_enabled"
	KeyBridgeInfoVersion       Key = "bridge_info_version"
	KeyEncryptionStateResynced Key = "encryption_state_resynced"
	KeyRecoveryKey             Key = "recovery_key"
)

type Message

type Message struct {
	RowID    int64
	BridgeID networkid.BridgeID
	ID       networkid.MessageID
	PartID   networkid.PartID
	MXID     id.EventID

	Room             networkid.PortalKey
	SenderID         networkid.UserID
	SenderMXID       id.UserID
	Timestamp        time.Time
	EditCount        int
	IsDoublePuppeted bool

	ThreadRoot networkid.MessageID
	ReplyTo    networkid.MessageOptionalPartID

	SendTxnID networkid.RawTransactionID

	Metadata any
}

func (*Message) HasFakeMXID added in v0.20.0

func (m *Message) HasFakeMXID() bool

func (*Message) Scan

func (m *Message) Scan(row dbutil.Scannable) (*Message, error)

func (*Message) SetFakeMXID added in v0.20.0

func (m *Message) SetFakeMXID()

type MessageQuery

type MessageQuery struct {
	BridgeID networkid.BridgeID
	MetaType MetaTypeCreator
	*dbutil.QueryHelper[*Message]
	// contains filtered or unexported fields
}

func (*MessageQuery) CountMessagesInPortal added in v0.20.0

func (mq *MessageQuery) CountMessagesInPortal(ctx context.Context, key networkid.PortalKey) (count int, err error)

func (*MessageQuery) Delete

func (mq *MessageQuery) Delete(ctx context.Context, rowID int64) error

func (*MessageQuery) DeleteAllParts

func (mq *MessageQuery) DeleteAllParts(ctx context.Context, receiver networkid.UserLoginID, id networkid.MessageID) error

func (*MessageQuery) DeleteInChunks added in v0.26.2

func (mq *MessageQuery) DeleteInChunks(ctx context.Context, portal networkid.PortalKey) error

func (*MessageQuery) GetAllPartsByID

func (mq *MessageQuery) GetAllPartsByID(ctx context.Context, receiver networkid.UserLoginID, id networkid.MessageID) ([]*Message, error)

func (*MessageQuery) GetByRowID

func (mq *MessageQuery) GetByRowID(ctx context.Context, rowID int64) (*Message, error)

func (*MessageQuery) GetFirstOrSpecificPartByID

func (mq *MessageQuery) GetFirstOrSpecificPartByID(ctx context.Context, receiver networkid.UserLoginID, id networkid.MessageOptionalPartID) (*Message, error)

func (*MessageQuery) GetFirstPartByID

func (mq *MessageQuery) GetFirstPartByID(ctx context.Context, receiver networkid.UserLoginID, id networkid.MessageID) (*Message, error)

func (*MessageQuery) GetFirstPortalMessage added in v0.20.0

func (mq *MessageQuery) GetFirstPortalMessage(ctx context.Context, portal networkid.PortalKey) (*Message, error)

func (*MessageQuery) GetFirstThreadMessage

func (mq *MessageQuery) GetFirstThreadMessage(ctx context.Context, portal networkid.PortalKey, threadRoot networkid.MessageID) (*Message, error)

func (*MessageQuery) GetLastNInPortal added in v0.22.0

func (mq *MessageQuery) GetLastNInPortal(ctx context.Context, portal networkid.PortalKey, n int) ([]*Message, error)

func (*MessageQuery) GetLastNonFakePartAtOrBeforeTime added in v0.24.0

func (mq *MessageQuery) GetLastNonFakePartAtOrBeforeTime(ctx context.Context, portal networkid.PortalKey, maxTS time.Time) (*Message, error)

func (*MessageQuery) GetLastPartAtOrBeforeTime

func (mq *MessageQuery) GetLastPartAtOrBeforeTime(ctx context.Context, portal networkid.PortalKey, maxTS time.Time) (*Message, error)

func (*MessageQuery) GetLastPartByID

func (mq *MessageQuery) GetLastPartByID(ctx context.Context, receiver networkid.UserLoginID, id networkid.MessageID) (*Message, error)

func (*MessageQuery) GetLastThreadMessage

func (mq *MessageQuery) GetLastThreadMessage(ctx context.Context, portal networkid.PortalKey, threadRoot networkid.MessageID) (*Message, error)

func (*MessageQuery) GetMessagesBetweenTimeQuery

func (mq *MessageQuery) GetMessagesBetweenTimeQuery(ctx context.Context, portal networkid.PortalKey, start, end time.Time) ([]*Message, error)

func (*MessageQuery) GetPartByID

func (mq *MessageQuery) GetPartByID(ctx context.Context, receiver networkid.UserLoginID, id networkid.MessageID, partID networkid.PartID) (*Message, error)

func (*MessageQuery) GetPartByMXID

func (mq *MessageQuery) GetPartByMXID(ctx context.Context, mxid id.EventID) (*Message, error)

func (*MessageQuery) GetPartByTxnID added in v0.24.0

func (mq *MessageQuery) GetPartByTxnID(ctx context.Context, receiver networkid.UserLoginID, mxid id.EventID, txnID networkid.RawTransactionID) (*Message, error)

func (*MessageQuery) Insert

func (mq *MessageQuery) Insert(ctx context.Context, msg *Message) error

func (*MessageQuery) Update

func (mq *MessageQuery) Update(ctx context.Context, msg *Message) error

type MetaMerger

type MetaMerger interface {
	CopyFrom(other any)
}

type MetaTypeCreator

type MetaTypeCreator func() any

type MetaTypes

type MetaTypes struct {
	Portal    MetaTypeCreator
	Ghost     MetaTypeCreator
	Message   MetaTypeCreator
	Reaction  MetaTypeCreator
	UserLogin MetaTypeCreator
}

type Portal

type Portal struct {
	BridgeID networkid.BridgeID
	networkid.PortalKey
	MXID id.RoomID

	ParentKey      networkid.PortalKey
	RelayLoginID   networkid.UserLoginID
	OtherUserID    networkid.UserID
	Name           string
	Topic          string
	AvatarID       networkid.AvatarID
	AvatarHash     [32]byte
	AvatarMXC      id.ContentURIString
	NameSet        bool
	TopicSet       bool
	AvatarSet      bool
	NameIsCustom   bool
	InSpace        bool
	MessageRequest bool
	RoomType       RoomType
	Disappear      DisappearingSetting
	CapState       CapabilityState
	Metadata       any
}

func (*Portal) Scan

func (p *Portal) Scan(row dbutil.Scannable) (*Portal, error)

type PortalQuery

type PortalQuery struct {
	BridgeID networkid.BridgeID
	MetaType MetaTypeCreator
	*dbutil.QueryHelper[*Portal]
}

func (*PortalQuery) Delete

func (pq *PortalQuery) Delete(ctx context.Context, key networkid.PortalKey) error

func (*PortalQuery) FindReceiver

func (pq *PortalQuery) FindReceiver(ctx context.Context, id networkid.PortalID, maybeReceiver networkid.UserLoginID) (key networkid.PortalKey, err error)

func (*PortalQuery) FixParentsAfterSplitPortalMigration added in v0.25.2

func (pq *PortalQuery) FixParentsAfterSplitPortalMigration(ctx context.Context) (int64, error)

func (*PortalQuery) GetAll added in v0.20.0

func (pq *PortalQuery) GetAll(ctx context.Context) ([]*Portal, error)

func (*PortalQuery) GetAllDMsWith added in v0.20.0

func (pq *PortalQuery) GetAllDMsWith(ctx context.Context, otherUserID networkid.UserID) ([]*Portal, error)

func (*PortalQuery) GetAllWithMXID

func (pq *PortalQuery) GetAllWithMXID(ctx context.Context) ([]*Portal, error)

func (*PortalQuery) GetAllWithoutReceiver added in v0.25.2

func (pq *PortalQuery) GetAllWithoutReceiver(ctx context.Context) ([]*Portal, error)

func (*PortalQuery) GetByIDWithUncertainReceiver

func (pq *PortalQuery) GetByIDWithUncertainReceiver(ctx context.Context, key networkid.PortalKey) (*Portal, error)

func (*PortalQuery) GetByKey

func (pq *PortalQuery) GetByKey(ctx context.Context, key networkid.PortalKey) (*Portal, error)

func (*PortalQuery) GetByMXID

func (pq *PortalQuery) GetByMXID(ctx context.Context, mxid id.RoomID) (*Portal, error)

func (*PortalQuery) GetChildren

func (pq *PortalQuery) GetChildren(ctx context.Context, parentKey networkid.PortalKey) ([]*Portal, error)

func (*PortalQuery) GetDM added in v0.26.0

func (pq *PortalQuery) GetDM(ctx context.Context, receiver networkid.UserLoginID, otherUserID networkid.UserID) (*Portal, error)

func (*PortalQuery) Insert

func (pq *PortalQuery) Insert(ctx context.Context, p *Portal) error

func (*PortalQuery) MigrateToSplitPortals added in v0.21.0

func (pq *PortalQuery) MigrateToSplitPortals(ctx context.Context) (int64, error)

func (*PortalQuery) ReID

func (pq *PortalQuery) ReID(ctx context.Context, oldID, newID networkid.PortalKey) error

func (*PortalQuery) Update

func (pq *PortalQuery) Update(ctx context.Context, p *Portal) error

type PublicMedia added in v0.26.0

type PublicMedia struct {
	BridgeID networkid.BridgeID
	PublicID string
	MXC      id.ContentURI
	Keys     *attachment.EncryptedFile
	MimeType string
	Expiry   time.Time
}

func (*PublicMedia) Scan added in v0.26.0

func (pm *PublicMedia) Scan(row dbutil.Scannable) (*PublicMedia, error)

type PublicMediaQuery added in v0.26.0

type PublicMediaQuery struct {
	BridgeID networkid.BridgeID
	*dbutil.QueryHelper[*PublicMedia]
}

func (*PublicMediaQuery) Get added in v0.26.0

func (pmq *PublicMediaQuery) Get(ctx context.Context, publicID string) (*PublicMedia, error)

func (*PublicMediaQuery) Put added in v0.26.0

func (pmq *PublicMediaQuery) Put(ctx context.Context, pm *PublicMedia) error

type Reaction

type Reaction struct {
	BridgeID      networkid.BridgeID
	Room          networkid.PortalKey
	MessageID     networkid.MessageID
	MessagePartID networkid.PartID
	SenderID      networkid.UserID
	SenderMXID    id.UserID
	EmojiID       networkid.EmojiID
	MXID          id.EventID

	Timestamp time.Time
	Emoji     string
	Metadata  any
}

func (*Reaction) Scan

func (r *Reaction) Scan(row dbutil.Scannable) (*Reaction, error)

type ReactionQuery

type ReactionQuery struct {
	BridgeID networkid.BridgeID
	MetaType MetaTypeCreator
	*dbutil.QueryHelper[*Reaction]
}

func (*ReactionQuery) Delete

func (rq *ReactionQuery) Delete(ctx context.Context, reaction *Reaction) error

func (*ReactionQuery) GetAllToMessage

func (rq *ReactionQuery) GetAllToMessage(ctx context.Context, receiver networkid.UserLoginID, messageID networkid.MessageID) ([]*Reaction, error)

func (*ReactionQuery) GetAllToMessageBySender

func (rq *ReactionQuery) GetAllToMessageBySender(ctx context.Context, receiver networkid.UserLoginID, messageID networkid.MessageID, senderID networkid.UserID) ([]*Reaction, error)

func (*ReactionQuery) GetAllToMessagePart added in v0.20.0

func (rq *ReactionQuery) GetAllToMessagePart(ctx context.Context, receiver networkid.UserLoginID, messageID networkid.MessageID, partID networkid.PartID) ([]*Reaction, error)

func (*ReactionQuery) GetByID

func (rq *ReactionQuery) GetByID(ctx context.Context, receiver networkid.UserLoginID, messageID networkid.MessageID, messagePartID networkid.PartID, senderID networkid.UserID, emojiID networkid.EmojiID) (*Reaction, error)

func (*ReactionQuery) GetByIDWithoutMessagePart

func (rq *ReactionQuery) GetByIDWithoutMessagePart(ctx context.Context, receiver networkid.UserLoginID, messageID networkid.MessageID, senderID networkid.UserID, emojiID networkid.EmojiID) (*Reaction, error)

func (*ReactionQuery) GetByMXID

func (rq *ReactionQuery) GetByMXID(ctx context.Context, mxid id.EventID) (*Reaction, error)

func (*ReactionQuery) Upsert

func (rq *ReactionQuery) Upsert(ctx context.Context, reaction *Reaction) error

type RoomType

type RoomType string
const (
	RoomTypeDefault RoomType = ""
	RoomTypeDM      RoomType = "dm"
	RoomTypeGroupDM RoomType = "group_dm"
	RoomTypeSpace   RoomType = "space"
)

type User

type User struct {
	BridgeID networkid.BridgeID
	MXID     id.UserID

	ManagementRoom id.RoomID
	AccessToken    string
}

func (*User) Scan

func (u *User) Scan(row dbutil.Scannable) (*User, error)

type UserLogin

type UserLogin struct {
	BridgeID      networkid.BridgeID
	UserMXID      id.UserID
	ID            networkid.UserLoginID
	RemoteName    string
	RemoteProfile status.RemoteProfile
	SpaceRoom     id.RoomID
	Metadata      any
}

func (*UserLogin) Scan

func (u *UserLogin) Scan(row dbutil.Scannable) (*UserLogin, error)

type UserLoginQuery

type UserLoginQuery struct {
	BridgeID networkid.BridgeID
	MetaType MetaTypeCreator
	*dbutil.QueryHelper[*UserLogin]
}

func (*UserLoginQuery) Delete

func (uq *UserLoginQuery) Delete(ctx context.Context, loginID networkid.UserLoginID) error

func (*UserLoginQuery) GetAllForUser

func (uq *UserLoginQuery) GetAllForUser(ctx context.Context, userID id.UserID) ([]*UserLogin, error)

func (*UserLoginQuery) GetAllInPortal

func (uq *UserLoginQuery) GetAllInPortal(ctx context.Context, portal networkid.PortalKey) ([]*UserLogin, error)

func (*UserLoginQuery) GetAllUserIDsWithLogins

func (uq *UserLoginQuery) GetAllUserIDsWithLogins(ctx context.Context) ([]id.UserID, error)

func (*UserLoginQuery) GetByID

func (*UserLoginQuery) Insert

func (uq *UserLoginQuery) Insert(ctx context.Context, login *UserLogin) error

func (*UserLoginQuery) Update

func (uq *UserLoginQuery) Update(ctx context.Context, login *UserLogin) error

type UserPortal

type UserPortal struct {
	BridgeID  networkid.BridgeID
	UserMXID  id.UserID
	LoginID   networkid.UserLoginID
	Portal    networkid.PortalKey
	InSpace   *bool
	Preferred *bool
	LastRead  time.Time
}

func UserPortalFor

func UserPortalFor(ul *UserLogin, portal networkid.PortalKey) *UserPortal

func (*UserPortal) CopyWithoutValues

func (up *UserPortal) CopyWithoutValues() *UserPortal

func (*UserPortal) Scan

func (up *UserPortal) Scan(row dbutil.Scannable) (*UserPortal, error)

type UserPortalQuery

type UserPortalQuery struct {
	BridgeID networkid.BridgeID
	*dbutil.QueryHelper[*UserPortal]
}

func (*UserPortalQuery) Delete added in v0.20.0

func (upq *UserPortalQuery) Delete(ctx context.Context, up *UserPortal) error

func (*UserPortalQuery) Get

func (upq *UserPortalQuery) Get(ctx context.Context, login *UserLogin, portal networkid.PortalKey) (*UserPortal, error)

func (*UserPortalQuery) GetAllForLogin

func (upq *UserPortalQuery) GetAllForLogin(ctx context.Context, login *UserLogin) ([]*UserPortal, error)

func (*UserPortalQuery) GetAllForUserInPortal

func (upq *UserPortalQuery) GetAllForUserInPortal(ctx context.Context, userID id.UserID, portal networkid.PortalKey) ([]*UserPortal, error)

func (*UserPortalQuery) GetAllInPortal

func (upq *UserPortalQuery) GetAllInPortal(ctx context.Context, portal networkid.PortalKey) ([]*UserPortal, error)

func (*UserPortalQuery) GetOrCreate

func (upq *UserPortalQuery) GetOrCreate(ctx context.Context, login *UserLogin, portal networkid.PortalKey) (*UserPortal, error)

func (*UserPortalQuery) MarkAllNotInSpace added in v0.25.0

func (upq *UserPortalQuery) MarkAllNotInSpace(ctx context.Context, portal networkid.PortalKey) error

func (*UserPortalQuery) MarkAsPreferred

func (upq *UserPortalQuery) MarkAsPreferred(ctx context.Context, login *UserLogin, portal networkid.PortalKey) error

func (*UserPortalQuery) Put

func (upq *UserPortalQuery) Put(ctx context.Context, up *UserPortal) error

type UserQuery

type UserQuery struct {
	BridgeID networkid.BridgeID
	*dbutil.QueryHelper[*User]
}

func (*UserQuery) GetByMXID

func (uq *UserQuery) GetByMXID(ctx context.Context, userID id.UserID) (*User, error)

func (*UserQuery) Insert

func (uq *UserQuery) Insert(ctx context.Context, user *User) error

func (*UserQuery) Update

func (uq *UserQuery) Update(ctx context.Context, user *User) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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