dm

package
v0.3.18 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

View Source
const (
	NewWASMEventModelTag   worker.Tag = "NewWASMEventModel"
	EventUpdateCallbackTag worker.Tag = "EventUpdateCallback"

	ReceiveReplyTag     worker.Tag = "ReceiveReply"
	ReceiveReactionTag  worker.Tag = "ReceiveReaction"
	ReceiveTag          worker.Tag = "Receive"
	ReceiveTextTag      worker.Tag = "ReceiveText"
	UpdateSentStatusTag worker.Tag = "UpdateSentStatus"
	DeleteMessageTag    worker.Tag = "DeleteMessage"

	GetConversationTag  worker.Tag = "GetConversation"
	GetConversationsTag worker.Tag = "GetConversations"
)

List of tags that can be used when sending a message or registering a handler to receive a message.

Variables

This section is empty.

Functions

func NewWASMEventModel

func NewWASMEventModel(path, wasmJsPath string, encryption idbCrypto.Cipher,
	cbs bindings.DmCallbacks) (dm.EventModel, error)

NewWASMEventModel returns a [channels.EventModel] backed by a wasmModel. The name should be a base64 encoding of the users public key.

Types

type EventUpdateCallbackMessage added in v0.3.4

type EventUpdateCallbackMessage struct {
	EventType int64  `json:"eventType"`
	JsonData  []byte `json:"jsonData"`
}

EventUpdateCallbackMessage is JSON marshalled and received from the worker for the EventUpdate callback.

type MessageReceivedCallback

type MessageReceivedCallback func(uuid uint64, pubKey ed25519.PublicKey,
	messageUpdate, conversationUpdate bool)

MessageReceivedCallback is called any time a message is received or updated.

messageUpdate is true if the Message already exists and was edited. conversationUpdate is true if the Conversation was created or modified.

type NewWASMEventModelMessage

type NewWASMEventModelMessage struct {
	DatabaseName   string `json:"databaseName"`
	EncryptionJSON string `json:"encryptionJSON"`
}

NewWASMEventModelMessage is JSON marshalled and sent to the worker for NewWASMEventModel.

type TransferMessage

type TransferMessage struct {
	UUID       uint64            `json:"uuid,omitempty"`
	MessageID  message.ID        `json:"messageID,omitempty"`
	ReactionTo message.ID        `json:"reactionTo,omitempty"`
	Nickname   string            `json:"nickname,omitempty"`
	Text       []byte            `json:"text,omitempty"`
	PartnerKey ed25519.PublicKey `json:"partnerKey,omitempty"`
	SenderKey  ed25519.PublicKey `json:"senderKey,omitempty"`
	DmToken    uint32            `json:"dmToken,omitempty"`
	Codeset    uint8             `json:"codeset,omitempty"`
	Timestamp  time.Time         `json:"timestamp"`
	Round      rounds.Round      `json:"round"`
	MType      dm.MessageType    `json:"mType,omitempty"`
	Status     dm.Status         `json:"status,omitempty"`
}

TransferMessage is JSON marshalled and sent to the worker.

Jump to

Keyboard shortcuts

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