github.com/neatio-net/neatio@v1.7.3-0.20231114194659-f4d7a2226baa/network/p2p/discv5/nodeevent_string.go (about)

     1  // Code generated by "stringer -type=nodeEvent"; DO NOT EDIT.
     2  
     3  package discv5
     4  
     5  import "strconv"
     6  
     7  const (
     8  	_nodeEvent_name_0 = "invalidEventpingPacketpongPacketfindnodePacketneighborsPacketfindnodeHashPackettopicRegisterPackettopicQueryPackettopicNodesPacket"
     9  	_nodeEvent_name_1 = "pongTimeoutpingTimeoutneighboursTimeout"
    10  )
    11  
    12  var (
    13  	_nodeEvent_index_0 = [...]uint8{0, 12, 22, 32, 46, 61, 79, 98, 114, 130}
    14  	_nodeEvent_index_1 = [...]uint8{0, 11, 22, 39}
    15  )
    16  
    17  func (i nodeEvent) String() string {
    18  	switch {
    19  	case 0 <= i && i <= 8:
    20  		return _nodeEvent_name_0[_nodeEvent_index_0[i]:_nodeEvent_index_0[i+1]]
    21  	case 265 <= i && i <= 267:
    22  		i -= 265
    23  		return _nodeEvent_name_1[_nodeEvent_index_1[i]:_nodeEvent_index_1[i+1]]
    24  	default:
    25  		return "nodeEvent(" + strconv.FormatInt(int64(i), 10) + ")"
    26  	}
    27  }