Documentation
¶
Index ¶
- type ConversationSummary
- type MessageQuery
- type MessageStats
- type MessageStore
- func (ms *MessageStore) CleanupOldMessages() error
- func (ms *MessageStore) Close() error
- func (ms *MessageStore) GetConversations(limit int) ([]ConversationSummary, error)
- func (ms *MessageStore) GetMessageCount() (int, error)
- func (ms *MessageStore) GetMessageStats() (*MessageStats, error)
- func (ms *MessageStore) GetMessages(query MessageQuery) ([]protocol.Message, error)
- func (ms *MessageStore) GetMessagesByCallsign(callsign string, limit int, offset int) ([]protocol.Message, error)
- func (ms *MessageStore) GetRecentMessages(limit int) ([]protocol.Message, error)
- func (ms *MessageStore) GetUnreadCount() (int, error)
- func (ms *MessageStore) GetUnreadMessages() ([]protocol.Message, error)
- func (ms *MessageStore) MarkMessagesAsRead(callsign string) error
- func (ms *MessageStore) SearchMessages(searchTerm string, limit int) ([]protocol.Message, error)
- func (ms *MessageStore) StoreMessage(msg protocol.Message, direction string, messageType string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConversationSummary ¶
type ConversationSummary struct {
Callsign string `json:"callsign"`
LastMessageID int `json:"last_message_id"`
LastMessageTime time.Time `json:"last_message_time"`
LastMessageText string `json:"last_message_text"`
UnreadCount int `json:"unread_count"`
TotalMessages int `json:"total_messages"`
}
ConversationSummary represents a conversation with a callsign
type MessageQuery ¶
type MessageQuery struct {
Limit int
Offset int
Since *time.Time
Until *time.Time
Callsign string
Direction string // "RX", "TX", or "" for both
MessageType string
UnreadOnly bool
}
MessageQuery represents query parameters for retrieving messages
type MessageStats ¶
type MessageStats struct {
TotalMessages int `json:"total_messages"`
TotalRX int `json:"total_rx"`
TotalTX int `json:"total_tx"`
LastCleanup time.Time `json:"last_cleanup"`
}
MessageStats represents database statistics
type MessageStore ¶
type MessageStore struct {
// contains filtered or unexported fields
}
MessageStore handles persistent storage of JS8 messages
func NewMessageStore ¶
func NewMessageStore(dbPath string, maxMessages int) (*MessageStore, error)
NewMessageStore creates a new message store with SQLite backend
func (*MessageStore) CleanupOldMessages ¶
func (ms *MessageStore) CleanupOldMessages() error
CleanupOldMessages removes messages beyond the maximum limit (exported for manual cleanup)
func (*MessageStore) Close ¶
func (ms *MessageStore) Close() error
Close closes the database connection
func (*MessageStore) GetConversations ¶
func (ms *MessageStore) GetConversations(limit int) ([]ConversationSummary, error)
GetConversations retrieves conversation summaries
func (*MessageStore) GetMessageCount ¶
func (ms *MessageStore) GetMessageCount() (int, error)
GetMessageCount returns the total number of messages
func (*MessageStore) GetMessageStats ¶
func (ms *MessageStore) GetMessageStats() (*MessageStats, error)
GetMessageStats retrieves database statistics
func (*MessageStore) GetMessages ¶
func (ms *MessageStore) GetMessages(query MessageQuery) ([]protocol.Message, error)
GetMessages retrieves messages based on query parameters
func (*MessageStore) GetMessagesByCallsign ¶
func (ms *MessageStore) GetMessagesByCallsign(callsign string, limit int, offset int) ([]protocol.Message, error)
GetMessagesByCallsign retrieves all messages for a specific callsign
func (*MessageStore) GetRecentMessages ¶
func (ms *MessageStore) GetRecentMessages(limit int) ([]protocol.Message, error)
GetRecentMessages retrieves the most recent messages
func (*MessageStore) GetUnreadCount ¶
func (ms *MessageStore) GetUnreadCount() (int, error)
GetUnreadCount returns the total number of unread messages
func (*MessageStore) GetUnreadMessages ¶
func (ms *MessageStore) GetUnreadMessages() ([]protocol.Message, error)
GetUnreadMessages retrieves all unread messages
func (*MessageStore) MarkMessagesAsRead ¶
func (ms *MessageStore) MarkMessagesAsRead(callsign string) error
MarkMessagesAsRead marks messages as read for a specific callsign
func (*MessageStore) SearchMessages ¶
SearchMessages performs a full-text search on message content
func (*MessageStore) StoreMessage ¶
func (ms *MessageStore) StoreMessage(msg protocol.Message, direction string, messageType string) error
StoreMessage stores a message in the database