github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/message/types.go (about) 1 package p2pmsg 2 3 // ControlMessageType is the type of control message, as defined in the libp2p pubsub spec. 4 type ControlMessageType string 5 6 func (c ControlMessageType) String() string { 7 return string(c) 8 } 9 10 const ( 11 CtrlMsgRPC ControlMessageType = "RPC" 12 CtrlMsgIHave ControlMessageType = "IHAVE" 13 CtrlMsgIWant ControlMessageType = "IWANT" 14 CtrlMsgGraft ControlMessageType = "GRAFT" 15 CtrlMsgPrune ControlMessageType = "PRUNE" 16 RpcPublishMessage ControlMessageType = "RpcPublishMessage" 17 ) 18 19 // ControlMessageTypes returns list of all libp2p control message types. 20 func ControlMessageTypes() []ControlMessageType { 21 return []ControlMessageType{CtrlMsgIHave, CtrlMsgIWant, CtrlMsgGraft, CtrlMsgPrune} 22 }