Documentation ¶
Index ¶
Constants ¶
View Source
const ( Request MessageType = "request" Reply MessageType = "reply" Cancel MessageType = "cancel" Flood MessageType = "flood" Echo MessageType = "echo" Short MessageType = "short" Ask CommandType = "ask" Detect CommandType = "detect" Liberate CommandType = "liberate" Unknown CommandType = "unknown" )
Variables ¶
This section is empty.
Functions ¶
func BuildMessage ¶
func BuildMessage(myId int, c clock.LogicalClock, messageType MessageType, weight float64, initiatorId int, initiatedAt int) string
Types ¶
type CommandType ¶
type CommandType string
func IdentifyCommand ¶
func IdentifyCommand(command string) CommandType
type LiberateCommand ¶
func ParseLiberateCommand ¶
func ParseLiberateCommand(command string, numPorts int) *LiberateCommand
type Message ¶
type Message struct { SenderId int `json:"id"` Text string `json:"type"` ClockStr string `json:"clock_str"` Weight float64 `json:"weight"` InitiatorId int `json:"initiator_id"` InitiatedAt int `json:"initiated_at"` }
func ParseMessage ¶
type MessageType ¶
type MessageType string
func (MessageType) String ¶
func (m MessageType) String() string
type RequestCommand ¶
func ParseRequestCommand ¶
func ParseRequestCommand(command string, numPorts int) *RequestCommand
Click to show internal directories.
Click to hide internal directories.