Documentation
¶
Index ¶
- Constants
- Variables
- type BackfillTask
- type BackfillTaskQuery
- func (btq *BackfillTaskQuery) Delete(ctx context.Context, portalKey networkid.PortalKey) error
- func (btq *BackfillTaskQuery) EnsureExists(ctx context.Context, portal networkid.PortalKey, loginID networkid.UserLoginID) error
- func (btq *BackfillTaskQuery) GetNext(ctx context.Context) (*BackfillTask, error)
- func (btq *BackfillTaskQuery) GetNextForPortal(ctx context.Context, portalKey networkid.PortalKey, allowCompletedTask bool) (*BackfillTask, error)
- func (btq *BackfillTaskQuery) MarkDispatched(ctx context.Context, bq *BackfillTask) error
- func (btq *BackfillTaskQuery) MarkNotDone(ctx context.Context, portalKey networkid.PortalKey, ...) error
- func (btq *BackfillTaskQuery) Update(ctx context.Context, bq *BackfillTask) error
- func (btq *BackfillTaskQuery) Upsert(ctx context.Context, bq *BackfillTask) error
- type CapStateFlags
- type CapabilityState
- type Database
- type DisappearingMessage
- type DisappearingMessageQuery
- func (dmq *DisappearingMessageQuery) Delete(ctx context.Context, eventID id.EventID) error
- func (dmq *DisappearingMessageQuery) GetUpcoming(ctx context.Context, duration time.Duration, limit int) ([]*DisappearingMessage, error)
- func (dmq *DisappearingMessageQuery) Put(ctx context.Context, dm *DisappearingMessage) error
- func (dmq *DisappearingMessageQuery) StartAllBefore(ctx context.Context, roomID id.RoomID, beforeTS time.Time) ([]*DisappearingMessage, error)
- type DisappearingSetting
- type DisappearingTypedeprecated
- type ExtraProfile
- type Ghost
- type GhostQuery
- func (gq *GhostQuery) GetByID(ctx context.Context, id networkid.UserID) (*Ghost, error)
- func (gq *GhostQuery) GetByMetadata(ctx context.Context, key string, value any) ([]*Ghost, error)
- func (gq *GhostQuery) Insert(ctx context.Context, ghost *Ghost) error
- func (gq *GhostQuery) Update(ctx context.Context, ghost *Ghost) error
- type KVQuery
- type Key
- type Message
- type MessageQuery
- func (mq *MessageQuery) CountMessagesInPortal(ctx context.Context, key networkid.PortalKey) (count int, err error)
- func (mq *MessageQuery) Delete(ctx context.Context, rowID int64) error
- func (mq *MessageQuery) DeleteAllParts(ctx context.Context, receiver networkid.UserLoginID, id networkid.MessageID) error
- func (mq *MessageQuery) DeleteInChunks(ctx context.Context, portal networkid.PortalKey) error
- func (mq *MessageQuery) GetAllPartsByID(ctx context.Context, receiver networkid.UserLoginID, id networkid.MessageID) ([]*Message, error)
- func (mq *MessageQuery) GetByRowID(ctx context.Context, rowID int64) (*Message, error)
- func (mq *MessageQuery) GetFirstOrSpecificPartByID(ctx context.Context, receiver networkid.UserLoginID, ...) (*Message, error)
- func (mq *MessageQuery) GetFirstPartByID(ctx context.Context, receiver networkid.UserLoginID, id networkid.MessageID) (*Message, error)
- func (mq *MessageQuery) GetFirstPortalMessage(ctx context.Context, portal networkid.PortalKey) (*Message, error)
- func (mq *MessageQuery) GetFirstThreadMessage(ctx context.Context, portal networkid.PortalKey, ...) (*Message, error)
- func (mq *MessageQuery) GetLastNInPortal(ctx context.Context, portal networkid.PortalKey, n int) ([]*Message, error)
- func (mq *MessageQuery) GetLastNonFakePartAtOrBeforeTime(ctx context.Context, portal networkid.PortalKey, maxTS time.Time) (*Message, error)
- func (mq *MessageQuery) GetLastPartAtOrBeforeTime(ctx context.Context, portal networkid.PortalKey, maxTS time.Time) (*Message, error)
- func (mq *MessageQuery) GetLastPartByID(ctx context.Context, receiver networkid.UserLoginID, id networkid.MessageID) (*Message, error)
- func (mq *MessageQuery) GetLastThreadMessage(ctx context.Context, portal networkid.PortalKey, ...) (*Message, error)
- func (mq *MessageQuery) GetMessagesBetweenTimeQuery(ctx context.Context, portal networkid.PortalKey, start, end time.Time) ([]*Message, error)
- func (mq *MessageQuery) GetPartByID(ctx context.Context, receiver networkid.UserLoginID, id networkid.MessageID, ...) (*Message, error)
- func (mq *MessageQuery) GetPartByMXID(ctx context.Context, mxid id.EventID) (*Message, error)
- func (mq *MessageQuery) GetPartByTxnID(ctx context.Context, receiver networkid.UserLoginID, mxid id.EventID, ...) (*Message, error)
- func (mq *MessageQuery) Insert(ctx context.Context, msg *Message) error
- func (mq *MessageQuery) Update(ctx context.Context, msg *Message) error
- type MetaMerger
- type MetaTypeCreator
- type MetaTypes
- type Portal
- type PortalQuery
- func (pq *PortalQuery) Delete(ctx context.Context, key networkid.PortalKey) error
- func (pq *PortalQuery) FindReceiver(ctx context.Context, id networkid.PortalID, ...) (key networkid.PortalKey, err error)
- func (pq *PortalQuery) FixParentsAfterSplitPortalMigration(ctx context.Context) (int64, error)
- func (pq *PortalQuery) GetAll(ctx context.Context) ([]*Portal, error)
- func (pq *PortalQuery) GetAllDMsWith(ctx context.Context, otherUserID networkid.UserID) ([]*Portal, error)
- func (pq *PortalQuery) GetAllWithMXID(ctx context.Context) ([]*Portal, error)
- func (pq *PortalQuery) GetAllWithoutReceiver(ctx context.Context) ([]*Portal, error)
- func (pq *PortalQuery) GetByIDWithUncertainReceiver(ctx context.Context, key networkid.PortalKey) (*Portal, error)
- func (pq *PortalQuery) GetByKey(ctx context.Context, key networkid.PortalKey) (*Portal, error)
- func (pq *PortalQuery) GetByMXID(ctx context.Context, mxid id.RoomID) (*Portal, error)
- func (pq *PortalQuery) GetChildren(ctx context.Context, parentKey networkid.PortalKey) ([]*Portal, error)
- func (pq *PortalQuery) GetDM(ctx context.Context, receiver networkid.UserLoginID, ...) (*Portal, error)
- func (pq *PortalQuery) Insert(ctx context.Context, p *Portal) error
- func (pq *PortalQuery) MigrateToSplitPortals(ctx context.Context) (int64, error)
- func (pq *PortalQuery) ReID(ctx context.Context, oldID, newID networkid.PortalKey) error
- func (pq *PortalQuery) Update(ctx context.Context, p *Portal) error
- type PublicMedia
- type PublicMediaQuery
- type Reaction
- type ReactionQuery
- func (rq *ReactionQuery) Delete(ctx context.Context, reaction *Reaction) error
- func (rq *ReactionQuery) GetAllToMessage(ctx context.Context, receiver networkid.UserLoginID, ...) ([]*Reaction, error)
- func (rq *ReactionQuery) GetAllToMessageBySender(ctx context.Context, receiver networkid.UserLoginID, ...) ([]*Reaction, error)
- func (rq *ReactionQuery) GetAllToMessagePart(ctx context.Context, receiver networkid.UserLoginID, ...) ([]*Reaction, error)
- func (rq *ReactionQuery) GetByID(ctx context.Context, receiver networkid.UserLoginID, ...) (*Reaction, error)
- func (rq *ReactionQuery) GetByIDWithoutMessagePart(ctx context.Context, receiver networkid.UserLoginID, ...) (*Reaction, error)
- func (rq *ReactionQuery) GetByMXID(ctx context.Context, mxid id.EventID) (*Reaction, error)
- func (rq *ReactionQuery) Upsert(ctx context.Context, reaction *Reaction) error
- type RoomType
- type User
- type UserLogin
- type UserLoginQuery
- func (uq *UserLoginQuery) Delete(ctx context.Context, loginID networkid.UserLoginID) error
- func (uq *UserLoginQuery) GetAllForUser(ctx context.Context, userID id.UserID) ([]*UserLogin, error)
- func (uq *UserLoginQuery) GetAllInPortal(ctx context.Context, portal networkid.PortalKey) ([]*UserLogin, error)
- func (uq *UserLoginQuery) GetAllUserIDsWithLogins(ctx context.Context) ([]id.UserID, error)
- func (uq *UserLoginQuery) GetByID(ctx context.Context, id networkid.UserLoginID) (*UserLogin, error)
- func (uq *UserLoginQuery) Insert(ctx context.Context, login *UserLogin) error
- func (uq *UserLoginQuery) Update(ctx context.Context, login *UserLogin) error
- type UserPortal
- type UserPortalQuery
- func (upq *UserPortalQuery) Delete(ctx context.Context, up *UserPortal) error
- func (upq *UserPortalQuery) Get(ctx context.Context, login *UserLogin, portal networkid.PortalKey) (*UserPortal, error)
- func (upq *UserPortalQuery) GetAllForLogin(ctx context.Context, login *UserLogin) ([]*UserPortal, error)
- func (upq *UserPortalQuery) GetAllForUserInPortal(ctx context.Context, userID id.UserID, portal networkid.PortalKey) ([]*UserPortal, error)
- func (upq *UserPortalQuery) GetAllInPortal(ctx context.Context, portal networkid.PortalKey) ([]*UserPortal, error)
- func (upq *UserPortalQuery) GetOrCreate(ctx context.Context, login *UserLogin, portal networkid.PortalKey) (*UserPortal, error)
- func (upq *UserPortalQuery) MarkAllNotInSpace(ctx context.Context, portal networkid.PortalKey) error
- func (upq *UserPortalQuery) MarkAsPreferred(ctx context.Context, login *UserLogin, portal networkid.PortalKey) error
- func (upq *UserPortalQuery) Put(ctx context.Context, up *UserPortal) error
- type UserQuery
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) 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
}
type DisappearingMessage ¶
type DisappearingMessage struct {
BridgeID networkid.BridgeID
RoomID id.RoomID
EventID id.EventID
Timestamp time.Time
DisappearingSetting
}
func (*DisappearingMessage) Scan ¶
func (d *DisappearingMessage) Scan(row dbutil.Scannable) (*DisappearingMessage, error)
type DisappearingMessageQuery ¶
type DisappearingMessageQuery struct {
BridgeID networkid.BridgeID
*dbutil.QueryHelper[*DisappearingMessage]
}
func (*DisappearingMessageQuery) GetUpcoming ¶
func (dmq *DisappearingMessageQuery) GetUpcoming(ctx context.Context, duration time.Duration, limit int) ([]*DisappearingMessage, error)
func (*DisappearingMessageQuery) Put ¶
func (dmq *DisappearingMessageQuery) Put(ctx context.Context, dm *DisappearingMessage) error
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 (ds DisappearingSetting) Normalize() DisappearingSetting
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 GhostQuery ¶
type GhostQuery struct {
BridgeID networkid.BridgeID
MetaType MetaTypeCreator
*dbutil.QueryHelper[*Ghost]
}
func (*GhostQuery) GetByMetadata ¶ added in v0.20.0
GetByMetadata returns the ghosts whose metadata field at the given JSON key matches the given value.
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 (*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 (*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 (*MessageQuery) GetAllPartsByID ¶
func (mq *MessageQuery) GetAllPartsByID(ctx context.Context, receiver networkid.UserLoginID, id networkid.MessageID) ([]*Message, error)
func (*MessageQuery) GetByRowID ¶
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 (*MessageQuery) GetFirstThreadMessage ¶
func (*MessageQuery) GetLastNInPortal ¶ added in v0.22.0
func (*MessageQuery) GetLastNonFakePartAtOrBeforeTime ¶ added in v0.24.0
func (*MessageQuery) GetLastPartAtOrBeforeTime ¶
func (*MessageQuery) GetLastPartByID ¶
func (mq *MessageQuery) GetLastPartByID(ctx context.Context, receiver networkid.UserLoginID, id networkid.MessageID) (*Message, error)
func (*MessageQuery) GetLastThreadMessage ¶
func (*MessageQuery) GetMessagesBetweenTimeQuery ¶
func (*MessageQuery) GetPartByID ¶
func (*MessageQuery) GetPartByMXID ¶
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)
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
}
type PortalQuery ¶
type PortalQuery struct {
BridgeID networkid.BridgeID
MetaType MetaTypeCreator
*dbutil.QueryHelper[*Portal]
}
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 (*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 (*PortalQuery) GetChildren ¶
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) MigrateToSplitPortals ¶ added in v0.21.0
func (pq *PortalQuery) MigrateToSplitPortals(ctx context.Context) (int64, 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 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 (*ReactionQuery) GetAllToMessagePart ¶ added in v0.20.0
func (*ReactionQuery) GetByIDWithoutMessagePart ¶
type User ¶
type UserLogin ¶
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 (*UserLoginQuery) GetAllInPortal ¶
func (*UserLoginQuery) GetAllUserIDsWithLogins ¶
func (*UserLoginQuery) GetByID ¶
func (uq *UserLoginQuery) GetByID(ctx context.Context, id networkid.UserLoginID) (*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 (*UserPortalQuery) MarkAsPreferred ¶
func (*UserPortalQuery) Put ¶
func (upq *UserPortalQuery) Put(ctx context.Context, up *UserPortal) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.