github.com/aergoio/aergo@v1.3.1/p2p/p2pcommon/subprotocol_string.go (about) 1 // Code generated by "stringer -type=SubProtocol"; DO NOT EDIT. 2 3 package p2pcommon 4 5 import "strconv" 6 7 const ( 8 _SubProtocol_name_0 = "StatusRequestPingRequestPingResponseGoAwayAddressesRequestAddressesResponse" 9 _SubProtocol_name_1 = "GetBlocksRequestGetBlocksResponseGetBlockHeadersRequestGetBlockHeadersResponse" 10 _SubProtocol_name_2 = "NewBlockNoticeGetAncestorRequestGetAncestorResponseGetHashesRequestGetHashesResponseGetHashByNoRequestGetHashByNoResponse" 11 _SubProtocol_name_3 = "GetTXsRequestGetTXsResponseNewTxNotice" 12 _SubProtocol_name_4 = "BlockProducedNotice" 13 _SubProtocol_name_5 = "GetClusterRequestGetClusterResponseRaftWrapperMessage" 14 ) 15 16 var ( 17 _SubProtocol_index_0 = [...]uint8{0, 13, 24, 36, 42, 58, 75} 18 _SubProtocol_index_1 = [...]uint8{0, 16, 33, 55, 78} 19 _SubProtocol_index_2 = [...]uint8{0, 14, 32, 51, 67, 84, 102, 121} 20 _SubProtocol_index_3 = [...]uint8{0, 13, 27, 38} 21 _SubProtocol_index_5 = [...]uint8{0, 17, 35, 53} 22 ) 23 24 func (i SubProtocol) String() string { 25 switch { 26 case 1 <= i && i <= 6: 27 i -= 1 28 return _SubProtocol_name_0[_SubProtocol_index_0[i]:_SubProtocol_index_0[i+1]] 29 case 16 <= i && i <= 19: 30 i -= 16 31 return _SubProtocol_name_1[_SubProtocol_index_1[i]:_SubProtocol_index_1[i+1]] 32 case 22 <= i && i <= 28: 33 i -= 22 34 return _SubProtocol_name_2[_SubProtocol_index_2[i]:_SubProtocol_index_2[i+1]] 35 case 32 <= i && i <= 34: 36 i -= 32 37 return _SubProtocol_name_3[_SubProtocol_index_3[i]:_SubProtocol_index_3[i+1]] 38 case i == 48: 39 return _SubProtocol_name_4 40 case 12545 <= i && i <= 12547: 41 i -= 12545 42 return _SubProtocol_name_5[_SubProtocol_index_5[i]:_SubProtocol_index_5[i+1]] 43 default: 44 return "SubProtocol(" + strconv.FormatInt(int64(i), 10) + ")" 45 } 46 }