Documentation
¶
Index ¶
- func AddLogger(l zerolog.Logger)
- func BuildCallRequestMessage(users []string, expiry uint64, srvuid string) ([]byte, string, error)
- func BuildProcessedMessage(messageUid string, peer_uid string, processed int64) (*meowlib.PackedUserMessage, string, error)
- func BuildReceivedMessage(messageUid string, peer_uid string, received int64) (*meowlib.PackedUserMessage, string, error)
- func ConsumeInboxFile(messageFilename string) ([]string, []string, string, error)
- func CreateAndStoreUserMessage(message string, peer_uid string, replyToUid string, filelist []string) (*meowlib.PackedUserMessage, string, int64, string, error)
- func CreateStorePackUserMessageForServer(message string, srvuid string, peer_uid string, replyToUid string, ...) ([]byte, string, error)
- func CreateUserMessageAndSendJob(storagePath, message, peerUid, replyToUid string, filelist []string, ...) error
- func LoadMessagesHistory(peer_uid string) ([]client.InternalUserMessage, string, error)
- func LongPollAllServerJobs(storage_path string, jobs []client.RequestsJob, timeout int, longPoll bool) (int, string, error)
- func MarkMessageProcessed(peerUid string, dbFile string, dbId int64) error
- func PackMessageForServer(packedMsg *meowlib.PackedUserMessage, srvuid string) ([]byte, string, error)
- func PollServer(storage_path string, job *client.RequestsJob, timeout int, longPoll bool) (int, string, error)
- func ProcessSendQueues(storagePath string) int
- func ProcessSentMessages(storagePath string) int
- func ReadAckMessageResponse()
- func ReadCallRequestResponseMessage(data []byte, srvuid string) (*meowlib.VideoData, string, error)
- func SaveCheckJobs() (string, error)
- type ReceivedMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCallRequestMessage ¶
func BuildProcessedMessage ¶
func BuildReceivedMessage ¶
func ConsumeInboxFile ¶
ConsumeInboxFile
func CreateAndStoreUserMessage ¶
func CreateAndStoreUserMessage(message string, peer_uid string, replyToUid string, filelist []string) (*meowlib.PackedUserMessage, string, int64, string, error)
CreateAndStoreUserMessage creates, signs, and stores an outbound message for peer_uid. It returns the packed (encrypted) form ready for server transport, the peer DB file UUID (dbFile), the SQLite row ID (dbId), an error context string, and any error.
func CreateUserMessageAndSendJob ¶
func CreateUserMessageAndSendJob(storagePath, message, peerUid, replyToUid string, filelist []string, servers []client.Server, timeout int) error
CreateUserMessageAndSendJob is the single entry point for sending a message. It creates and stores the user message, serialises the packed form to storagePath/outbox/{dbFile}_{dbId}, and enqueues a SendJob in storagePath/queues/{peerUid}.
func LoadMessagesHistory ¶
func LoadMessagesHistory(peer_uid string) ([]client.InternalUserMessage, string, error)
func LongPollAllServerJobs ¶
func LongPollAllServerJobs(storage_path string, jobs []client.RequestsJob, timeout int, longPoll bool) (int, string, error)
LongPollAllSerevrJobs checks for messages on a all servers defived in job file
func MarkMessageProcessed ¶
MarkMessageProcessed stamps the stored message with a processed timestamp of now(), persists the updated record, and — if the peer has SendProcessingAck enabled and the message carries a UUID — enqueues a processed acknowledgment to the peer's contact pull servers.
func PackMessageForServer ¶
func PollServer ¶
func PollServer(storage_path string, job *client.RequestsJob, timeout int, longPoll bool) (int, string, error)
PollServer checks for messages on a single server
func ProcessSendQueues ¶
ProcessSendQueues discovers every queue DB file under storagePath/queues/ and processes each queue concurrently in its own goroutine. Call this from the send isolate on wake-up notification or on a periodic timer. It returns the total number of successfully sent messages across all queues.
func ProcessSentMessages ¶
ProcessSentMessages scans every send queue under storagePath/queues/, updates the message storage entry with server delivery info for each sent job, then removes the job from the queue. Returns the number of messages updated.
The message DB location is recovered from the job's File basename, which must follow the naming convention produced by CreateUserMessageAndSendJob:
outbox/{dbFile}_{dbId}
func ReadAckMessageResponse ¶
func ReadAckMessageResponse()