Documentation
¶
Index ¶
- Constants
- Variables
- func FromIDToPubKey(id peer.ID) ed25519.PublicKey
- 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 p2pCrypto.PrivKey, mxs []tptu.StreamMuxer) (*noise.Transport, error)
- func NewResourceManager(limiter rcmgr.Limiter) (network.ResourceManager, error)
- func NewTCPTransport(u transport.Upgrader, r network.ResourceManager, s *tcpreuse.ConnMgr, ...) (*tcp.TcpTransport, error)
- func UnmarshalEd25519PublicKey(data []byte) (p2pCrypto.PubKey, error)
- type NodeInfo
- type NodeStats
- type P2PNode
- type PSK
- type StreamHandler
- type Swarm
- type SwarmOption
- type TCPOption
- type TCPTransport
- type WarpAddrInfo
- type WarpAddress
- type WarpAutoNAT
- type WarpBatching
- type WarpConnManager
- type WarpDHT
- type WarpError
- type WarpEventBus
- type WarpGossiper
- type WarpHandlerFunc
- type WarpIDService
- type WarpMDNS
- type WarpMessage
- type WarpNetwork
- type WarpOption
- type WarpPeerID
- type WarpPeerRouting
- type WarpPeerstore
- type WarpPrivateKey
- type WarpProtocolID
- type WarpProtocolSwitch
- type WarpProviderStore
- type WarpPubInfo
- type WarpReachability
- type WarpRelayCloser
- type WarpRoutingFunc
- type WarpStream
- type WarpStreamBody
- type WarpStreamHandler
- type WarpStreamStats
Constants ¶
View Source
const ( BootstrapOwner = "bootstrap" ModeratorOwner = "moderator" 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 PermanentTTL = peerstore.PermanentAddrTTL ErrNodeIsOffline = WarpError("node is offline") ErrUserIsOffline = WarpError("user is offline") ReachabilityPublic WarpReachability = network.ReachabilityPublic ReachabilityPrivate WarpReachability = network.ReachabilityPrivate ReachabilityUnknown WarpReachability = network.ReachabilityUnknown )
View Source
const ( RelayStatusOff relayStatus = "off" RelayStatusWaiting relayStatus = "waiting" RelayStatusRunning relayStatus = "running" )
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 relayStatus `json:"relay_state"`
BootstrapPeers []WarpAddrInfo `json:"bootstrap_peers"`
Reachability WarpReachability `json:"reachability"`
Protocols []WarpProtocolID `json:"protocols"`
}
func (NodeInfo) IsBootstrap ¶
func (NodeInfo) IsModerator ¶ added in v0.5.12
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 relayStatus `json:"relay_state"`
StartTime string `json:"start_time"`
NetworkState string `json:"network_state"`
DatabaseStats map[string]string `json:"database_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 StreamHandler ¶ added in v0.4.21
type StreamHandler = network.StreamHandler
type SwarmOption ¶
type TCPTransport ¶
type TCPTransport = tcp.TcpTransport
type WarpAddrInfo ¶
func AddrInfoFromP2pAddr ¶
func AddrInfoFromP2pAddr(m multiaddr.Multiaddr) (*WarpAddrInfo, error)
func AddrInfoFromString ¶
func AddrInfoFromString(s string) (*WarpAddrInfo, error)
type WarpAddress ¶
type WarpAutoNAT ¶ added in v0.2.494
type WarpBatching ¶
type WarpConnManager ¶ added in v0.2.494
type WarpConnManager = coreconnmgr.ConnManager
type WarpEventBus ¶ added in v0.2.494
type WarpHandlerFunc ¶ added in v0.4.21
type WarpHandlerFunc func(msg []byte, s WarpStream) (any, error)
type WarpIDService ¶ added in v0.2.494
type WarpNetwork ¶
type WarpOption ¶ added in v0.3.106
type WarpPeerID ¶
func FromBytesToPeerID ¶
func FromBytesToPeerID(b []byte) WarpPeerID
func FromStringToPeerID ¶
func FromStringToPeerID(s string) WarpPeerID
func IDFromPublicKey ¶ added in v0.2.499
func IDFromPublicKey(pk ed25519.PublicKey) (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 WarpPubInfo ¶ added in v0.2.494
type WarpPubInfo struct {
ID WarpPeerID `json:"peer_id"`
Addrs []string `json:"addrs"`
}
type WarpReachability ¶ added in v0.2.494
type WarpReachability = network.Reachability
type WarpRoutingFunc ¶
type WarpRoutingFunc func(node P2PNode) (WarpPeerRouting, error)
type WarpStream ¶
type WarpStreamBody ¶ added in v0.4.21
type WarpStreamBody struct {
WarpStream
Body []byte
}
type WarpStreamHandler ¶
type WarpStreamHandler struct {
Path WarpProtocolID
Handler WarpHandlerFunc
}
structures
func (*WarpStreamHandler) IsValid ¶ added in v0.4.21
func (wh *WarpStreamHandler) IsValid() bool
func (*WarpStreamHandler) String ¶ added in v0.4.21
func (wh *WarpStreamHandler) String() string
type WarpStreamStats ¶
Click to show internal directories.
Click to hide internal directories.