Documentation ¶
Index ¶
- type Container
- func (c *Container) Close() error
- func (c *Container) DeleteDevice(store *store.Device) error
- func (c *Container) GetAllDevices() ([]*store.Device, error)
- func (c *Container) GetDevice(jid types.JID) (*store.Device, error)
- func (c *Container) GetFirstDevice() (*store.Device, error)
- func (c *Container) NewDevice() *store.Device
- func (c *Container) PutDevice(device *store.Device) error
- type Store
- 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 (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 (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 (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 (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 (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 ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct { DatabaseErrorHandler func(device *store.Device, action string, attemptIndex int, err error) (retry bool) // contains filtered or unexported fields }
Container is a wrapper for a SQL database that can contain multiple whatsmeow sessions.
func (*Container) GetAllDevices ¶
GetAllDevices finds all the devices in the database.
func (*Container) GetDevice ¶
GetDevice finds the device with the specified JID in the database.
If the device is not found, nil is returned instead.
Note that the parameter usually must be an AD-JID.
func (*Container) GetFirstDevice ¶
GetFirstDevice is a convenience method for getting the first device in the store. If there are no devices, then a new device will be created. You should only use this if you don't want to have multiple sessions simultaneously.
type Store ¶
func (*Store) DeleteAllIdentities ¶
func (*Store) DeleteAllSessions ¶
func (*Store) DeleteAppStateMutationMACs ¶
func (*Store) DeleteAppStateVersion ¶
func (*Store) DeleteIdentity ¶
func (*Store) DeleteSession ¶
func (*Store) GetAllContacts ¶
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) 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.