Documentation
¶
Index ¶
- Constants
- Variables
- func AppendRelationshipEvent(ctx context.Context, db *sql.DB, record RelationshipEventRecord) (string, error)
- func ClearOwnerE2EEData(ctx context.Context, db *sql.DB, ownerDID string) (map[string]int64, error)
- func CurrentSchemaVersion(db *sql.DB) (int, error)
- func DeleteGroupMembers(ctx context.Context, db *sql.DB, ownerDID string, groupID string, ...) (int64, error)
- func EnsureSchema(ctx context.Context, db *sql.DB) error
- func ExecuteSQL(ctx context.Context, db *sql.DB, statement string, params ...any) ([]map[string]any, error)
- func GetContactByDID(ctx context.Context, db *sql.DB, ownerDID string, did string) (map[string]any, error)
- func GetCurrentContactByHandle(ctx context.Context, db *sql.DB, ownerDID string, handle string) (map[string]any, error)
- func GetE2EEOutbox(ctx context.Context, db *sql.DB, outboxID string, ownerDID string, ...) (map[string]any, error)
- func GetGroupSnapshot(ctx context.Context, db *sql.DB, ownerDID string, groupID string) (map[string]any, error)
- func GetMessageByID(ctx context.Context, db *sql.DB, msgID string, ownerDID string, ...) (map[string]any, error)
- func ListCachedGroupMembers(ctx context.Context, db *sql.DB, ownerDID string, groupID string, limit int) ([]map[string]any, error)
- func ListDIDsByHandle(ctx context.Context, db *sql.DB, ownerDID string, handle string) ([]string, error)
- func ListDirectMessagesByPeerDIDs(ctx context.Context, db *sql.DB, ownerDID string, peerDIDs []string, limit int, ...) ([]map[string]any, error)
- func ListE2EEOutbox(ctx context.Context, db *sql.DB, ownerDID string, credentialName string, ...) ([]map[string]any, error)
- func ListGroupInboxMessages(ctx context.Context, db *sql.DB, ownerDID string, limit int, groupID string, ...) ([]map[string]any, error)
- func ListGroupMessages(ctx context.Context, db *sql.DB, ownerDID string, groupID string, limit int, ...) ([]map[string]any, error)
- func ListInboxMessages(ctx context.Context, db *sql.DB, ownerDID string, limit int, peerDID string, ...) ([]map[string]any, error)
- func ListMessagesByIDs(ctx context.Context, db *sql.DB, ownerDID string, messageIDs []string) ([]map[string]any, error)
- func ListNotificationInboxMessages(ctx context.Context, db *sql.DB, ownerDID string, limit int, unreadOnly bool) ([]map[string]any, error)
- func ListNotifications(ctx context.Context, db *sql.DB, ownerDID string, limit int) ([]map[string]any, error)
- func ListThreadMessages(ctx context.Context, db *sql.DB, ownerDID string, threadID string, limit int) ([]map[string]any, error)
- func MakeThreadID(myDID string, peerDID string, groupID string) string
- func MarkE2EEOutboxFailed(ctx context.Context, db *sql.DB, outboxID string, ownerDID string, ...) error
- func MarkE2EEOutboxSent(ctx context.Context, db *sql.DB, outboxID string, ownerDID string, ...) error
- func MarkMessagesRead(ctx context.Context, db *sql.DB, ownerDID string, messageIDs []string) (int64, error)
- func MergeRecoveredHandleLocalState(ctx context.Context, paths appconfig.Paths, oldOwnerDIDs []string, ...) (map[string]int64, map[string]int64, error)
- func Open(paths appconfig.Paths) (*sql.DB, error)
- func OpenReadOnly(path string) (*sql.DB, error)
- func QueueE2EEOutbox(ctx context.Context, db *sql.DB, record E2EEOutboxRecord) (string, error)
- func RebindLocalIdentityState(ctx context.Context, paths appconfig.Paths, oldOwnerDID string, ...) (map[string]int64, map[string]int64, error)
- func RebindOwnerDID(ctx context.Context, db *sql.DB, oldOwnerDID string, newOwnerDID string) (map[string]int64, error)
- func ReplaceGroupMembers(ctx context.Context, db *sql.DB, ownerDID string, groupID string, ...) error
- func ResolveContactHandleByDID(ctx context.Context, db *sql.DB, ownerDID string, did string) (string, error)
- func SetE2EEOutboxFailureByID(ctx context.Context, db *sql.DB, outboxID string, ownerDID string, ...) error
- func StoreMessage(ctx context.Context, db *sql.DB, record MessageRecord) error
- func StoreMessagesBatch(ctx context.Context, db *sql.DB, batch []MessageRecord) error
- func SyncGroupMemberFromSystemEvent(ctx context.Context, db *sql.DB, ownerDID string, groupID string, ...) (bool, error)
- func UpdateE2EEOutboxStatus(ctx context.Context, db *sql.DB, outboxID string, ownerDID string, ...) error
- func UpsertContact(ctx context.Context, db *sql.DB, record ContactRecord) error
- func UpsertGroup(ctx context.Context, db *sql.DB, record GroupRecord) error
- func UpsertGroupMember(ctx context.Context, db *sql.DB, record GroupMemberRecord) error
- type ContactHandleBindingRecord
- type ContactRecord
- type E2EEOutboxRecord
- type E2EESessionRecord
- type GroupMemberRecord
- type GroupRecord
- type ImportReport
- type LegacyScan
- type MessageRecord
- type OpenOptions
- type RelationshipEventRecord
Constants ¶
View Source
const (
SchemaVersion = 12
)
Variables ¶
Functions ¶
func AppendRelationshipEvent ¶
func ClearOwnerE2EEData ¶
func DeleteGroupMembers ¶
func ExecuteSQL ¶
func GetContactByDID ¶
func GetE2EEOutbox ¶
func GetGroupSnapshot ¶
func GetMessageByID ¶
func ListCachedGroupMembers ¶
func ListDIDsByHandle ¶
func ListE2EEOutbox ¶
func ListGroupInboxMessages ¶
func ListGroupMessages ¶
func ListInboxMessages ¶
func ListMessagesByIDs ¶
func ListNotifications ¶
func ListNotifications(ctx context.Context, db *sql.DB, ownerDID string, limit int) ([]map[string]any, error)
ListNotifications returns the most recent locally cached mail-notification rows for a given owner. It matches both legacy content_type-based records and current metadata.source_kind=mail records written by the runtime listener.
func ListThreadMessages ¶
func MarkE2EEOutboxFailed ¶
func MarkE2EEOutboxSent ¶
func MarkMessagesRead ¶
func QueueE2EEOutbox ¶
func RebindOwnerDID ¶
func ReplaceGroupMembers ¶
func StoreMessage ¶
func StoreMessagesBatch ¶
func UpdateE2EEOutboxStatus ¶
func UpsertContact ¶
func UpsertGroup ¶
func UpsertGroupMember ¶
Types ¶
type ContactRecord ¶
type ContactRecord struct {
OwnerDID string
DID string
Name string
Handle string
NickName string
Bio string
ProfileMD string
Tags string
Relationship string
SourceType string
SourceName string
SourceGroupID string
ConnectedAt string
RecommendedReason string
Followed *bool
Messaged *bool
Note string
FirstSeenAt string
LastSeenAt string
Metadata string
CredentialName string
}
type E2EEOutboxRecord ¶
type E2EEOutboxRecord struct {
OutboxID string
OwnerDID string
PeerDID string
SessionID string
OriginalType string
Plaintext string
LocalStatus string
AttemptCount int
SentMsgID string
SentServerSeq *int64
LastErrorCode string
RetryHint string
FailedMsgID string
FailedServerSeq *int64
Metadata string
LastAttemptAt string
CreatedAt string
UpdatedAt string
CredentialName string
}
type E2EESessionRecord ¶
type GroupMemberRecord ¶
type GroupRecord ¶
type GroupRecord struct {
OwnerDID string
GroupID string
GroupDID string
Name string
GroupMode string
Slug string
Description string
Goal string
Rules string
MessagePrompt string
DocURL string
GroupOwnerDID string
GroupOwnerHandle string
MyRole string
MembershipStatus string
JoinEnabled *bool
JoinCode string
JoinCodeExpiresAt string
MemberCount *int64
LastSyncedSeq *int64
LastReadSeq *int64
LastMessageAt string
RemoteCreatedAt string
RemoteUpdatedAt string
StoredAt string
Metadata string
CredentialName string
}
type ImportReport ¶
type LegacyScan ¶
type LegacyScan struct {
Path string `json:"path"`
Exists bool `json:"exists"`
SchemaVersion int `json:"schema_version"`
Tables []string `json:"tables,omitempty"`
}
func ScanLegacyDatabase ¶
type MessageRecord ¶
type MessageRecord struct {
MsgID string
OwnerDID string
ThreadID string
Direction int
SenderDID string
ReceiverDID string
GroupID string
GroupDID string
ContentType string
Content string
Title string
ServerSeq *int64
SentAt string
StoredAt string
IsE2EE bool
IsRead bool
SenderName string
Metadata string
CredentialName string
}
type OpenOptions ¶
type OpenOptions struct {
ReadOnly bool
}
type RelationshipEventRecord ¶
Click to show internal directories.
Click to hide internal directories.