Documentation
¶
Index ¶
- Constants
- Variables
- type Container
- func (c *Container) Close() error
- func (c *Container) DeleteDevice(device *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
- func (c *Container) Upgrade() error
- type DataAppVersion
- type DataContact
- type DataDevice
- type DataMessageSecret
- type DataPrekey
- type DataPrivacyToken
- type DataStateSyncKey
- type MongoStore
- func (m *MongoStore) DeleteAllIdentities(phone string) error
- func (m *MongoStore) DeleteAllSessions(phone string) error
- func (m *MongoStore) DeleteAppStateMutationMACs(name string, indexMACs [][]byte) error
- func (m *MongoStore) DeleteAppStateVersion(name string) error
- func (m *MongoStore) DeleteIdentity(address string) error
- func (m *MongoStore) DeleteSession(address string) error
- func (m *MongoStore) GenOnePreKey() (key *keys.PreKey, err error)
- func (m *MongoStore) GetAllContacts() (map[types.JID]types.ContactInfo, error)
- func (m *MongoStore) GetAppStateMutationMAC(name string, indexMAC []byte) ([]byte, error)
- func (m *MongoStore) GetAppStateSyncKey(id []byte) (key *store.AppStateSyncKey, err error)
- func (m *MongoStore) GetAppStateVersion(name string) (version uint64, hash [128]byte, err error)
- func (m *MongoStore) GetChatSettings(chat types.JID) (types.LocalChatSettings, error)
- func (m *MongoStore) GetContact(user types.JID) (types.ContactInfo, error)
- func (m *MongoStore) GetLatestAppStateSyncKeyID() ([]byte, error)
- func (m *MongoStore) GetMessageSecret(chat, sender types.JID, id types.MessageID) ([]byte, error)
- func (m *MongoStore) GetOrGenPreKeys(count uint32) ([]*keys.PreKey, error)
- func (m *MongoStore) GetPreKey(keyID uint32) (*keys.PreKey, error)
- func (m *MongoStore) GetPrivacyToken(user types.JID) (*store.PrivacyToken, error)
- func (m *MongoStore) GetSenderKey(chatID string, senderID string) (key []byte, err error)
- func (m *MongoStore) GetSession(address string) ([]byte, error)
- func (m *MongoStore) HasSession(address string) (ok bool, err error)
- func (m *MongoStore) IsTrustedIdentity(address string, key [32]byte) (ok bool, err error)
- func (m *MongoStore) MarkPreKeysAsUploaded(keyID uint32) error
- func (m *MongoStore) PutAllContactNames(contacts []store.ContactEntry) error
- func (m *MongoStore) PutAppStateMutationMACs(name string, version uint64, mutations []store.AppStateMutationMAC) error
- func (m *MongoStore) PutAppStateSyncKey(id []byte, key store.AppStateSyncKey) error
- func (m *MongoStore) PutAppStateVersion(name string, version uint64, hash [128]byte) error
- func (m *MongoStore) PutArchived(chat types.JID, archived bool) error
- func (m *MongoStore) PutBusinessName(user types.JID, businessName string) (bool, string, error)
- func (m *MongoStore) PutContactName(user types.JID, firstName, fullName string) error
- func (m *MongoStore) PutIdentity(address string, key [32]byte) error
- func (m *MongoStore) PutMessageSecret(chat, sender types.JID, id types.MessageID, secret []byte) error
- func (m *MongoStore) PutMessageSecrets(inserts []store.MessageSecretInsert) error
- func (m *MongoStore) PutMutedUntil(chat types.JID, until time.Time) error
- func (m *MongoStore) PutPinned(chat types.JID, pinned bool) error
- func (m *MongoStore) PutPrivacyTokens(tokens ...store.PrivacyToken) error
- func (m *MongoStore) PutPushName(user types.JID, pushName string) (bool, string, error)
- func (m *MongoStore) PutSenderKey(chatID string, senderID string, key []byte) error
- func (m *MongoStore) PutSession(address string, session []byte) error
- func (m *MongoStore) RemovePreKey(keyID uint32) error
- func (m *MongoStore) UploadedPreKeyCount() (int, error)
Constants ¶
View Source
const ( COL_APP_STATE_MUTATION_MACS string = "whatsmeow_app_state_mutation_macs" COL_APP_STATE_SYNC_KEYS string = "whatsmeow_app_state_sync_keys" COL_APP_STATE_VERSION string = "whatsmeow_app_state_version" COL_CHAT_SETTINGS string = "whatsmeow_chat_settings" COL_CONTACTS string = "whatsmeow_contacts" COL_DEVICE string = "whatsmeow_device" COL_IDENTITY_KEYS string = "whatsmeow_identity_keys" COL_MESSAGE_SECRETS string = "whatsmeow_message_secrets" COL_PRE_KEYS string = "whatsmeow_pre_keys" COL_PRIVACY_TOKENS string = "whatsmeow_privacy_tokens" COL_SENDER_KEYS string = "whatsmeow_sender_keys" COL_SESSIONS string = "whatsmeow_sessions" COL_VERSION string = "whatsmeow_version" )
Variables ¶
View Source
var ErrDeviceIDMustBeSet = errors.New("device JID must be known before accessing database")
View Source
var ErrInvalidLength = errors.New("database returned byte array with illegal length")
View Source
var Upgrades = [...]upgradeFunc{upgradeV1}
View Source
var WHATSMEOW_COLLECTIONS = []string{ COL_APP_STATE_MUTATION_MACS, COL_APP_STATE_SYNC_KEYS, COL_APP_STATE_VERSION, COL_CHAT_SETTINGS, COL_CONTACTS, COL_DEVICE, COL_IDENTITY_KEYS, COL_MESSAGE_SECRETS, COL_PRE_KEYS, COL_PRIVACY_TOKENS, COL_SENDER_KEYS, COL_SESSIONS, COL_VERSION, }
Functions ¶
This section is empty.
Types ¶
type Container ¶
type DataAppVersion ¶
type DataContact ¶
type DataDevice ¶
type DataDevice struct { ID string `bson:"jid"` RegistrationID uint32 `bson:"registration_id"` NoiseKey []byte `bson:"noise_key"` IdentityKey []byte `bson:"identity_key"` SignedPreKey []byte `bson:"signed_pre_key"` SignedPreKeyID uint32 `bson:"signed_pre_key_id"` SignedPreKeySig []byte `bson:"signed_pre_key_sig"` AdvKey []byte `bson:"adv_key"` AdvDetails []byte `bson:"adv_details"` AdvAccountSig []byte `bson:"adv_account_sig"` AdvAccountSigKey []byte `bson:"adv_account_sig_key"` AdvDeviceSig []byte `bson:"adv_device_sig"` Platform string `bson:"platform"` BusinessName string `bson:"business_name"` PushName string `bson:"push_name"` FacebookUUID uuid.UUID `bson:"facebook_uuid"` Initialized bool `bson:"initialized"` }
type DataMessageSecret ¶
type DataPrekey ¶
type DataPrivacyToken ¶
type DataStateSyncKey ¶
type MongoStore ¶
func NewMongoStore ¶
func NewMongoStore(c *Container, jid types.JID) *MongoStore
func (*MongoStore) DeleteAllIdentities ¶
func (m *MongoStore) DeleteAllIdentities(phone string) error
func (*MongoStore) DeleteAllSessions ¶
func (m *MongoStore) DeleteAllSessions(phone string) error
func (*MongoStore) DeleteAppStateMutationMACs ¶
func (m *MongoStore) DeleteAppStateMutationMACs(name string, indexMACs [][]byte) error
func (*MongoStore) DeleteAppStateVersion ¶
func (m *MongoStore) DeleteAppStateVersion(name string) error
func (*MongoStore) DeleteIdentity ¶
func (m *MongoStore) DeleteIdentity(address string) error
func (*MongoStore) DeleteSession ¶
func (m *MongoStore) DeleteSession(address string) error
func (*MongoStore) GenOnePreKey ¶
func (m *MongoStore) GenOnePreKey() (key *keys.PreKey, err error)
func (*MongoStore) GetAllContacts ¶
func (m *MongoStore) GetAllContacts() (map[types.JID]types.ContactInfo, error)
func (*MongoStore) GetAppStateMutationMAC ¶
func (m *MongoStore) GetAppStateMutationMAC(name string, indexMAC []byte) ([]byte, error)
func (*MongoStore) GetAppStateSyncKey ¶
func (m *MongoStore) GetAppStateSyncKey(id []byte) (key *store.AppStateSyncKey, err error)
func (*MongoStore) GetAppStateVersion ¶
func (m *MongoStore) GetAppStateVersion(name string) (version uint64, hash [128]byte, err error)
func (*MongoStore) GetChatSettings ¶
func (m *MongoStore) GetChatSettings(chat types.JID) (types.LocalChatSettings, error)
func (*MongoStore) GetContact ¶
func (m *MongoStore) GetContact(user types.JID) (types.ContactInfo, error)
func (*MongoStore) GetLatestAppStateSyncKeyID ¶
func (m *MongoStore) GetLatestAppStateSyncKeyID() ([]byte, error)
func (*MongoStore) GetMessageSecret ¶
func (*MongoStore) GetOrGenPreKeys ¶
func (m *MongoStore) GetOrGenPreKeys(count uint32) ([]*keys.PreKey, error)
func (*MongoStore) GetPrivacyToken ¶
func (m *MongoStore) GetPrivacyToken(user types.JID) (*store.PrivacyToken, error)
func (*MongoStore) GetSenderKey ¶
func (m *MongoStore) GetSenderKey(chatID string, senderID string) (key []byte, err error)
func (*MongoStore) GetSession ¶
func (m *MongoStore) GetSession(address string) ([]byte, error)
func (*MongoStore) HasSession ¶
func (m *MongoStore) HasSession(address string) (ok bool, err error)
func (*MongoStore) IsTrustedIdentity ¶
func (m *MongoStore) IsTrustedIdentity(address string, key [32]byte) (ok bool, err error)
func (*MongoStore) MarkPreKeysAsUploaded ¶
func (m *MongoStore) MarkPreKeysAsUploaded(keyID uint32) error
func (*MongoStore) PutAllContactNames ¶
func (m *MongoStore) PutAllContactNames(contacts []store.ContactEntry) error
func (*MongoStore) PutAppStateMutationMACs ¶
func (m *MongoStore) PutAppStateMutationMACs(name string, version uint64, mutations []store.AppStateMutationMAC) error
func (*MongoStore) PutAppStateSyncKey ¶
func (m *MongoStore) PutAppStateSyncKey(id []byte, key store.AppStateSyncKey) error
func (*MongoStore) PutAppStateVersion ¶
func (m *MongoStore) PutAppStateVersion(name string, version uint64, hash [128]byte) error
func (*MongoStore) PutArchived ¶
func (m *MongoStore) PutArchived(chat types.JID, archived bool) error
func (*MongoStore) PutBusinessName ¶
func (*MongoStore) PutContactName ¶
func (m *MongoStore) PutContactName(user types.JID, firstName, fullName string) error
func (*MongoStore) PutIdentity ¶
func (m *MongoStore) PutIdentity(address string, key [32]byte) error
func (*MongoStore) PutMessageSecret ¶
func (*MongoStore) PutMessageSecrets ¶
func (m *MongoStore) PutMessageSecrets(inserts []store.MessageSecretInsert) error
func (*MongoStore) PutMutedUntil ¶
func (*MongoStore) PutPrivacyTokens ¶
func (m *MongoStore) PutPrivacyTokens(tokens ...store.PrivacyToken) error
func (*MongoStore) PutPushName ¶
func (*MongoStore) PutSenderKey ¶
func (m *MongoStore) PutSenderKey(chatID string, senderID string, key []byte) error
func (*MongoStore) PutSession ¶
func (m *MongoStore) PutSession(address string, session []byte) error
func (*MongoStore) RemovePreKey ¶
func (m *MongoStore) RemovePreKey(keyID uint32) error
func (*MongoStore) UploadedPreKeyCount ¶
func (m *MongoStore) UploadedPreKeyCount() (int, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.