Documentation ¶
Index ¶
- Variables
- func AddPeer(node *discover.Node) error
- func DoUnixGetJSONRequest(t *testing.T, endpoint string, json string) string
- func DoUnixPostJSONRequest(t *testing.T, endpoint string, json string) string
- func DoUnixPostRequest(t *testing.T, endpoint string, payload []byte, headers http.Header) string
- func DoUnixRequest(t *testing.T, endpoint string) string
- func GetExternalIP() (string, error)
- func GetPeerListSend(peer *p2p.Peer, rw p2p.MsgWriter)
- func GetPeerNodeID(id string) string
- func GetSocketClient(socketFile string) http.Client
- func InitP2PPeers(peers []model.PeerNode)
- func InitP2PServer(bootstrapNodes []*discover.Node) (*p2p.Server, error)
- func InitP2p()
- func InitRouting() (*mux.Router, *mux.Router)
- func IsPeerAlreadyAdded(parsedPeer *discover.Node) bool
- func NewServer(Hostaddr, Port string) (*http.Server, *http.Server)
- func PeerList(p2pMessage Message)
- func SendMsg(peer *p2p.Peer, rw p2p.MsgWriter, err error, outmsg Message)
- func SetLogger(loggers *logrus.Entry)
- func StartServer()
- func SubscribeP2P()
- type Message
- type Peer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //StormDBPeers is the main object for peers db StormDBPeers *storm.DB //DefaultExpirationTime is the default expiration time used on the database DefaultExpirationTime = &buntdb.SetOptions{Expires: false} // never expire //PUBLIC_SERVER_READ_TIMEOUT_STR will be used to hold env var PUBLIC_SERVER_READ_TIMEOUT_STR = os.Getenv("PUBLIC_SERVER_READ_TIMEOUT") //PUBLIC_SERVER_WRITE_TIMEOUT_STR will be used to hold env var PUBLIC_SERVER_WRITE_TIMEOUT_STR = os.Getenv("PUBLIC_SERVER_WRITE_TIMEOUT") //PRIVATE_SERVER_READ_TIMEOUT_STR will be used to hold env var PRIVATE_SERVER_READ_TIMEOUT_STR = os.Getenv("PRIVATE_SERVER_READ_TIMEOUT") //PRIVATE_SERVER_WRITE_TIMEOUT_STR will be used to hold env var PRIVATE_SERVER_WRITE_TIMEOUT_STR = os.Getenv("PRIVATE_SERVER_WRITE_TIMEOUT") //PUBLIC_SERVER_READ_TIMEOUT will be used to hold env var PUBLIC_SERVER_READ_TIMEOUT = 120 //PUBLIC_SERVER_WRITE_TIMEOUT will be used to hold env var PUBLIC_SERVER_WRITE_TIMEOUT = 120 //PRIVATE_SERVER_READ_TIMEOUT will be used to hold env var PRIVATE_SERVER_READ_TIMEOUT = 60 //PRIVATE_SERVER_WRITE_TIMEOUT will be used to hold env var PRIVATE_SERVER_WRITE_TIMEOUT = 60 )
Functions ¶
func DoUnixGetJSONRequest ¶ added in v1.0.2
DoUnixGetJSONRequest is used for test real request calls.
func DoUnixPostJSONRequest ¶ added in v1.0.2
DoUnixPostJSONRequest is used for test real request calls.
func DoUnixPostRequest ¶ added in v1.0.2
DoUnixPostRequest is used for test real request calls.
func DoUnixRequest ¶ added in v1.0.2
DoUnixRequest is used for test real request calls.
func GetPeerListSend ¶
GetPeerListSend will get peers
func GetSocketClient ¶
GetSocketClient is used for test real request calls.
func InitP2PServer ¶
InitP2PServer will init p2p peers
func IsPeerAlreadyAdded ¶
IsPeerAlreadyAdded check if peer already connected
func PeerList ¶
func PeerList(p2pMessage Message)
PeerList will init all peers provided on the p2p message
Types ¶
Click to show internal directories.
Click to hide internal directories.