Documentation
¶
Index ¶
- Constants
- Variables
- func GetCPUStats() map[string]string
- func GetMacAddr() string
- func GetMemoryStats() map[string]string
- func GetNetworkIO() (bytesSent int64, bytesRecv int64)
- func IsPublicMultiAddress(maddr WarpAddress) bool
- func IsRelayAddress(addr string) bool
- func IsRelayMultiaddress(maddr multiaddr.Multiaddr) bool
- func NewAutoScaledLimiter() rcmgr.Limiter
- func NewConnManager(limiter rcmgr.Limiter) (*connmgr.BasicConnMgr, error)
- func NewMultiaddr(s string) (a multiaddr.Multiaddr, err error)
- func NewNoise(id protocol.ID, pk crypto.PrivKey, mxs []tptu.StreamMuxer) (*noise.Transport, error)
- func NewP2PNode(opts ...libp2p.Option) (host.Host, error)
- func NewResourceManager(limiter rcmgr.Limiter) (network.ResourceManager, error)
- func NewTCPTransport(u transport.Upgrader, r network.ResourceManager, s *tcpreuse.ConnMgr, ...) (*tcp.TcpTransport, error)
- type NodeInfo
- type NodeStats
- type P2PNode
- type PSK
- type PeerAddrInfo
- type Swarm
- type SwarmOption
- type TCPOption
- type TCPTransport
- type WarpAddrInfo
- type WarpAddress
- type WarpBatching
- type WarpDHT
- type WarpError
- type WarpGossiper
- type WarpMDNS
- type WarpNetwork
- type WarpPeerID
- type WarpPeerRouting
- type WarpPeerstore
- type WarpPrivateKey
- type WarpProtocolID
- type WarpProtocolSwitch
- type WarpProviderStore
- type WarpRelayCloser
- type WarpRoutingFunc
- type WarpStream
- type WarpStreamHandler
- type WarpStreamStats
Constants ¶
View Source
const ( BootstrapOwner = "bootstrap" WarpnetName = "warpnet" NoiseID = noise.ID Connected = network.Connected Limited = network.Limited P_IP4 = multiaddr.P_IP4 P_IP6 = multiaddr.P_IP6 P_TCP = multiaddr.P_TCP PermanentAddrTTL = peerstore.PermanentAddrTTL ErrNodeIsOffline = WarpError("node is offline") ErrUserIsOffline = WarpError("user is offline") )
Variables ¶
View Source
var ErrAllDialsFailed = swarm.ErrAllDialsFailed
Functions ¶
func GetCPUStats ¶
func GetMacAddr ¶
func GetMacAddr() string
func GetMemoryStats ¶
func GetNetworkIO ¶
func IsPublicMultiAddress ¶
func IsPublicMultiAddress(maddr WarpAddress) bool
func IsRelayAddress ¶
func IsRelayMultiaddress ¶
func NewAutoScaledLimiter ¶
func NewConnManager ¶
func NewConnManager(limiter rcmgr.Limiter) (*connmgr.BasicConnMgr, error)
func NewResourceManager ¶
func NewResourceManager(limiter rcmgr.Limiter) (network.ResourceManager, error)
func NewTCPTransport ¶
Types ¶
type NodeInfo ¶
type NodeInfo struct {
OwnerId string `json:"owner_id"`
ID WarpPeerID `json:"node_id"`
Version *semver.Version `json:"version"`
Addresses []string `json:"addresses"`
StartTime time.Time `json:"start_time"`
RelayState string `json:"relay_state"`
BootstrapPeers []PeerAddrInfo `json:"bootstrap_peers"`
PSKHash string `json:"psk_hash"`
}
func (NodeInfo) IsBootstrap ¶
type NodeStats ¶
type NodeStats struct {
UserId string `json:"user_id"`
NodeID WarpPeerID `json:"node_id"`
Version *semver.Version `json:"version"`
PublicAddresses string `json:"public_addresses"`
RelayState string `json:"relay_state"`
StartTime string `json:"start_time"`
NetworkState string `json:"network_state"`
DatabaseStats map[string]string `json:"database_stats"`
ConsensusStats map[string]string `json:"consensus_stats"`
MemoryStats map[string]string `json:"memory_stats"`
CPUStats map[string]string `json:"cpu_stats"`
BytesSent int64 `json:"bytes_sent"`
BytesReceived int64 `json:"bytes_received"`
PeersOnline int `json:"peers_online"`
PeersStored int `json:"peers_stored"`
}
type PeerAddrInfo ¶
func AddrInfoFromP2pAddr ¶
func AddrInfoFromP2pAddr(m multiaddr.Multiaddr) (*PeerAddrInfo, error)
func AddrInfoFromString ¶
func AddrInfoFromString(s string) (*PeerAddrInfo, error)
type SwarmOption ¶
type WarpAddrInfo ¶
type WarpAddrInfo struct {
ID WarpPeerID `json:"peer_id"`
Addrs []string `json:"addrs"`
}
structures
type WarpAddress ¶
type WarpBatching ¶
type WarpNetwork ¶
type WarpPeerID ¶
func FromBytesToPeerID ¶
func FromBytesToPeerID(b []byte) WarpPeerID
func FromStringToPeerID ¶
func FromStringToPeerID(s string) WarpPeerID
func IDFromPrivateKey ¶
func IDFromPrivateKey(sk crypto.PrivKey) (WarpPeerID, error)
type WarpPeerRouting ¶
type WarpPeerRouting = routing.PeerRouting
type WarpPeerstore ¶
func NewPeerstore ¶
type WarpPrivateKey ¶
type WarpProtocolID ¶
type WarpProtocolSwitch ¶
type WarpProviderStore ¶
type WarpProviderStore = providers.ProviderStore
type WarpRoutingFunc ¶
type WarpRoutingFunc func(node P2PNode) (WarpPeerRouting, error)
type WarpStream ¶
type WarpStreamHandler ¶
type WarpStreamHandler = network.StreamHandler
type WarpStreamStats ¶
Click to show internal directories.
Click to hide internal directories.