Documentation
¶
Index ¶
- func AddLogger(l zerolog.Logger)
- func BuildAckMessage(messageUid string, srvuid string, peer_uid string, received int64, ...) ([]byte, string, error)
- func BuildCallRequestMessage(users []string, expiry uint64, srvuid string) ([]byte, string, error)
- func ConsumeInboxFile(messageFilename string) ([]string, []string, string, error)
- func CreateAndStoreUserMessage(message string, peer_uid string, replyToUid string, filelist []string) (*meowlib.PackedUserMessage, string, error)
- func CreateStorePackUserMessageForServer(message string, srvuid string, peer_uid string, replyToUid string, ...) ([]byte, string, error)
- func GetPeerLastMessageDbInfo(peer_uid string) (dbFile string, dbId int64, errTxt string, err error)
- func InvitationAnswer(cc *meowlib.ContactCard, nickname string, myNickname string, ...) (*client.Peer, string, error)
- func InvitationAnswerFile(invitationFile string, nickname string, myNickname string, serverUids []string) (string, error)
- func InvitationAnswerMessage(invitationId string, invitationServerUid string, timeout int) ([]byte, string, error)
- func InvitationAnswerMessageReadResponse(invitationData []byte, invitationServerUid string) (*meowlib.Invitation, string, error)
- func InvitationCreateFile(name string, myNickname string, invitationMessage string, serverUids []string, ...) (*client.Peer, string, error)
- func InvitationCreateMessage(invitationId string, invitationServerUid string, timeOut int, urlLen int, ...) ([]byte, string, error)
- func InvitationCreatePeer(name string, myNickname string, invitationMessage string, serverUids []string) (*client.Peer, string, error)
- func InvitationCreateReadResponse(invitationServerUid string, invitationResponse []byte) (*meowlib.Invitation, string, error)
- func InvitationGetMessage(invitationUrl string, serverPublicKey string, invitationPassword string) ([]byte, string, error)
- func InvitationGetMessageReadResponse(invitationData []byte, invitationServerUid string) (*meowlib.ContactCard, string, error)
- func InvitationSetUrlInfo(invitationId string, url string, expiry int64)
- 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 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)
- func WriteSendJob(storagePath string, job *client.SendJob) error
- type ReceivedMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildAckMessage ¶
func BuildCallRequestMessage ¶
func ConsumeInboxFile ¶
ConsumeInboxFile
func GetPeerLastMessageDbInfo ¶
func GetPeerLastMessageDbInfo(peer_uid string) (dbFile string, dbId int64, errTxt string, err error)
GetPeerLastMessageDbInfo returns the DB location of the most recently stored message for the given peer. Call this immediately after CreateAndStoreUserMessage to get the values needed for SendJob.MessageDbFile and SendJob.MessageDbId.
func InvitationAnswer ¶
func InvitationAnswer(cc *meowlib.ContactCard, nickname string, myNickname string, serverUids []string) (*client.Peer, string, error)
InvitationAnswer
func InvitationAnswerFile ¶
func InvitationAnswerFile(invitationFile string, nickname string, myNickname string, serverUids []string) (string, error)
InvitationAnswerFile
func InvitationAnswerMessage ¶
func InvitationAnswerMessage(invitationId string, invitationServerUid string, timeout int) ([]byte, string, error)
InvitationAnswerMessage
func InvitationAnswerMessageReadResponse ¶
func InvitationAnswerMessageReadResponse(invitationData []byte, invitationServerUid string) (*meowlib.Invitation, string, error)
InvitationAnswerMessageReadResponse Called by the invitation receiver invitationData: the data received from the server invitationServerUid: the uid of the server holding the invitation
func InvitationCreateFile ¶
func InvitationCreateFile(name string, myNickname string, invitationMessage string, serverUids []string, format string) (*client.Peer, string, error)
InvitationCreateFile creates a new peer and writes the invitation to a file Called by invitation initiator name: the name of the peer myNickname: my nickname for that peer invitationMessage: the message to send to the peer serverUids: the list of server uids format: the format of the file (qr or mwiv)
func InvitationCreateMessage ¶
func InvitationCreateMessage(invitationId string, invitationServerUid string, timeOut int, urlLen int, password string) ([]byte, string, error)
InvitationCreateMessage creates a new invitation message for an invited peer Called by invitation initiator invitationId: the invitation id of the peer invitationServerUid: the uid of the server for sending the invitation timeOut: the timeout for the invitation urlLen: the length of the invitation url password: the password for the invitation
func InvitationCreatePeer ¶
func InvitationCreatePeer(name string, myNickname string, invitationMessage string, serverUids []string) (*client.Peer, string, error)
InvitationCreatePeer creates a new peer and returns it Called by invitation initiator name: the name of the peer myNickname: my nickname for that peer invitationMessage: the message to send to the peer serverUids: the list of server uids
func InvitationCreateReadResponse ¶
func InvitationCreateReadResponse(invitationServerUid string, invitationResponse []byte) (*meowlib.Invitation, string, error)
InvitationCreateReadResponse reads the response of an invitation creation (url, expiry) Called by invitation initiator invitationServerUid: the uid of the server where we sent the invitation invitationResponse: the response we got from the server
func InvitationGetMessage ¶
func InvitationGetMessage(invitationUrl string, serverPublicKey string, invitationPassword string) ([]byte, string, error)
InvitationGetMessage Called by the invitation receiver invitationUrl: the url of server holding the invitation serverPublicKey: the public key of the server holding the invitation invitationPassword: the password of the invitation
func InvitationGetMessageReadResponse ¶
func InvitationGetMessageReadResponse(invitationData []byte, invitationServerUid string) (*meowlib.ContactCard, string, error)
InvitationGetMessageReadResponse Called by the invitation receiver invitationData: the data received from the server invitationServerUid: the uid of the server holding the invitation
func InvitationSetUrlInfo ¶
InvitationSetUrlInfo sets the url info for an invitation Called by invitation initiator invitationId: the invitation id of the peer url: the url of the invitation we got from the server
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 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.
Each SendJob must have MessageDbFile and MessageDbId set (populated via GetPeerLastMessageDbInfo right after the message is stored).
func ReadAckMessageResponse ¶
func ReadAckMessageResponse()