Documentation ¶
Overview ¶
Package sqlstore contains an SQL-backed implementation of the interfaces in the store package.
Index ¶
- Variables
- func New(ctx context.Context, log waLog.Logger) (*container, error)
- type Store
- func (c Store) Close() error
- func (s *Store) DeleteAllIdentities(phone string) error
- func (s *Store) DeleteAllSessions(phone string) error
- func (s *Store) DeleteAppStateMutationMACs(name string, indexMACs [][]byte) (err error)
- func (s *Store) DeleteAppStateVersion(name string) error
- func (c Store) DeleteDevice(store *store.Device) error
- func (s *Store) DeleteIdentity(address string) error
- func (s *Store) DeleteSession(address string) error
- func (s *Store) GenOnePreKey() (*keys.PreKey, error)
- func (s *Store) GetAllContacts() (map[types.JID]types.ContactInfo, error)
- func (c Store) GetAllDevices() ([]*store.Device, error)
- func (s *Store) GetAppStateMutationMAC(name string, indexMAC []byte) (valueMAC []byte, err error)
- func (s *Store) GetAppStateSyncKey(id []byte) (*store.AppStateSyncKey, error)
- func (s *Store) GetAppStateVersion(name string) (version uint64, hash [128]byte, err error)
- func (s *Store) GetChatSettings(chat types.JID) (settings types.LocalChatSettings, err error)
- func (s *Store) GetContact(user types.JID) (types.ContactInfo, error)
- func (c Store) GetFirstDevice() (*store.Device, error)
- func (s *Store) GetLatestAppStateSyncKeyID() ([]byte, error)
- func (s *Store) GetMessageSecret(chat, sender types.JID, id types.MessageID) (secret []byte, err error)
- func (s *Store) GetOrGenPreKeys(count uint32) ([]*keys.PreKey, error)
- func (s *Store) GetPreKey(id uint32) (*keys.PreKey, error)
- func (s *Store) GetPrivacyToken(user types.JID) (*store.PrivacyToken, error)
- func (s *Store) GetSenderKey(group, user string) (key []byte, err error)
- func (s *Store) GetSession(address string) (session []byte, err error)
- func (s *Store) HasSession(address string) (has bool, err error)
- func (s *Store) IsTrustedIdentity(address string, key [32]byte) (bool, error)
- func (s *Store) MarkPreKeysAsUploaded(upToID uint32) error
- func (c Store) NewDevice() *store.Device
- func (s *Store) PutAllContactNames(contacts []store.ContactEntry) error
- func (s *Store) PutAppStateMutationMACs(name string, version uint64, mutations []store.AppStateMutationMAC) error
- func (s *Store) PutAppStateSyncKey(id []byte, key store.AppStateSyncKey) error
- func (s *Store) PutAppStateVersion(name string, version uint64, hash [128]byte) error
- func (s *Store) PutArchived(chat types.JID, archived bool) error
- func (s *Store) PutBusinessName(user types.JID, businessName string) (bool, string, error)
- func (s *Store) PutContactName(user types.JID, firstName, fullName string) error
- func (c Store) PutDevice(device *store.Device) error
- func (s *Store) PutIdentity(address string, key [32]byte) error
- func (s *Store) PutMessageSecret(chat, sender types.JID, id types.MessageID, secret []byte) (err error)
- func (s *Store) PutMessageSecrets(inserts []store.MessageSecretInsert) (err error)
- func (s *Store) PutMutedUntil(chat types.JID, mutedUntil time.Time) error
- func (s *Store) PutPinned(chat types.JID, pinned bool) error
- func (s *Store) PutPrivacyTokens(tokens ...store.PrivacyToken) error
- func (s *Store) PutPushName(user types.JID, pushName string) (bool, string, error)
- func (s *Store) PutSenderKey(group, user string, session []byte) error
- func (s *Store) PutSession(address string, session []byte) error
- func (s *Store) RemovePreKey(id uint32) error
- func (s *Store) UploadedPreKeyCount() (count int, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Container *container
View Source
var Upgrades = [...]upgradeFunc{upgradeV1, upgradeV2, upgradeV3, upgradeV4, upgradeV5, upgradeV6}
Upgrades is a list of functions that will upgrade a database to the latest version.
This may be of use if you want to manage the database fully manually, but in most cases you should just call Container.Upgrade to let the library handle everything.
Functions ¶
Types ¶
type Store ¶
type Store struct { JID string // contains filtered or unexported fields }
func NewSQLStore ¶
func (*Store) DeleteAllIdentities ¶
func (*Store) DeleteAllSessions ¶
func (*Store) DeleteAppStateMutationMACs ¶
func (*Store) DeleteAppStateVersion ¶
func (Store) DeleteDevice ¶
func (*Store) DeleteIdentity ¶
func (*Store) DeleteSession ¶
func (*Store) GetAllContacts ¶
func (Store) GetAllDevices ¶
func (*Store) GetAppStateMutationMAC ¶
func (*Store) GetAppStateSyncKey ¶
func (s *Store) GetAppStateSyncKey(id []byte) (*store.AppStateSyncKey, error)
func (*Store) GetAppStateVersion ¶
func (*Store) GetChatSettings ¶
func (*Store) GetContact ¶
func (Store) GetFirstDevice ¶
func (*Store) GetLatestAppStateSyncKeyID ¶
func (*Store) GetMessageSecret ¶
func (*Store) GetOrGenPreKeys ¶
func (*Store) GetPrivacyToken ¶
func (*Store) GetSenderKey ¶
func (*Store) IsTrustedIdentity ¶
func (*Store) MarkPreKeysAsUploaded ¶
func (*Store) PutAllContactNames ¶
func (s *Store) PutAllContactNames(contacts []store.ContactEntry) error
func (*Store) PutAppStateMutationMACs ¶
func (*Store) PutAppStateSyncKey ¶
func (s *Store) PutAppStateSyncKey(id []byte, key store.AppStateSyncKey) error
func (*Store) PutAppStateVersion ¶
func (*Store) PutBusinessName ¶
func (*Store) PutContactName ¶
func (*Store) PutMessageSecret ¶
func (*Store) PutMessageSecrets ¶
func (s *Store) PutMessageSecrets(inserts []store.MessageSecretInsert) (err error)
func (*Store) PutMutedUntil ¶
func (*Store) PutPrivacyTokens ¶
func (s *Store) PutPrivacyTokens(tokens ...store.PrivacyToken) error
func (*Store) PutPushName ¶
func (*Store) RemovePreKey ¶
func (*Store) UploadedPreKeyCount ¶
Click to show internal directories.
Click to hide internal directories.