Documentation ¶
Index ¶
- Constants
- func NewWASMEventModel(path, wasmJsPath string, encryption idbCrypto.Cipher, ...) (channels.EventModel, error)
- func NewWASMEventModelBuilder(wasmJsPath string, encryption idbCrypto.Cipher, ...) channels.EventModelBuilder
- type EncryptionStatusMessage
- type EncryptionStatusReply
- type EventUpdateCallbackMessage
- type GetMessageMessage
- type MessageUpdateInfo
- type MuteUserMessage
- type NewWASMEventModelMessage
- type ReceiveReplyMessage
- type UuidError
Constants ¶
const ( NewWASMEventModelTag worker.Tag = "NewWASMEventModel" EventUpdateCallbackTag worker.Tag = "EventUpdateCallback" JoinChannelTag worker.Tag = "JoinChannel" LeaveChannelTag worker.Tag = "LeaveChannel" ReceiveMessageTag worker.Tag = "ReceiveMessage" ReceiveReplyTag worker.Tag = "ReceiveReply" ReceiveReactionTag worker.Tag = "ReceiveReaction" UpdateFromUUIDTag worker.Tag = "UpdateFromUUID" UpdateFromMessageIDTag worker.Tag = "UpdateFromMessageID" GetMessageTag worker.Tag = "GetMessage" DeleteMessageTag worker.Tag = "DeleteMessage" MuteUserTag worker.Tag = "MuteUser" )
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.ChannelUICallbacks) (channels.EventModel, error)
NewWASMEventModel returns a channels.EventModel backed by a wasmModel. The name should be a base64 encoding of the users public key.
func NewWASMEventModelBuilder ¶
func NewWASMEventModelBuilder(wasmJsPath string, encryption idbCrypto.Cipher, channelCbs bindings.ChannelUICallbacks) channels.EventModelBuilder
NewWASMEventModelBuilder returns an EventModelBuilder which allows the channel manager to define the path but the callback is the same across the board.
Types ¶
type EncryptionStatusMessage ¶
type EncryptionStatusMessage struct { DatabaseName string `json:"databaseName"` EncryptionStatus bool `json:"encryptionStatus"` }
EncryptionStatusMessage is JSON marshalled and received from the worker when the database checks if it is encrypted.
type EncryptionStatusReply ¶
type EncryptionStatusReply struct { EncryptionStatus bool `json:"encryptionStatus"` Error string `json:"error"` }
EncryptionStatusReply is JSON marshalled and sent to the worker is response to the EncryptionStatusMessage.
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 GetMessageMessage ¶
type GetMessageMessage struct { Message channels.ModelMessage `json:"message"` Error string `json:"error"` }
GetMessageMessage is JSON marshalled and sent to the worker for [wasmModel.GetMessage].
type MessageUpdateInfo ¶
type MessageUpdateInfo struct { UUID uint64 `json:"uuid"` MessageID message.ID `json:"messageID"` MessageIDSet bool `json:"messageIDSet"` Timestamp time.Time `json:"timestamp"` TimestampSet bool `json:"timestampSet"` RoundID id.Round `json:"round"` RoundIDSet bool `json:"roundIDSet"` Pinned bool `json:"pinned"` PinnedSet bool `json:"pinnedSet"` Hidden bool `json:"hidden"` HiddenSet bool `json:"hiddenSet"` Status channels.SentStatus `json:"status"` StatusSet bool `json:"statusSet"` }
MessageUpdateInfo is JSON marshalled and sent to the worker for [wasmModel.UpdateFromMessageID] and [wasmModel.UpdateFromUUID].
type MuteUserMessage ¶
type MuteUserMessage struct { ChannelID *id.ID `json:"channelID"` PubKey ed25519.PublicKey `json:"pubKey"` Unmute bool `json:"unmute"` }
MuteUserMessage is JSON marshalled and sent to the worker for [wasmModel.MuteUser].
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 ReceiveReplyMessage ¶
type ReceiveReplyMessage struct { ReactionTo message.ID `json:"replyTo"` channels.ModelMessage `json:"message"` }
ReceiveReplyMessage is JSON marshalled and sent to the worker for [wasmModel.ReceiveReply].