Documentation ¶
Overview ¶
Package store contains interfaces for storing data needed for WhatsApp multidevice.
Index ¶
- Variables
- func SetOSInfo(name string, version [3]uint32)
- type AppStateMutationMAC
- type AppStateStore
- type AppStateSyncKey
- type AppStateSyncKeyStore
- type ChatSettingsStore
- type ContactEntry
- type ContactStore
- type Device
- func (device *Device) ContainsPreKey(preKeyID uint32) bool
- func (device *Device) ContainsSession(remoteAddress *protocol.SignalAddress) bool
- func (device *Device) ContainsSignedPreKey(signedPreKeyID uint32) bool
- func (device *Device) Delete() error
- func (device *Device) DeleteAllSessions()
- func (device *Device) DeleteSession(remoteAddress *protocol.SignalAddress)
- func (device *Device) GetClientPayload() *waProto.ClientPayload
- func (device *Device) GetIdentityKeyPair() *identity.KeyPair
- func (device *Device) GetLocalRegistrationId() uint32
- func (device *Device) GetSubDeviceSessions(name string) []uint32
- func (device *Device) IsTrustedIdentity(address *protocol.SignalAddress, identityKey *identity.Key) bool
- func (device *Device) LoadPreKey(id uint32) *record.PreKey
- func (device *Device) LoadSenderKey(senderKeyName *protocol.SenderKeyName) *groupRecord.SenderKey
- func (device *Device) LoadSession(address *protocol.SignalAddress) *record.Session
- func (device *Device) LoadSignedPreKey(signedPreKeyID uint32) *record.SignedPreKey
- func (device *Device) LoadSignedPreKeys() []*record.SignedPreKey
- func (device *Device) RemovePreKey(id uint32)
- func (device *Device) RemoveSignedPreKey(signedPreKeyID uint32)
- func (device *Device) Save() error
- func (device *Device) SaveIdentity(address *protocol.SignalAddress, identityKey *identity.Key)
- func (device *Device) StorePreKey(preKeyID uint32, preKeyRecord *record.PreKey)
- func (device *Device) StoreSenderKey(senderKeyName *protocol.SenderKeyName, keyRecord *groupRecord.SenderKey)
- func (device *Device) StoreSession(address *protocol.SignalAddress, record *record.Session)
- func (device *Device) StoreSignedPreKey(signedPreKeyID uint32, record *record.SignedPreKey)
- type DeviceContainer
- type IdentityStore
- type PreKeyStore
- type SenderKeyStore
- type SessionStore
Constants ¶
This section is empty.
Variables ¶
View Source
var BaseClientPayload = &waProto.ClientPayload{ UserAgent: &waProto.UserAgent{ Platform: waProto.UserAgent_WEB.Enum(), ReleaseChannel: waProto.UserAgent_RELEASE.Enum(), AppVersion: &waProto.AppVersion{ Primary: &waVersion[0], Secondary: &waVersion[1], Tertiary: &waVersion[2], }, Mcc: proto.String("000"), Mnc: proto.String("000"), OsVersion: proto.String("0.1.0"), Manufacturer: proto.String(""), Device: proto.String("Desktop"), OsBuildNumber: proto.String("0.1.0"), LocaleLanguageIso6391: proto.String("en"), LocaleCountryIso31661Alpha2: proto.String("en"), }, WebInfo: &waProto.WebInfo{ WebSubPlatform: waProto.WebInfo_WEB_BROWSER.Enum(), }, ConnectType: waProto.ClientPayload_WIFI_UNKNOWN.Enum(), ConnectReason: waProto.ClientPayload_USER_ACTIVATED.Enum(), }
View Source
var CompanionProps = &waProto.CompanionProps{ Os: proto.String("whatsmeow"), Version: &waProto.AppVersion{ Primary: proto.Uint32(0), Secondary: proto.Uint32(1), Tertiary: proto.Uint32(0), }, PlatformType: waProto.CompanionProps_UNKNOWN.Enum(), RequireFullSync: proto.Bool(false), }
View Source
var SignalProtobufSerializer = serialize.NewProtoBufSerializer()
Functions ¶
Types ¶
type AppStateMutationMAC ¶
type AppStateStore ¶
type AppStateStore interface { PutAppStateVersion(name string, version uint64, hash [128]byte) error GetAppStateVersion(name string) (uint64, [128]byte, error) DeleteAppStateVersion(name string) error PutAppStateMutationMACs(name string, version uint64, mutations []AppStateMutationMAC) error DeleteAppStateMutationMACs(name string, indexMACs [][]byte) error GetAppStateMutationMAC(name string, indexMAC []byte) (valueMAC []byte, err error) }
type AppStateSyncKey ¶
type AppStateSyncKeyStore ¶
type AppStateSyncKeyStore interface { PutAppStateSyncKey(id []byte, key AppStateSyncKey) error GetAppStateSyncKey(id []byte) (*AppStateSyncKey, error) }
type ChatSettingsStore ¶
type ContactStore ¶
type ContactStore interface { PutPushName(user types.JID, pushName string) (bool, string, error) PutBusinessName(user types.JID, businessName string) error PutContactName(user types.JID, fullName, firstName string) error PutAllContactNames(contacts []ContactEntry) error GetContact(user types.JID) (types.ContactInfo, error) GetAllContacts() (map[types.JID]types.ContactInfo, error) }
type Device ¶
type Device struct { Log waLog.Logger NoiseKey *keys.KeyPair IdentityKey *keys.KeyPair SignedPreKey *keys.PreKey RegistrationID uint32 AdvSecretKey []byte ID *types.JID Account *waProto.ADVSignedDeviceIdentity Platform string BusinessName string PushName string Initialized bool Identities IdentityStore Sessions SessionStore PreKeys PreKeyStore SenderKeys SenderKeyStore AppStateKeys AppStateSyncKeyStore AppState AppStateStore Contacts ContactStore ChatSettings ChatSettingsStore Container DeviceContainer }
func (*Device) ContainsPreKey ¶
func (*Device) ContainsSession ¶
func (device *Device) ContainsSession(remoteAddress *protocol.SignalAddress) bool
func (*Device) ContainsSignedPreKey ¶
func (*Device) DeleteAllSessions ¶
func (device *Device) DeleteAllSessions()
func (*Device) DeleteSession ¶
func (device *Device) DeleteSession(remoteAddress *protocol.SignalAddress)
func (*Device) GetClientPayload ¶
func (device *Device) GetClientPayload() *waProto.ClientPayload
func (*Device) GetIdentityKeyPair ¶
func (*Device) GetLocalRegistrationId ¶
func (*Device) GetSubDeviceSessions ¶
func (*Device) IsTrustedIdentity ¶
func (*Device) LoadSenderKey ¶
func (device *Device) LoadSenderKey(senderKeyName *protocol.SenderKeyName) *groupRecord.SenderKey
func (*Device) LoadSession ¶
func (device *Device) LoadSession(address *protocol.SignalAddress) *record.Session
func (*Device) LoadSignedPreKey ¶
func (device *Device) LoadSignedPreKey(signedPreKeyID uint32) *record.SignedPreKey
func (*Device) LoadSignedPreKeys ¶
func (device *Device) LoadSignedPreKeys() []*record.SignedPreKey
func (*Device) RemovePreKey ¶
func (*Device) RemoveSignedPreKey ¶
func (*Device) SaveIdentity ¶
func (device *Device) SaveIdentity(address *protocol.SignalAddress, identityKey *identity.Key)
func (*Device) StorePreKey ¶
func (*Device) StoreSenderKey ¶
func (device *Device) StoreSenderKey(senderKeyName *protocol.SenderKeyName, keyRecord *groupRecord.SenderKey)
func (*Device) StoreSession ¶
func (device *Device) StoreSession(address *protocol.SignalAddress, record *record.Session)
func (*Device) StoreSignedPreKey ¶
func (device *Device) StoreSignedPreKey(signedPreKeyID uint32, record *record.SignedPreKey)
type DeviceContainer ¶
type IdentityStore ¶
type PreKeyStore ¶
type SenderKeyStore ¶
Click to show internal directories.
Click to hide internal directories.