Documentation
¶
Index ¶
Constants ¶
View Source
const ( SignatureSessionID = "signatures" AcrossSessionID = "across" MayanSessionID = "mayan" RhinestoneSessionID = "rhinestone" )
View Source
const HealthTimeout = 10 * time.Second
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Communication ¶
type Communication interface {
// CloseSession closes and removes all streams for that session
CloseSession(sessionID string)
// Broadcast sends message to provided peers
// If error has occurred on sending any message, broadcast will be aborted and error will be sent to errChan
Broadcast(peers peer.IDSlice, msg []byte, msgType MessageType, sessionID string) error
// Subscribe subscribes provided channel to a specific message type for a provided session
// Returns SubscriptionID - unique identifier of created subscription that is used to unsubscribe from subscription
Subscribe(sessionID string, msgType MessageType, channel chan *WrappedMessage) SubscriptionID
// UnSubscribe unsubscribes from subscription defined by provided SubscriptionID
UnSubscribe(subID SubscriptionID)
}
Communication defines methods for communicating between peers
type CommunicationError ¶
func ExecuteCommHealthCheck ¶
func ExecuteCommHealthCheck(communication Communication, peers peer.IDSlice) []*CommunicationError
func (*CommunicationError) Error ¶
func (ce *CommunicationError) Error() string
type MessageType ¶
type MessageType int64
MessageType represents message type identificator
const ( // TssKeyGenMsg message type used for communicating key generation. TssKeyGenMsg MessageType = iota // TssKeySignMsg message type used for communicating signature for specific message. TssKeySignMsg // TssInitiateMsg message type sent by the leader to signify preparation for a tss process. TssInitiateMsg // TssStartMsg message type sent by a leader to signify the start of a tss process after parties sent the ready message. TssStartMsg // TssFailMsg message type sent by parties after an communication or tss error happens during process. TssFailMsg // TssReadyMsg message type sent by coordinator sent if the process fails. TssReadyMsg TssReshareMsg // CoordinatorElectionMsg message type used to communicate that new election process needs to start. CoordinatorElectionMsg // CoordinatorAliveMsg message type used to respond on CoordinatorElectionMsg message, signaling that peer is alive and ready for new election process. CoordinatorAliveMsg // CoordinatorLeaveMsg message type used to communicate that peer is going offline and will not participate in the future. CoordinatorLeaveMsg // CoordinatorSelectMsg message type used to communicate that sender has pronounced itself as a leader. CoordinatorSelectMsg // CoordinatorPingMsg message type used to check if the current coordinator is alive. CoordinatorPingMsg // CoordinatorPingResponseMsg message type used to respond on CoordinatorPingMsg message. CoordinatorPingResponseMsg // SignatureMsg message type is used to the share the signature to all relayers SignatureMsg // AcrossMsg message type is used for the process coordinator to share across data AcrossMsg // MayanMsg message type is used for the process coordinator to share mayan data MayanMsg // Rhinestone message type is used for the process coordinator to share rhinestone data RhinestoneMsg // Unknown message type Unknown )
func (MessageType) String ¶
func (msgType MessageType) String() string
String implements fmt.Stringer
type SubscriptionID ¶
type SubscriptionID string
SubscriptionID is unique identifier for each subscription It is defined as: SessionID-MessageType-SubscriptionIdentifier
func NewSubscriptionID ¶
func NewSubscriptionID(sessionID string, msgType MessageType) SubscriptionID
func (SubscriptionID) MessageType ¶
func (sID SubscriptionID) MessageType() MessageType
func (SubscriptionID) SessionID ¶
func (sID SubscriptionID) SessionID() string
func (SubscriptionID) SubscriptionIdentifier ¶
func (sID SubscriptionID) SubscriptionIdentifier() string
func (SubscriptionID) Unwrap ¶
func (sID SubscriptionID) Unwrap() (string, MessageType, string, error)
type WrappedMessage ¶
type WrappedMessage struct {
MessageType MessageType `json:"message_type"`
SessionID string `json:"message_id"`
Payload []byte `json:"payload"`
From peer.ID `json:"-"`
}
WrappedMessage is a structure representing a raw message that is sent trough Communication
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mock_comm is a generated GoMock package.
|
Package mock_comm is a generated GoMock package. |
|
mock/conn
Package mock_network is a generated GoMock package.
|
Package mock_network is a generated GoMock package. |
|
mock/host
Package mock_host is a generated GoMock package.
|
Package mock_host is a generated GoMock package. |
|
mock/stream
Package mock_network is a generated GoMock package.
|
Package mock_network is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.