github.com/aergoio/aergo@v1.3.1/p2p/p2pcommon/internalservice.go (about)

     1  /*
     2   * @file
     3   * @copyright defined in aergo/LICENSE.txt
     4   */
     5  
     6  package p2pcommon
     7  
     8  import (
     9  	"github.com/aergoio/aergo/types"
    10  )
    11  
    12  // InternalService provides informations of self node and reference of other p2p components.
    13  // This service is intended to be used inside p2p modules, and using outside of p2p is not expected.
    14  type InternalService interface {
    15  	//NetworkTransport
    16  	SelfMeta() PeerMeta
    17  	SelfNodeID() types.PeerID
    18  	// SelfRole shows role of this mode
    19  	SelfRole() PeerRole
    20  
    21  	// accessors of other modules
    22  	GetChainAccessor() types.ChainAccessor
    23  	//GetConsensusAccessor() consensus.ConsensusAccessor
    24  
    25  	// TODO add other methods
    26  }
    27  //go:generate mockgen -source=internalservice.go  -package=p2pmock -destination=../p2pmock/mock_internalservice.go