ws

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PeerIdBroadcastMessage        = MessageType{MsgType: "peer", MsgStage: 10}
	DeviceMessage                 = MessageType{MsgType: "device", MsgStage: 20}       // new device to server (=> respond with pubkey)
	PubkeyMessage                 = MessageType{MsgType: "pubkey", MsgStage: 20}       // server to new device (=> start TSS on new device)
	PubkeyAckMessage              = MessageType{MsgType: "pubkey-ack", MsgStage: 30}   // new device to server (=> start TSS msg management on server registerHandler)
	MetadataMessage               = MessageType{MsgType: "metadata", MsgStage: 20}     // old device to server (before TSS) ; server to new device (after TSS)
	MetadataAckMessage            = MessageType{MsgType: "metadata-ack", MsgStage: 30} // server to old device (=> start TSS)
	TssMessage                    = MessageType{MsgType: "tss", MsgStage: 40}
	TssDoneMessage                = MessageType{MsgType: "tss-done", MsgStage: 50}
	EverythingStoredClientMessage = MessageType{MsgType: "stored-client", MsgStage: 70}
	ExistingDeviceDoneMessage     = MessageType{MsgType: "existing-device-done", MsgStage: 80}
	NewDeviceDoneMessage          = MessageType{MsgType: "new-device-done", MsgStage: 80}
	ErrorMessage                  = MessageType{MsgType: "error", MsgStage: 0}
)

Functions

func ProcessErrors

func ProcessErrors(errs chan error, ctx context.Context, c *websocket.Conn, functionName string) error

func TssSend

func TssSend(getNextMessageToSend func() (tss.Message, error), serverDone chan struct{}, errs chan error, ctx context.Context, c *websocket.Conn, functionName string)

TssSend loops through TSS messages to be sent through the websocket connection Note : this is the v2 of tss.Send() used for AddDevice and Dkg (for now, Sign still uses tss.Send())

Types

type Message

type Message struct {
	Type MessageType `json:"type"`
	Msg  string      `json:"payload"`
}

type MessageType

type MessageType struct {
	MsgType  string `json:"msgType"`
	MsgStage uint32 `json:"msgStage"`
}

Jump to

Keyboard shortcuts

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