Documentation
¶
Index ¶
- Variables
- type Container
- func (c *Container) DeleteDevice(ctx context.Context, device *DeviceData) error
- func (c *Container) DeviceByACI(ctx context.Context, aci uuid.UUID) (*Device, error)
- func (c *Container) GetAllDevices(ctx context.Context) ([]*Device, error)
- func (c *Container) PutDevice(ctx context.Context, device *DeviceData) error
- func (c *Container) Upgrade(ctx context.Context) error
- type Device
- func (d *Device) ClearDeviceKeys(ctx context.Context) error
- func (d *Device) ClearPassword(ctx context.Context) error
- func (d *Device) DeleteDevice(ctx context.Context) error
- func (d *Device) IdentityStore(serviceID libsignalgo.ServiceID) libsignalgo.IdentityKeyStore
- func (d *Device) IsDeviceLoggedIn() bool
- func (d *Device) PreKeyStore(serviceID libsignalgo.ServiceID) PreKeyStore
- func (d *Device) SessionStore(serviceID libsignalgo.ServiceID) SessionStore
- type DeviceData
- type DeviceStore
- type GroupStore
- type IdentityKeyStore
- type PreKeyStore
- type RecipientStore
- type RecipientUpdaterFunc
- type ServiceScopedStore
- type SessionStore
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDeviceIDMustBeSet = errors.New("device aci_uuid must be known before accessing database")
ErrDeviceIDMustBeSet is the error returned by PutDevice if you try to save a device before knowing its ACI UUID.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container is a wrapper for a SQL database that can contain multiple signalmeow sessions.
func (*Container) DeleteDevice ¶
func (c *Container) DeleteDevice(ctx context.Context, device *DeviceData) error
DeleteDevice deletes the given device from this database
func (*Container) DeviceByACI ¶
GetDevice finds the device with the specified ACI UUID in the database. If the device is not found, nil is returned instead.
func (*Container) GetAllDevices ¶
GetAllDevices finds all the devices in the database.
type Device ¶
type Device struct {
DeviceData
// libsignalgo store interfaces
ACIPreKeyStore PreKeyStore
PNIPreKeyStore PreKeyStore
ACISessionStore SessionStore
PNISessionStore SessionStore
ACIIdentityStore libsignalgo.IdentityKeyStore
PNIIdentityStore libsignalgo.IdentityKeyStore
IdentityKeyStore IdentityKeyStore
SenderKeyStore libsignalgo.SenderKeyStore
GroupStore GroupStore
RecipientStore RecipientStore
DeviceStore DeviceStore
}
Device is a wrapper for a signalmeow session, including device data, and interfaces for operating on the DB within the session.
func (*Device) IdentityStore ¶
func (d *Device) IdentityStore(serviceID libsignalgo.ServiceID) libsignalgo.IdentityKeyStore
func (*Device) IsDeviceLoggedIn ¶
func (*Device) PreKeyStore ¶
func (d *Device) PreKeyStore(serviceID libsignalgo.ServiceID) PreKeyStore
func (*Device) SessionStore ¶
func (d *Device) SessionStore(serviceID libsignalgo.ServiceID) SessionStore
type DeviceData ¶
type DeviceData struct {
ACIIdentityKeyPair *libsignalgo.IdentityKeyPair
PNIIdentityKeyPair *libsignalgo.IdentityKeyPair
ACIRegistrationID int
PNIRegistrationID int
ACI uuid.UUID
PNI uuid.UUID
DeviceID int
Number string
Password string
MasterKey []byte
}
func (*DeviceData) ACIServiceID ¶
func (d *DeviceData) ACIServiceID() libsignalgo.ServiceID
func (*DeviceData) BasicAuthCreds ¶
func (d *DeviceData) BasicAuthCreds() (string, string)
func (*DeviceData) PNIServiceID ¶
func (d *DeviceData) PNIServiceID() libsignalgo.ServiceID
type DeviceStore ¶
type GroupStore ¶
type GroupStore interface {
MasterKeyFromGroupIdentifier(ctx context.Context, groupID types.GroupIdentifier) (types.SerializedGroupMasterKey, error)
StoreMasterKey(ctx context.Context, groupID types.GroupIdentifier, key types.SerializedGroupMasterKey) error
}
type IdentityKeyStore ¶
type IdentityKeyStore interface {
SaveIdentityKey(ctx context.Context, theirServiceID libsignalgo.ServiceID, identityKey *libsignalgo.IdentityKey) (bool, error)
GetIdentityKey(ctx context.Context, theirServiceID libsignalgo.ServiceID) (*libsignalgo.IdentityKey, error)
IsTrustedIdentity(ctx context.Context, theirServiceID libsignalgo.ServiceID, identityKey *libsignalgo.IdentityKey, direction libsignalgo.SignalDirection) (bool, error)
}
type PreKeyStore ¶
type PreKeyStore interface {
libsignalgo.PreKeyStore
libsignalgo.SignedPreKeyStore
libsignalgo.KyberPreKeyStore
ServiceScopedStore
StoreLastResortKyberPreKey(ctx context.Context, preKeyID uint32, record *libsignalgo.KyberPreKeyRecord) error
RemoveSignedPreKey(ctx context.Context, preKeyID uint32) error
RemoveKyberPreKey(ctx context.Context, preKeyID uint32) error
GetNextPreKeyID(ctx context.Context) (count, max uint32, err error)
GetNextKyberPreKeyID(ctx context.Context) (count, max uint32, err error)
IsKyberPreKeyLastResort(ctx context.Context, preKeyID uint32) (bool, error)
AllPreKeys(ctx context.Context) ([]*libsignalgo.PreKeyRecord, error)
AllNormalKyberPreKeys(ctx context.Context) ([]*libsignalgo.KyberPreKeyRecord, error)
DeleteAllPreKeys(ctx context.Context) error
}
type RecipientStore ¶
type RecipientStore interface {
LoadProfileKey(ctx context.Context, theirACI uuid.UUID) (*libsignalgo.ProfileKey, error)
StoreProfileKey(ctx context.Context, theirACI uuid.UUID, key libsignalgo.ProfileKey) error
MyProfileKey(ctx context.Context) (*libsignalgo.ProfileKey, error)
LoadAndUpdateRecipient(ctx context.Context, aci, pni uuid.UUID, updater RecipientUpdaterFunc) (*types.Recipient, error)
LoadRecipientByE164(ctx context.Context, e164 string) (*types.Recipient, error)
StoreRecipient(ctx context.Context, recipient *types.Recipient) error
UpdateRecipientE164(ctx context.Context, aci, pni uuid.UUID, e164 string) (*types.Recipient, error)
}
type RecipientUpdaterFunc ¶
type ServiceScopedStore ¶
type ServiceScopedStore interface {
GetServiceID() libsignalgo.ServiceID
}
type SessionStore ¶
type SessionStore interface {
libsignalgo.SessionStore
ServiceScopedStore
// AllSessionsForServiceID returns all sessions for the given service ID.
AllSessionsForServiceID(ctx context.Context, theirID libsignalgo.ServiceID) ([]*libsignalgo.Address, []*libsignalgo.SessionRecord, error)
// RemoveSession removes the session for the given address.
RemoveSession(ctx context.Context, address *libsignalgo.Address) error
// RemoveAllSessions removes all sessions for our ACI UUID
RemoveAllSessions(ctx context.Context) error
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.