storage

package
v0.0.0-...-707b42e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DMStore

type DMStore interface {
	SaveDM(dm models.EncryptedDM) error
	GetDMsForUser(userID string, messageType string, limit int) ([]models.EncryptedDM, error)
	GetDMsBetweenUsers(userID1, userID2 string, limit int) ([]models.EncryptedDM, error)
	MarkDMAsRead(messageID, userID string) error
	DeleteDMForUser(messageID, userID string) error
	DeleteDMsBetweenUsers(user1, user2 string) error
}

type GroupStore

type GroupStore interface {
	CreateGroup(groupID string, creatorID string) error
	AddGroupMember(groupID, userID string) error
	RemoveGroupMember(groupID, userID string) error
	GetGroupMembers(groupID string) ([]string, error)

	SaveSenderKey(key models.SenderKey) error
	GetGroupSenderKeys(groupID string) ([]models.SenderKey, error)
	IncrementKeyVersion(groupID string) error

	SaveGroupMessage(msg models.EncryptedGroupMessage) error
	GetGroupMessages(groupID string, limit int) ([]models.EncryptedGroupMessage, error)
}

type KeyStore

type KeyStore interface {
	SaveIdentityKey(userID string, registration models.KeyRegistration) error
	GetPreKeyBundle(userID string) (*models.PreKeyBundle, error)
	AddOneTimePreKeys(userID string, prekeys []models.OneTimePreKey) error
	MarkPreKeyUsed(userID string, keyID int) error
	GetUnusedPreKeyCount(userID string) (int, error)

	// Kyber prekey support (post-quantum resistant)
	AddKyberPreKeys(userID string, prekeys []models.KyberPreKey) error
	GetUnusedKyberPreKey(userID string) (*models.KyberPreKey, error)
	MarkKyberPreKeyUsed(userID string, keyID int) error
	GetUnusedKyberPreKeyCount(userID string) (int, error)
}

type SpaceStore

type SpaceStore interface {
	// DM space management
	CreateDMSpace(spaceID, user1ID, user2ID string, enableE2E bool) error
	FindDMSpace(user1ID, user2ID string) (*models.DMSpace, error)
	GetUserDMSpaces(userID string) ([]models.DMSpace, error)

	// E2E space management
	CreateE2EGroupSpace(spaceID, createdBy string, memberIDs []string) error
	GetE2ESpace(spaceID string) (*models.E2ESpace, error)
	EnableE2EForSpace(spaceID string) error
	IsSpaceMember(spaceID, userID string) (bool, error)

	// Session management
	SessionExists(userID, peerID string) (bool, error)
}

type Store

type Store interface {
	KeyStore
	GroupStore
	SpaceStore
	DMStore
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL