github.com/nspcc-dev/neo-go@v0.105.2-0.20240517133400-6be757af3eba/pkg/network/message_string.go (about) 1 // Code generated by "stringer -type=CommandType -output=message_string.go"; DO NOT EDIT. 2 3 package network 4 5 import "strconv" 6 7 func _() { 8 // An "invalid array index" compiler error signifies that the constant values have changed. 9 // Re-run the stringer command to generate them again. 10 var x [1]struct{} 11 _ = x[CMDVersion-0] 12 _ = x[CMDVerack-1] 13 _ = x[CMDGetAddr-16] 14 _ = x[CMDAddr-17] 15 _ = x[CMDPing-24] 16 _ = x[CMDPong-25] 17 _ = x[CMDGetHeaders-32] 18 _ = x[CMDHeaders-33] 19 _ = x[CMDGetBlocks-36] 20 _ = x[CMDMempool-37] 21 _ = x[CMDInv-39] 22 _ = x[CMDGetData-40] 23 _ = x[CMDGetBlockByIndex-41] 24 _ = x[CMDNotFound-42] 25 _ = x[CMDTX-43] 26 _ = x[CMDBlock-44] 27 _ = x[CMDExtensible-46] 28 _ = x[CMDP2PNotaryRequest-80] 29 _ = x[CMDGetMPTData-81] 30 _ = x[CMDMPTData-82] 31 _ = x[CMDReject-47] 32 _ = x[CMDFilterLoad-48] 33 _ = x[CMDFilterAdd-49] 34 _ = x[CMDFilterClear-50] 35 _ = x[CMDMerkleBlock-56] 36 _ = x[CMDAlert-64] 37 } 38 39 const ( 40 _CommandType_name_0 = "CMDVersionCMDVerack" 41 _CommandType_name_1 = "CMDGetAddrCMDAddr" 42 _CommandType_name_2 = "CMDPingCMDPong" 43 _CommandType_name_3 = "CMDGetHeadersCMDHeaders" 44 _CommandType_name_4 = "CMDGetBlocksCMDMempool" 45 _CommandType_name_5 = "CMDInvCMDGetDataCMDGetBlockByIndexCMDNotFoundCMDTXCMDBlock" 46 _CommandType_name_6 = "CMDExtensibleCMDRejectCMDFilterLoadCMDFilterAddCMDFilterClear" 47 _CommandType_name_7 = "CMDMerkleBlock" 48 _CommandType_name_8 = "CMDAlert" 49 _CommandType_name_9 = "CMDP2PNotaryRequestCMDGetMPTDataCMDMPTData" 50 ) 51 52 var ( 53 _CommandType_index_0 = [...]uint8{0, 10, 19} 54 _CommandType_index_1 = [...]uint8{0, 10, 17} 55 _CommandType_index_2 = [...]uint8{0, 7, 14} 56 _CommandType_index_3 = [...]uint8{0, 13, 23} 57 _CommandType_index_4 = [...]uint8{0, 12, 22} 58 _CommandType_index_5 = [...]uint8{0, 6, 16, 34, 45, 50, 58} 59 _CommandType_index_6 = [...]uint8{0, 13, 22, 35, 47, 61} 60 _CommandType_index_9 = [...]uint8{0, 19, 32, 42} 61 ) 62 63 func (i CommandType) String() string { 64 switch { 65 case i <= 1: 66 return _CommandType_name_0[_CommandType_index_0[i]:_CommandType_index_0[i+1]] 67 case 16 <= i && i <= 17: 68 i -= 16 69 return _CommandType_name_1[_CommandType_index_1[i]:_CommandType_index_1[i+1]] 70 case 24 <= i && i <= 25: 71 i -= 24 72 return _CommandType_name_2[_CommandType_index_2[i]:_CommandType_index_2[i+1]] 73 case 32 <= i && i <= 33: 74 i -= 32 75 return _CommandType_name_3[_CommandType_index_3[i]:_CommandType_index_3[i+1]] 76 case 36 <= i && i <= 37: 77 i -= 36 78 return _CommandType_name_4[_CommandType_index_4[i]:_CommandType_index_4[i+1]] 79 case 39 <= i && i <= 44: 80 i -= 39 81 return _CommandType_name_5[_CommandType_index_5[i]:_CommandType_index_5[i+1]] 82 case 46 <= i && i <= 50: 83 i -= 46 84 return _CommandType_name_6[_CommandType_index_6[i]:_CommandType_index_6[i+1]] 85 case i == 56: 86 return _CommandType_name_7 87 case i == 64: 88 return _CommandType_name_8 89 case 80 <= i && i <= 82: 90 i -= 80 91 return _CommandType_name_9[_CommandType_index_9[i]:_CommandType_index_9[i+1]] 92 default: 93 return "CommandType(" + strconv.FormatInt(int64(i), 10) + ")" 94 } 95 }