Documentation ¶
Index ¶
- Constants
- type ColumnInfo
- type DBWrapper
- func (d *DBWrapper) AccountSetReplicationAutoEnable(pk string, enabled bool) error
- func (d *DBWrapper) AccountUpdateFlag(pk string, flagName string, enabled bool) error
- func (d *DBWrapper) AddContactRequestIncomingAccepted(contactPK, groupPK string) (*messengertypes.Contact, error)
- func (d *DBWrapper) AddContactRequestIncomingReceived(contactPK, displayName, groupPk string) (*messengertypes.Contact, error)
- func (d *DBWrapper) AddContactRequestOutgoingEnqueued(contactPK, displayName, convPK string) (*messengertypes.Contact, error)
- func (d *DBWrapper) AddContactRequestOutgoingSent(contactPK string) (*messengertypes.Contact, error)
- func (d *DBWrapper) AddConversation(groupPK, ownMemberPK, ownDevicePK string) (*messengertypes.Conversation, error)
- func (d *DBWrapper) AddConversationForContact(groupPK, ownMemberPK, ownDevicePK, contactPK string) (*messengertypes.Conversation, error)
- func (d *DBWrapper) AddDevice(devicePK string, memberPK string) (*messengertypes.Device, error)
- func (d *DBWrapper) AddInteraction(rawInte *messengertypes.Interaction) (*messengertypes.Interaction, bool, error)
- func (d *DBWrapper) AddMember(memberPK, groupPK, displayName, avatarCID string, isMe bool, isCreator bool) (*messengertypes.Member, error)
- func (d *DBWrapper) AddServiceToken(accountPK string, serviceToken *messengertypes.AppMessage_ServiceAddToken) error
- func (d *DBWrapper) AttributeBacklogInteractions(devicePK, groupPK, memberPK string) ([]*messengertypes.Interaction, error)
- func (d *DBWrapper) DeleteInteractions(cids []string) error
- func (d *DBWrapper) DisableFTS() *DBWrapper
- func (d *DBWrapper) FirstOrCreateAccount(pk, link string) error
- func (d *DBWrapper) GetAccount() (*messengertypes.Account, error)
- func (d *DBWrapper) GetAccountDirectoryServiceRecord(serviceAddr string, recordToken string) (*messengertypes.AccountDirectoryServiceRecord, error)
- func (d *DBWrapper) GetAcknowledgementsCIDsForInteraction(cid string) ([]string, error)
- func (d *DBWrapper) GetAllContacts() ([]*messengertypes.Contact, error)
- func (d *DBWrapper) GetAllConversations() ([]*messengertypes.Conversation, error)
- func (d *DBWrapper) GetAllInteractions() ([]*messengertypes.Interaction, error)
- func (d *DBWrapper) GetAllMembers() ([]*messengertypes.Member, error)
- func (d *DBWrapper) GetAugmentedInteraction(cid string) (*messengertypes.Interaction, error)
- func (d *DBWrapper) GetContactByConversation(conversationPK string) (*messengertypes.Contact, error)
- func (d *DBWrapper) GetContactByPK(publicKey string) (*messengertypes.Contact, error)
- func (d *DBWrapper) GetContactsByState(state messengertypes.Contact_State) ([]*messengertypes.Contact, error)
- func (d *DBWrapper) GetConversationByPK(publicKey string) (*messengertypes.Conversation, error)
- func (d *DBWrapper) GetDBInfo() (*messengertypes.SystemInfo_DB, error)
- func (d *DBWrapper) GetDeviceByPK(publicKey string) (*messengertypes.Device, error)
- func (d *DBWrapper) GetDevicesForContact(conversationPK string, contactPK string) ([]*messengertypes.Device, error)
- func (d *DBWrapper) GetDevicesForMember(conversationPK string, memberPK string) ([]*messengertypes.Device, error)
- func (d *DBWrapper) GetInteractionByCID(cid string) (*messengertypes.Interaction, error)
- func (d *DBWrapper) GetMemberByPK(publicKey string, convPK string) (*messengertypes.Member, error)
- func (d *DBWrapper) GetMembersByConversation(conversationPK string) ([]*messengertypes.Member, error)
- func (d *DBWrapper) GetMuteStatusForConversation(key string) (accountMuted bool, conversationMuted bool, err error)
- func (d *DBWrapper) GetPaginatedInteractions(opts *messengertypes.PaginatedInteractionsOptions) ([]*messengertypes.Interaction, error)
- func (d *DBWrapper) GetPushDeviceToken(accountPK string) (*messengertypes.PushDeviceToken, error)
- func (d *DBWrapper) GetPushMemberToken(tokenID string) (*messengertypes.PushMemberToken, error)
- func (d *DBWrapper) GetPushMemberTokens(conversationPK, devicePK string) ([]*messengertypes.PushMemberToken, error)
- func (d *DBWrapper) GetPushMemberTokensForConversation(conversationPK string) ([]*messengertypes.PushMemberToken, error)
- func (d *DBWrapper) GetPushServerRecord(accountPK, serverAddr string) (*messengertypes.PushServerRecord, error)
- func (d *DBWrapper) GetPushServerRecords(accountPK string) ([]*messengertypes.PushServerRecord, error)
- func (d *DBWrapper) GetPushSharedLocalDeviceTokens(conversationPK string) ([]*messengertypes.PushLocalDeviceSharedToken, error)
- func (d *DBWrapper) GetServiceToken(accountPK, tokenID string) (*messengertypes.ServiceToken, error)
- func (d *DBWrapper) GetServiceTokens(accountPK string) ([]*messengertypes.ServiceToken, error)
- func (d *DBWrapper) GetVerifiedCredentials(identifier string, issuer string) ([]*messengertypes.AccountVerifiedCredential, error)
- func (d *DBWrapper) InitDB(replayer func(d *DBWrapper) error) error
- func (d *DBWrapper) InteractionIndexText(interactionCID string, text string) error
- func (d *DBWrapper) InteractionsSearch(query string, options *SearchOptions) ([]*messengertypes.Interaction, error)
- func (d *DBWrapper) IsConversationOpened(conversationPK string) (bool, error)
- func (d *DBWrapper) IsFromSelf(groupPK string, devicePK string) (bool, error)
- func (d *DBWrapper) KeepDatabaseLocalState() *messengertypes.LocalDatabaseState
- func (d *DBWrapper) MarkAccountDirectoryServiceRecordAsRevoked(serverAddr string, token string, removalDate int64) error
- func (d *DBWrapper) MarkInteractionAsAcknowledged(cid string) (*messengertypes.Interaction, error)
- func (d *DBWrapper) MarkMemberAsConversationCreator(memberPK, conversationPK string) error
- func (d *DBWrapper) MarkMetadataEventHandled(eventContext *protocoltypes.EventContext) (bool, error)
- func (d *DBWrapper) MuteConversation(pk string, until int64) error
- func (d *DBWrapper) PostAction(action func(d *DBWrapper) error) (err error)
- func (d *DBWrapper) PushSetReplicationAutoShare(pk string, enabled bool) error
- func (d *DBWrapper) RestoreFromBackup(backup *messengertypes.LocalDatabaseState, replayLogsToDB func() error) error
- func (d *DBWrapper) SaveAccountDirectoryServiceRecord(accountPK string, ...) error
- func (d *DBWrapper) SaveAccountVerifiedCredential(ev *protocoltypes.AccountVerifiedCredentialRegistered) error
- func (d *DBWrapper) SaveConversationReplicationInfo(c *messengertypes.ConversationReplicationInfo) error
- func (d *DBWrapper) SavePushDeviceToken(accountPK string, message *messengertypes.AppMessage_PushSetDeviceToken) error
- func (d *DBWrapper) SavePushLocalDeviceSharedToken(tokenID, conversationPK string) error
- func (d *DBWrapper) SavePushMemberToken(tokenID, conversationPK string, ...) error
- func (d *DBWrapper) SavePushServer(accountPK string, message *messengertypes.AppMessage_PushSetServer) error
- func (d *DBWrapper) SetConversationIsOpenStatus(conversationPK string, status bool) (*messengertypes.Conversation, bool, error)
- func (d *DBWrapper) TX(ctx context.Context, txFunc func(*DBWrapper) error) (err error)
- func (d *DBWrapper) UpdateAccount(pk, url, displayName string) (*messengertypes.Account, error)
- func (d *DBWrapper) UpdateAccountFields(fields map[string]interface{}) error
- func (d *DBWrapper) UpdateContact(pk string, contact *messengertypes.Contact) error
- func (d *DBWrapper) UpdateConversation(c *messengertypes.Conversation) (bool, error)
- func (d *DBWrapper) UpdateConversationReadState(pk string, newUnread bool, eventDate time.Time) error
- func (d *DBWrapper) UpsertMember(memberPK, groupPK string, m *messengertypes.Member) (*messengertypes.Member, bool, error)
- type GetInMemoryTestDBOpts
- type SearchOptions
Constants ¶
const ( GetInMemoryTestDBOptsUndefined = iota GetInMemoryTestDBOptsNoInit GetInMemoryTestDBOptsStdOutLogger GetInMemoryTestDBOptsNoFTS )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnInfo ¶
type ColumnInfo struct { ColumnID string Name string Type string NotNull *string DfltValue *string PK string }
func (*ColumnInfo) Equals ¶
func (t *ColumnInfo) Equals(other *ColumnInfo) bool
type DBWrapper ¶
type DBWrapper struct {
// contains filtered or unexported fields
}
func GetInMemoryTestDB ¶
func (*DBWrapper) AccountSetReplicationAutoEnable ¶
func (*DBWrapper) AccountUpdateFlag ¶
func (*DBWrapper) AddContactRequestIncomingAccepted ¶
func (d *DBWrapper) AddContactRequestIncomingAccepted(contactPK, groupPK string) (*messengertypes.Contact, error)
func (*DBWrapper) AddContactRequestIncomingReceived ¶
func (d *DBWrapper) AddContactRequestIncomingReceived(contactPK, displayName, groupPk string) (*messengertypes.Contact, error)
func (*DBWrapper) AddContactRequestOutgoingEnqueued ¶
func (d *DBWrapper) AddContactRequestOutgoingEnqueued(contactPK, displayName, convPK string) (*messengertypes.Contact, error)
func (*DBWrapper) AddContactRequestOutgoingSent ¶
func (d *DBWrapper) AddContactRequestOutgoingSent(contactPK string) (*messengertypes.Contact, error)
func (*DBWrapper) AddConversation ¶
func (d *DBWrapper) AddConversation(groupPK, ownMemberPK, ownDevicePK string) (*messengertypes.Conversation, error)
func (*DBWrapper) AddConversationForContact ¶
func (d *DBWrapper) AddConversationForContact(groupPK, ownMemberPK, ownDevicePK, contactPK string) (*messengertypes.Conversation, error)
func (*DBWrapper) AddInteraction ¶
func (d *DBWrapper) AddInteraction(rawInte *messengertypes.Interaction) (*messengertypes.Interaction, bool, error)
func (*DBWrapper) AddServiceToken ¶
func (d *DBWrapper) AddServiceToken(accountPK string, serviceToken *messengertypes.AppMessage_ServiceAddToken) error
func (*DBWrapper) AttributeBacklogInteractions ¶
func (d *DBWrapper) AttributeBacklogInteractions(devicePK, groupPK, memberPK string) ([]*messengertypes.Interaction, error)
func (*DBWrapper) DeleteInteractions ¶
func (*DBWrapper) DisableFTS ¶
func (*DBWrapper) FirstOrCreateAccount ¶
func (*DBWrapper) GetAccount ¶
func (d *DBWrapper) GetAccount() (*messengertypes.Account, error)
atomic
func (*DBWrapper) GetAccountDirectoryServiceRecord ¶ added in v2.452.0
func (d *DBWrapper) GetAccountDirectoryServiceRecord(serviceAddr string, recordToken string) (*messengertypes.AccountDirectoryServiceRecord, error)
func (*DBWrapper) GetAcknowledgementsCIDsForInteraction ¶
func (*DBWrapper) GetAllContacts ¶
func (d *DBWrapper) GetAllContacts() ([]*messengertypes.Contact, error)
func (*DBWrapper) GetAllConversations ¶
func (d *DBWrapper) GetAllConversations() ([]*messengertypes.Conversation, error)
func (*DBWrapper) GetAllInteractions ¶
func (d *DBWrapper) GetAllInteractions() ([]*messengertypes.Interaction, error)
func (*DBWrapper) GetAllMembers ¶
func (d *DBWrapper) GetAllMembers() ([]*messengertypes.Member, error)
func (*DBWrapper) GetAugmentedInteraction ¶
func (d *DBWrapper) GetAugmentedInteraction(cid string) (*messengertypes.Interaction, error)
func (*DBWrapper) GetContactByConversation ¶ added in v2.470.0
func (d *DBWrapper) GetContactByConversation(conversationPK string) (*messengertypes.Contact, error)
func (*DBWrapper) GetContactByPK ¶
func (d *DBWrapper) GetContactByPK(publicKey string) (*messengertypes.Contact, error)
atomic
func (*DBWrapper) GetContactsByState ¶
func (d *DBWrapper) GetContactsByState(state messengertypes.Contact_State) ([]*messengertypes.Contact, error)
func (*DBWrapper) GetConversationByPK ¶
func (d *DBWrapper) GetConversationByPK(publicKey string) (*messengertypes.Conversation, error)
func (*DBWrapper) GetDBInfo ¶
func (d *DBWrapper) GetDBInfo() (*messengertypes.SystemInfo_DB, error)
func (*DBWrapper) GetDeviceByPK ¶
func (d *DBWrapper) GetDeviceByPK(publicKey string) (*messengertypes.Device, error)
func (*DBWrapper) GetDevicesForContact ¶ added in v2.470.0
func (d *DBWrapper) GetDevicesForContact(conversationPK string, contactPK string) ([]*messengertypes.Device, error)
GetDevicesForContact returns the devices for a given contact of contact conversation.
func (*DBWrapper) GetDevicesForMember ¶ added in v2.344.0
func (*DBWrapper) GetInteractionByCID ¶
func (d *DBWrapper) GetInteractionByCID(cid string) (*messengertypes.Interaction, error)
func (*DBWrapper) GetMemberByPK ¶
func (*DBWrapper) GetMembersByConversation ¶ added in v2.470.0
func (d *DBWrapper) GetMembersByConversation(conversationPK string) ([]*messengertypes.Member, error)
func (*DBWrapper) GetMuteStatusForConversation ¶ added in v2.381.0
func (*DBWrapper) GetPaginatedInteractions ¶
func (d *DBWrapper) GetPaginatedInteractions(opts *messengertypes.PaginatedInteractionsOptions) ([]*messengertypes.Interaction, error)
func (*DBWrapper) GetPushDeviceToken ¶ added in v2.470.0
func (d *DBWrapper) GetPushDeviceToken(accountPK string) (*messengertypes.PushDeviceToken, error)
GetPushDeviceToken returns the push device token for the given accountPK.
func (*DBWrapper) GetPushMemberToken ¶ added in v2.470.0
func (d *DBWrapper) GetPushMemberToken(tokenID string) (*messengertypes.PushMemberToken, error)
GetPushMemberToken returns the push member token for the given tokenID.
func (*DBWrapper) GetPushMemberTokens ¶ added in v2.470.0
func (d *DBWrapper) GetPushMemberTokens(conversationPK, devicePK string) ([]*messengertypes.PushMemberToken, error)
GetPushMemberTokens returns the push tokens of the member's device for the given conversationPK.
func (*DBWrapper) GetPushMemberTokensForConversation ¶ added in v2.470.0
func (d *DBWrapper) GetPushMemberTokensForConversation(conversationPK string) ([]*messengertypes.PushMemberToken, error)
GetPushMemberTokensForConversation returns the push token devices for the given conversationPK.
func (*DBWrapper) GetPushServerRecord ¶ added in v2.470.0
func (d *DBWrapper) GetPushServerRecord(accountPK, serverAddr string) (*messengertypes.PushServerRecord, error)
GetPushServerRecord returns the push server record for the given accountPK and serverAddr.
func (*DBWrapper) GetPushServerRecords ¶ added in v2.470.0
func (d *DBWrapper) GetPushServerRecords(accountPK string) ([]*messengertypes.PushServerRecord, error)
GetPushServerRecords returns the list of push server records for the given accountPK.
func (*DBWrapper) GetPushSharedLocalDeviceTokens ¶ added in v2.470.0
func (d *DBWrapper) GetPushSharedLocalDeviceTokens(conversationPK string) ([]*messengertypes.PushLocalDeviceSharedToken, error)
func (*DBWrapper) GetServiceToken ¶ added in v2.470.0
func (d *DBWrapper) GetServiceToken(accountPK, tokenID string) (*messengertypes.ServiceToken, error)
GetServiceToken returns the service tokens for the given accountPK.
func (*DBWrapper) GetServiceTokens ¶ added in v2.470.0
func (d *DBWrapper) GetServiceTokens(accountPK string) ([]*messengertypes.ServiceToken, error)
GetServiceToken returns the service token for the given accountPK and tokenID.
func (*DBWrapper) GetVerifiedCredentials ¶ added in v2.452.0
func (d *DBWrapper) GetVerifiedCredentials(identifier string, issuer string) ([]*messengertypes.AccountVerifiedCredential, error)
func (*DBWrapper) InteractionIndexText ¶
func (*DBWrapper) InteractionsSearch ¶
func (d *DBWrapper) InteractionsSearch(query string, options *SearchOptions) ([]*messengertypes.Interaction, error)
func (*DBWrapper) IsConversationOpened ¶
func (*DBWrapper) IsFromSelf ¶
func (*DBWrapper) KeepDatabaseLocalState ¶
func (d *DBWrapper) KeepDatabaseLocalState() *messengertypes.LocalDatabaseState
func (*DBWrapper) MarkAccountDirectoryServiceRecordAsRevoked ¶ added in v2.452.0
func (*DBWrapper) MarkInteractionAsAcknowledged ¶
func (d *DBWrapper) MarkInteractionAsAcknowledged(cid string) (*messengertypes.Interaction, error)
func (*DBWrapper) MarkMemberAsConversationCreator ¶
func (*DBWrapper) MarkMetadataEventHandled ¶
func (d *DBWrapper) MarkMetadataEventHandled(eventContext *protocoltypes.EventContext) (bool, error)
func (*DBWrapper) MuteConversation ¶ added in v2.381.0
func (*DBWrapper) PostAction ¶ added in v2.470.0
func (*DBWrapper) PushSetReplicationAutoShare ¶
func (*DBWrapper) RestoreFromBackup ¶
func (d *DBWrapper) RestoreFromBackup(backup *messengertypes.LocalDatabaseState, replayLogsToDB func() error) error
func (*DBWrapper) SaveAccountDirectoryServiceRecord ¶ added in v2.452.0
func (d *DBWrapper) SaveAccountDirectoryServiceRecord(accountPK string, message *messengertypes.AppMessage_AccountDirectoryServiceRegistered) error
func (*DBWrapper) SaveAccountVerifiedCredential ¶ added in v2.448.0
func (d *DBWrapper) SaveAccountVerifiedCredential(ev *protocoltypes.AccountVerifiedCredentialRegistered) error
func (*DBWrapper) SaveConversationReplicationInfo ¶
func (d *DBWrapper) SaveConversationReplicationInfo(c *messengertypes.ConversationReplicationInfo) error
func (*DBWrapper) SavePushDeviceToken ¶ added in v2.470.0
func (d *DBWrapper) SavePushDeviceToken(accountPK string, message *messengertypes.AppMessage_PushSetDeviceToken) error
SavePushDeviceToken saves the push device token in the database for the given accountPK. If the push device token already exists, the key is updated.
func (*DBWrapper) SavePushLocalDeviceSharedToken ¶ added in v2.470.0
SavePushLocalDeviceSharedToken saves the push token ID of the local device for the given conversationPK.
func (*DBWrapper) SavePushMemberToken ¶ added in v2.470.0
func (d *DBWrapper) SavePushMemberToken(tokenID, conversationPK string, message *messengertypes.AppMessage_PushSetMemberToken) error
SavePushMemberToken saves the push member token in the database for the given ConversationPK.
func (*DBWrapper) SavePushServer ¶ added in v2.470.0
func (d *DBWrapper) SavePushServer(accountPK string, message *messengertypes.AppMessage_PushSetServer) error
SavePushServer saves the push server key in the database for the given accountPK and serverAddr. If the server already exists, the key is updated.
func (*DBWrapper) SetConversationIsOpenStatus ¶
func (d *DBWrapper) SetConversationIsOpenStatus(conversationPK string, status bool) (*messengertypes.Conversation, bool, error)
func (*DBWrapper) UpdateAccount ¶
func (d *DBWrapper) UpdateAccount(pk, url, displayName string) (*messengertypes.Account, error)
func (*DBWrapper) UpdateAccountFields ¶ added in v2.381.0
func (*DBWrapper) UpdateContact ¶
func (d *DBWrapper) UpdateContact(pk string, contact *messengertypes.Contact) error
func (*DBWrapper) UpdateConversation ¶
func (d *DBWrapper) UpdateConversation(c *messengertypes.Conversation) (bool, error)
func (*DBWrapper) UpdateConversationReadState ¶
func (*DBWrapper) UpsertMember ¶
func (d *DBWrapper) UpsertMember(memberPK, groupPK string, m *messengertypes.Member) (*messengertypes.Member, bool, error)
type GetInMemoryTestDBOpts ¶
type GetInMemoryTestDBOpts int32