Documentation ¶
Index ¶
- type BackfillState
- type BackfillStateQuery
- type BackfillTask
- func (b *BackfillTask) Insert(ctx context.Context) error
- func (b *BackfillTask) MarkDispatched(ctx context.Context) error
- func (b *BackfillTask) MarkDone(ctx context.Context) error
- func (b *BackfillTask) MarshalZerologObject(evt *zerolog.Event)
- func (b *BackfillTask) Scan(row dbutil.Scannable) (*BackfillTask, error)
- func (b *BackfillTask) String() string
- type BackfillTaskQuery
- func (bq *BackfillTaskQuery) DeleteAll(ctx context.Context, userID id.UserID) error
- func (bq *BackfillTaskQuery) DeleteAllForPortal(ctx context.Context, userID id.UserID, portalKey PortalKey) error
- func (bq *BackfillTaskQuery) GetNext(ctx context.Context, userID id.UserID, backfillTypes []BackfillType) (*BackfillTask, error)
- func (bq *BackfillTaskQuery) HasUnstartedOrInFlightOfType(ctx context.Context, userID id.UserID, backfillTypes []BackfillType) (has bool)
- func (bq *BackfillTaskQuery) NewWithValues(userID id.UserID, backfillType BackfillType, priority int, portal PortalKey, ...) *BackfillTask
- type BackfillType
- type Database
- type DisappearingMessage
- type DisappearingMessageQuery
- type HistorySyncConversation
- type HistorySyncMessage
- type HistorySyncQuery
- func (hsq *HistorySyncQuery) ConversationHasMessages(ctx context.Context, userID id.UserID, portalKey PortalKey) (exists bool, err error)
- func (hsq *HistorySyncQuery) DeleteAllConversations(ctx context.Context, userID id.UserID) error
- func (hsq *HistorySyncQuery) DeleteAllMessages(ctx context.Context, userID id.UserID) error
- func (hsq *HistorySyncQuery) DeleteAllMessagesForPortal(ctx context.Context, userID id.UserID, portalKey PortalKey) error
- func (hsq *HistorySyncQuery) DeleteConversation(ctx context.Context, userID id.UserID, jid string) error
- func (hsq *HistorySyncQuery) DeleteMessages(ctx context.Context, userID id.UserID, conversationID string, ...) error
- func (hsq *HistorySyncQuery) GetConversation(ctx context.Context, userID id.UserID, portalKey PortalKey) (*HistorySyncConversation, error)
- func (hsq *HistorySyncQuery) GetMessagesBetween(ctx context.Context, userID id.UserID, conversationID string, ...) ([]*waProto.WebMessageInfo, error)
- func (hsq *HistorySyncQuery) GetRecentConversations(ctx context.Context, userID id.UserID, n int) ([]*HistorySyncConversation, error)
- func (hsq *HistorySyncQuery) NewConversationWithValues(userID id.UserID, conversationID string, portalKey PortalKey, ...) *HistorySyncConversation
- func (hsq *HistorySyncQuery) NewMessageWithValues(userID id.UserID, conversationID, messageID string, ...) (*HistorySyncMessage, error)
- type MediaBackfillRequest
- type MediaBackfillRequestQuery
- func (mbrq *MediaBackfillRequestQuery) DeleteAllMediaBackfillRequests(ctx context.Context, userID id.UserID) error
- func (mbrq *MediaBackfillRequestQuery) GetMediaBackfillRequestsForUser(ctx context.Context, userID id.UserID) ([]*MediaBackfillRequest, error)
- func (mbrq *MediaBackfillRequestQuery) NewMediaBackfillRequestWithValues(userID id.UserID, portalKey PortalKey, eventID id.EventID, mediaKey []byte) *MediaBackfillRequest
- type MediaBackfillRequestStatus
- type Message
- func (msg *Message) Delete(ctx context.Context) error
- func (msg *Message) GetPollOptionHashes(ctx context.Context, ids []string) (map[string][32]byte, error)
- func (msg *Message) GetPollOptionIDs(ctx context.Context, hashes [][]byte) (map[[32]byte]string, error)
- func (msg *Message) Insert(ctx context.Context) error
- func (msg *Message) IsFakeJID() bool
- func (msg *Message) IsFakeMXID() bool
- func (msg *Message) MarkSent(ctx context.Context, ts time.Time) error
- func (msg *Message) PutPollOptions(ctx context.Context, opts map[[32]byte]string) error
- func (msg *Message) Scan(row dbutil.Scannable) (*Message, error)
- func (msg *Message) UpdateMXID(ctx context.Context, mxid id.EventID, newType MessageType, ...) error
- type MessageErrorType
- type MessageQuery
- func (mq *MessageQuery) GetAll(ctx context.Context, chat PortalKey) ([]*Message, error)
- func (mq *MessageQuery) GetByJID(ctx context.Context, chat PortalKey, jid types.MessageID) (*Message, error)
- func (mq *MessageQuery) GetByMXID(ctx context.Context, mxid id.EventID) (*Message, error)
- func (mq *MessageQuery) GetFirstInChat(ctx context.Context, chat PortalKey) (*Message, error)
- func (mq *MessageQuery) GetLastInChat(ctx context.Context, chat PortalKey) (*Message, error)
- func (mq *MessageQuery) GetLastInChatBefore(ctx context.Context, chat PortalKey, maxTimestamp time.Time) (*Message, error)
- func (mq *MessageQuery) GetMessagesBetween(ctx context.Context, chat PortalKey, minTimestamp, maxTimestamp time.Time) ([]*Message, error)
- type MessageType
- type Portal
- type PortalKey
- type PortalQuery
- func (pq *PortalQuery) FindPrivateChats(ctx context.Context, receiver types.JID) ([]*Portal, error)
- func (pq *PortalQuery) FindPrivateChatsNotInSpace(ctx context.Context, receiver types.JID) (keys []PortalKey, err error)
- func (pq *PortalQuery) GetAll(ctx context.Context) ([]*Portal, error)
- func (pq *PortalQuery) GetAllByJID(ctx context.Context, jid types.JID) ([]*Portal, error)
- func (pq *PortalQuery) GetAllByParentGroup(ctx context.Context, jid types.JID) ([]*Portal, error)
- func (pq *PortalQuery) GetByJID(ctx context.Context, key PortalKey) (*Portal, error)
- func (pq *PortalQuery) GetByMXID(ctx context.Context, mxid id.RoomID) (*Portal, error)
- type Puppet
- type PuppetQuery
- func (pq *PuppetQuery) Get(ctx context.Context, jid types.JID) (*Puppet, error)
- func (pq *PuppetQuery) GetAll(ctx context.Context) ([]*Puppet, error)
- func (pq *PuppetQuery) GetAllWithCustomMXID(ctx context.Context) ([]*Puppet, error)
- func (pq *PuppetQuery) GetByCustomMXID(ctx context.Context, mxid id.UserID) (*Puppet, error)
- type Reaction
- type ReactionQuery
- type User
- func (user *User) GetLastAppStateKeyID(ctx context.Context) (keyID []byte, err error)
- func (user *User) GetLastReadTS(ctx context.Context, portal PortalKey) time.Time
- func (user *User) Insert(ctx context.Context) error
- func (user *User) IsInSpace(ctx context.Context, portal PortalKey) bool
- func (user *User) MarkInSpace(ctx context.Context, portal PortalKey)
- func (user *User) Scan(row dbutil.Scannable) (*User, error)
- func (user *User) SetLastReadTS(ctx context.Context, portal PortalKey, ts time.Time)
- func (user *User) Update(ctx context.Context) error
- type UserQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackfillState ¶ added in v0.5.0
type BackfillState struct { UserID id.UserID Portal PortalKey ProcessingBatch bool BackfillComplete bool FirstExpectedTimestamp uint64 // contains filtered or unexported fields }
func (*BackfillState) Scan ¶ added in v0.5.0
func (b *BackfillState) Scan(row dbutil.Scannable) (*BackfillState, error)
func (*BackfillState) SetProcessingBatch ¶ added in v0.5.0
func (b *BackfillState) SetProcessingBatch(ctx context.Context, processing bool) error
type BackfillStateQuery ¶ added in v0.10.6
type BackfillStateQuery struct { *dbutil.QueryHelper[*BackfillState] }
func (*BackfillStateQuery) GetBackfillState ¶ added in v0.10.6
func (bq *BackfillStateQuery) GetBackfillState(ctx context.Context, userID id.UserID, portalKey PortalKey) (*BackfillState, error)
func (*BackfillStateQuery) NewBackfillState ¶ added in v0.10.6
func (bq *BackfillStateQuery) NewBackfillState(userID id.UserID, portalKey PortalKey) *BackfillState
type BackfillTask ¶ added in v0.10.6
type BackfillTask struct { QueueID int UserID id.UserID BackfillType BackfillType Priority int Portal PortalKey TimeStart *time.Time MaxBatchEvents int MaxTotalEvents int BatchDelay int DispatchTime *time.Time CompletedAt *time.Time // contains filtered or unexported fields }
func (*BackfillTask) Insert ¶ added in v0.10.6
func (b *BackfillTask) Insert(ctx context.Context) error
func (*BackfillTask) MarkDispatched ¶ added in v0.10.6
func (b *BackfillTask) MarkDispatched(ctx context.Context) error
func (*BackfillTask) MarkDone ¶ added in v0.10.6
func (b *BackfillTask) MarkDone(ctx context.Context) error
func (*BackfillTask) MarshalZerologObject ¶ added in v0.10.6
func (b *BackfillTask) MarshalZerologObject(evt *zerolog.Event)
func (*BackfillTask) Scan ¶ added in v0.10.6
func (b *BackfillTask) Scan(row dbutil.Scannable) (*BackfillTask, error)
func (*BackfillTask) String ¶ added in v0.10.6
func (b *BackfillTask) String() string
type BackfillTaskQuery ¶ added in v0.10.6
type BackfillTaskQuery struct { *dbutil.QueryHelper[*BackfillTask] }
func (*BackfillTaskQuery) DeleteAllForPortal ¶ added in v0.10.6
func (*BackfillTaskQuery) GetNext ¶ added in v0.10.6
func (bq *BackfillTaskQuery) GetNext(ctx context.Context, userID id.UserID, backfillTypes []BackfillType) (*BackfillTask, error)
GetNext returns the next backfill to perform
func (*BackfillTaskQuery) HasUnstartedOrInFlightOfType ¶ added in v0.10.6
func (bq *BackfillTaskQuery) HasUnstartedOrInFlightOfType(ctx context.Context, userID id.UserID, backfillTypes []BackfillType) (has bool)
func (*BackfillTaskQuery) NewWithValues ¶ added in v0.10.6
func (bq *BackfillTaskQuery) NewWithValues(userID id.UserID, backfillType BackfillType, priority int, portal PortalKey, timeStart *time.Time, maxBatchEvents, maxTotalEvents, batchDelay int) *BackfillTask
type BackfillType ¶ added in v0.4.0
type BackfillType int
const ( BackfillImmediate BackfillType = 0 BackfillForward BackfillType = 100 BackfillDeferred BackfillType = 200 )
func (BackfillType) String ¶ added in v0.4.0
func (bt BackfillType) String() string
type Database ¶
type Database struct { *dbutil.Database User *UserQuery Portal *PortalQuery Puppet *PuppetQuery Message *MessageQuery Reaction *ReactionQuery DisappearingMessage *DisappearingMessageQuery BackfillQueue *BackfillTaskQuery BackfillState *BackfillStateQuery HistorySync *HistorySyncQuery MediaBackfillRequest *MediaBackfillRequestQuery }
type DisappearingMessage ¶ added in v0.2.3
type DisappearingMessage struct { RoomID id.RoomID EventID id.EventID ExpireIn time.Duration ExpireAt time.Time // contains filtered or unexported fields }
func (*DisappearingMessage) Delete ¶ added in v0.2.3
func (msg *DisappearingMessage) Delete(ctx context.Context) error
func (*DisappearingMessage) Insert ¶ added in v0.2.3
func (msg *DisappearingMessage) Insert(ctx context.Context) error
func (*DisappearingMessage) Scan ¶ added in v0.2.3
func (msg *DisappearingMessage) Scan(row dbutil.Scannable) (*DisappearingMessage, error)
func (*DisappearingMessage) StartTimer ¶ added in v0.2.3
func (msg *DisappearingMessage) StartTimer(ctx context.Context) error
type DisappearingMessageQuery ¶ added in v0.2.3
type DisappearingMessageQuery struct { *dbutil.QueryHelper[*DisappearingMessage] }
func (*DisappearingMessageQuery) GetUpcomingScheduled ¶ added in v0.2.3
func (dmq *DisappearingMessageQuery) GetUpcomingScheduled(ctx context.Context, duration time.Duration) ([]*DisappearingMessage, error)
func (*DisappearingMessageQuery) NewWithValues ¶ added in v0.2.3
func (dmq *DisappearingMessageQuery) NewWithValues(roomID id.RoomID, eventID id.EventID, expireIn time.Duration, expireAt time.Time) *DisappearingMessage
type HistorySyncConversation ¶ added in v0.4.0
type HistorySyncConversation struct { UserID id.UserID ConversationID string PortalKey PortalKey LastMessageTimestamp time.Time MuteEndTime time.Time Archived bool Pinned uint32 DisappearingMode waProto.DisappearingMode_Initiator EndOfHistoryTransferType waProto.Conversation_EndOfHistoryTransferType EphemeralExpiration *uint32 MarkedAsUnread bool UnreadCount uint32 // contains filtered or unexported fields }
func (*HistorySyncConversation) Scan ¶ added in v0.4.0
func (hsc *HistorySyncConversation) Scan(row dbutil.Scannable) (*HistorySyncConversation, error)
type HistorySyncMessage ¶ added in v0.4.0
type HistorySyncQuery ¶ added in v0.4.0
type HistorySyncQuery struct { *dbutil.QueryHelper[*HistorySyncConversation] }
func (*HistorySyncQuery) ConversationHasMessages ¶ added in v0.10.3
func (*HistorySyncQuery) DeleteAllConversations ¶ added in v0.4.0
func (*HistorySyncQuery) DeleteAllMessages ¶ added in v0.4.0
func (*HistorySyncQuery) DeleteAllMessagesForPortal ¶ added in v0.4.0
func (*HistorySyncQuery) DeleteConversation ¶ added in v0.9.0
func (*HistorySyncQuery) DeleteMessages ¶ added in v0.4.0
func (hsq *HistorySyncQuery) DeleteMessages(ctx context.Context, userID id.UserID, conversationID string, messages []*waProto.WebMessageInfo) error
func (*HistorySyncQuery) GetConversation ¶ added in v0.4.0
func (hsq *HistorySyncQuery) GetConversation(ctx context.Context, userID id.UserID, portalKey PortalKey) (*HistorySyncConversation, error)
func (*HistorySyncQuery) GetMessagesBetween ¶ added in v0.4.0
func (*HistorySyncQuery) GetRecentConversations ¶ added in v0.9.0
func (hsq *HistorySyncQuery) GetRecentConversations(ctx context.Context, userID id.UserID, n int) ([]*HistorySyncConversation, error)
func (*HistorySyncQuery) NewConversationWithValues ¶ added in v0.4.0
func (hsq *HistorySyncQuery) NewConversationWithValues( userID id.UserID, conversationID string, portalKey PortalKey, lastMessageTimestamp, muteEndTime uint64, archived bool, pinned uint32, disappearingMode waProto.DisappearingMode_Initiator, endOfHistoryTransferType waProto.Conversation_EndOfHistoryTransferType, ephemeralExpiration *uint32, markedAsUnread bool, unreadCount uint32, ) *HistorySyncConversation
func (*HistorySyncQuery) NewMessageWithValues ¶ added in v0.4.0
func (hsq *HistorySyncQuery) NewMessageWithValues(userID id.UserID, conversationID, messageID string, message *waProto.HistorySyncMsg) (*HistorySyncMessage, error)
type MediaBackfillRequest ¶ added in v0.4.0
type MediaBackfillRequest struct { UserID id.UserID PortalKey PortalKey EventID id.EventID MediaKey []byte Status MediaBackfillRequestStatus Error string // contains filtered or unexported fields }
func (*MediaBackfillRequest) Scan ¶ added in v0.4.0
func (mbr *MediaBackfillRequest) Scan(row dbutil.Scannable) (*MediaBackfillRequest, error)
type MediaBackfillRequestQuery ¶ added in v0.4.0
type MediaBackfillRequestQuery struct { *dbutil.QueryHelper[*MediaBackfillRequest] }
func (*MediaBackfillRequestQuery) DeleteAllMediaBackfillRequests ¶ added in v0.4.0
func (*MediaBackfillRequestQuery) GetMediaBackfillRequestsForUser ¶ added in v0.4.0
func (mbrq *MediaBackfillRequestQuery) GetMediaBackfillRequestsForUser(ctx context.Context, userID id.UserID) ([]*MediaBackfillRequest, error)
func (*MediaBackfillRequestQuery) NewMediaBackfillRequestWithValues ¶ added in v0.4.0
func (mbrq *MediaBackfillRequestQuery) NewMediaBackfillRequestWithValues(userID id.UserID, portalKey PortalKey, eventID id.EventID, mediaKey []byte) *MediaBackfillRequest
type MediaBackfillRequestStatus ¶ added in v0.4.0
type MediaBackfillRequestStatus int
const ( MediaBackfillRequestStatusNotRequested MediaBackfillRequestStatus = iota MediaBackfillRequestStatusRequested MediaBackfillRequestStatusRequestFailed )
type Message ¶
type Message struct { Chat PortalKey JID types.MessageID MXID id.EventID Sender types.JID SenderMXID id.UserID Timestamp time.Time Sent bool Type MessageType Error MessageErrorType GalleryPart int BroadcastListJID types.JID // contains filtered or unexported fields }
func (*Message) GetPollOptionHashes ¶ added in v0.8.1
func (*Message) GetPollOptionIDs ¶ added in v0.8.1
func (*Message) IsFakeMXID ¶ added in v0.1.6
func (*Message) PutPollOptions ¶ added in v0.8.1
func (*Message) UpdateMXID ¶ added in v0.2.1
func (msg *Message) UpdateMXID(ctx context.Context, mxid id.EventID, newType MessageType, newError MessageErrorType) error
type MessageErrorType ¶ added in v0.2.4
type MessageErrorType string
const ( MsgNoError MessageErrorType = "" MsgErrDecryptionFailed MessageErrorType = "decryption_failed" MsgErrMediaNotFound MessageErrorType = "media_not_found" )
type MessageQuery ¶
type MessageQuery struct { *dbutil.QueryHelper[*Message] }
func (*MessageQuery) GetFirstInChat ¶ added in v0.2.1
func (*MessageQuery) GetLastInChat ¶
func (*MessageQuery) GetLastInChatBefore ¶ added in v0.1.7
func (*MessageQuery) GetMessagesBetween ¶ added in v0.2.2
type MessageType ¶ added in v0.3.0
type MessageType string
const ( MsgUnknown MessageType = "" MsgFake MessageType = "fake" MsgNormal MessageType = "message" MsgReaction MessageType = "reaction" MsgEdit MessageType = "edit" MsgMatrixPoll MessageType = "matrix-poll" MsgBeeperGallery MessageType = "beeper-gallery" )
type Portal ¶
type Portal struct { Key PortalKey MXID id.RoomID Name string NameSet bool Topic string TopicSet bool Avatar string AvatarURL id.ContentURI AvatarSet bool Encrypted bool LastSync time.Time IsParent bool ParentGroup types.JID InSpace bool FirstEventID id.EventID NextBatchID id.BatchID RelayUserID id.UserID ExpirationTime uint32 // contains filtered or unexported fields }
type PortalKey ¶
func NewPortalKey ¶
type PortalQuery ¶
type PortalQuery struct { *dbutil.QueryHelper[*Portal] }
func (*PortalQuery) FindPrivateChats ¶ added in v0.1.4
func (*PortalQuery) FindPrivateChatsNotInSpace ¶ added in v0.2.3
func (*PortalQuery) GetAllByJID ¶
func (*PortalQuery) GetAllByParentGroup ¶ added in v0.8.0
type Puppet ¶
type Puppet struct { JID types.JID Avatar string AvatarURL id.ContentURI AvatarSet bool Displayname string NameQuality int8 NameSet bool ContactInfoSet bool LastSync time.Time CustomMXID id.UserID AccessToken string NextBatch string EnablePresence bool EnableReceipts bool // contains filtered or unexported fields }
type PuppetQuery ¶
type PuppetQuery struct { *dbutil.QueryHelper[*Puppet] }
func (*PuppetQuery) GetAllWithCustomMXID ¶
func (pq *PuppetQuery) GetAllWithCustomMXID(ctx context.Context) ([]*Puppet, error)
func (*PuppetQuery) GetByCustomMXID ¶
type Reaction ¶ added in v0.3.0
type Reaction struct { Chat PortalKey TargetJID types.MessageID Sender types.JID MXID id.EventID JID types.MessageID // contains filtered or unexported fields }
type ReactionQuery ¶ added in v0.3.0
type ReactionQuery struct { *dbutil.QueryHelper[*Reaction] }
type User ¶
type User struct { MXID id.UserID JID types.JID ManagementRoom id.RoomID SpaceRoom id.RoomID PhoneLastSeen time.Time PhoneLastPinged time.Time Timezone string // contains filtered or unexported fields }
func (*User) GetLastAppStateKeyID ¶ added in v0.4.0
func (*User) GetLastReadTS ¶ added in v0.2.2
func (*User) MarkInSpace ¶ added in v0.2.3
func (*User) SetLastReadTS ¶ added in v0.2.2
Source Files ¶
Click to show internal directories.
Click to hide internal directories.