Versions in this module Expand all Collapse all v1 v1.0.1 Nov 27, 2024 v1.0.0 Nov 20, 2024 Changes in this version + func CreateTables(db *sql.DB) error + func DecodeAndDeserializeKeyPair(data []byte, value interface{}) error + func ExtractUserIDAndDeviceID(registrationID uint32) (uint32, uint32) + func GenerateRegistrationID(userID, deviceID uint32) uint32 + func GetMACAddress() (string, error) + func LoadLocalIdentity(db *sql.DB, userID uint32) (identity.KeyPair, uint32, error) + func MacToUint32(macAddr string) (uint32, error) + func NewGroupStore() session.GroupStore + func NewIdentityStore(db *sql.DB) identity.Store + func NewPreKeyStore(db *sql.DB) prekey.Store + func NewSessionStore(db *sql.DB) session.Store + func NewSignedPreKeyStore(db *sql.DB) prekey.SignedStore + func SerializeKeyPairAndEncode(keyPair interface{}) ([]byte, error) + func To[T any](t T) *T + type ChatMessage struct + Delivered int + Message string + MessageID string + ReceiverID uint32 + SenderID uint32 + Timestamp time.Time + type GroupStore struct + func (g *GroupStore) Load(ctx context.Context, sender address.Address, distributionID distribution.ID) (*session.GroupRecord, bool, error) + func (g *GroupStore) Store(ctx context.Context, sender address.Address, distributionID distribution.ID, ...) error + type IdentityStore struct + func (s *IdentityStore) Clear() error + func (s *IdentityStore) IsTrustedIdentity(ctx context.Context, addr address.Address, identityKey identity.Key, ...) (bool, error) + func (s *IdentityStore) KeyPair(_ context.Context) identity.KeyPair + func (s *IdentityStore) Load(ctx context.Context, addr address.Address) (identity.Key, bool, error) + func (s *IdentityStore) LocalRegistrationID(_ context.Context) uint32 + func (s *IdentityStore) Store(ctx context.Context, addr address.Address, identityKey identity.Key) (bool, error) + type LocalIdentity struct + IdentityPublicKey []byte + PreKeyID uint32 + PreKeyPublicKey []byte + Signature []byte + SignedPreKeyID uint32 + SignedPreKeyPublicKey []byte + type PreKeyStore struct + func (s *PreKeyStore) Delete(ctx context.Context, id prekey.ID) error + func (s *PreKeyStore) Load(ctx context.Context, id prekey.ID) (*prekey.PreKey, bool, error) + func (s *PreKeyStore) Store(ctx context.Context, id prekey.ID, preKey *prekey.PreKey) error + type SQLiteStore struct + DB *sql.DB + func NewSQLiteStore(dbPath string) (*SQLiteStore, error) + func (s *SQLiteStore) CreateLocalIdentity(registrationID uint32) (*LocalIdentity, error) + func (s *SQLiteStore) DeleteMessage(messageID int64) error + func (s *SQLiteStore) GetAllChatHistory() ([]ChatMessage, error) + func (s *SQLiteStore) GetChatHistory(senderID, receiverID uint32) ([]ChatMessage, error) + func (s *SQLiteStore) GetChatHistoryBetweenUsers(senderID, receiverID uint32) ([]ChatMessage, error) + func (s *SQLiteStore) GroupStore() session.GroupStore + func (s *SQLiteStore) IdentityStore() identity.Store + func (s *SQLiteStore) PreKeyStore() prekey.Store + func (s *SQLiteStore) SaveChatMessage(messageID string, senderID, receiverID uint32, message string, delivered int) error + func (s *SQLiteStore) SessionStore() session.Store + func (s *SQLiteStore) SignedPreKeyStore() prekey.SignedStore + func (s *SQLiteStore) UpdateMessageDeliveryStatus(messageID string, delivered bool) error + type SerializableKeyPair struct + PrivateKey []byte + PublicKey []byte + type SessionStore struct + func (s *SessionStore) Load(ctx context.Context, addr address.Address) (*session.Record, bool, error) + func (s *SessionStore) Store(ctx context.Context, addr address.Address, record *session.Record) error + type SignedPreKeyStore struct + func (s *SignedPreKeyStore) Load(ctx context.Context, id prekey.ID) (*prekey.SignedPreKey, bool, error) + func (s *SignedPreKeyStore) Store(ctx context.Context, id prekey.ID, record *prekey.SignedPreKey) error