Пример #1
0
func TestMessage(level uint32, fragment FragID) *Message {
	wg := graphalg.Weight(fragment)
	return &Message{
		U: &Message_Test{
			Test: &Message_TestMsg{
				Level:    level,
				Fragment: &wg,
			},
		},
	}
}
Пример #2
0
func InitiateMessage(level uint32, fragment FragID, state NodeState) *Message {
	wg := graphalg.Weight(fragment)
	return &Message{
		U: &Message_Initiate{
			Initiate: &Message_InitiateMsg{
				Level:     level,
				Fragment:  &wg,
				NodeState: Message_InitiateMsg_NodeState(state),
			},
		},
	}
}