github.com/vantum/vantum@v0.0.0-20180815184342-fe37d5f7a990/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  }