constella

package module
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RELAY = getEnv("RELAY", "https://example.com")

Functions

func AddrInfo

func AddrInfo(addr ma.Multiaddr) (*peer.AddrInfo, error)

automatically add /p2p/<peerID> to the multiaddr if it is missing this is a workaround for the issue that AddrInfoFromP2pAddr does not work without /p2p/<peerID> https://github.com/libp2p/go-libp2p/issues/1040

func AsErrPeerIDMismatch

func AsErrPeerIDMismatch(err error) *sec.ErrPeerIDMismatch

func RandID

func RandID() peer.ID

func Run

func Run(args []string) error

Types

type ConnStats

type ConnStats struct {
	Stats
	RemotePeer peer.ID                 `json:"remotePeer"`
	NumStreams int                     `json:"numStreams"`
	ConnState  network.ConnectionState `json:"connState"`
	Streams    []StreamStats           `json:"streams"`
}

type Constella

type Constella struct {
	host.Host
}

func New

func New() *Constella

func (*Constella) Connectedness

func (c *Constella) Connectedness() map[string]string

func (*Constella) Conns

func (c *Constella) Conns() map[string]ConnStats

func (*Constella) Info

func (c *Constella) Info() Info

func (*Constella) ServeHTTP

func (c *Constella) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Info

type Info struct {
	ID            peer.ID              `json:"id"`
	Addrs         []ma.Multiaddr       `json:"addrs"`
	Peers         []peer.ID            `json:"peers"`
	Conns         map[string]ConnStats `json:"conns"`
	Connectedness map[string]string    `json:"connectedness"`
	AddrInfos     []peer.AddrInfo      `json:"addrInfos"`
	Protocols     []protocol.ID        `json:"protocols"`
}

type Stats

type Stats struct {
	Direction string    `json:"direction"`
	Opened    time.Time `json:"opened"`
	Limited   bool      `json:"limited"`
}

type StreamStats

type StreamStats struct {
	Stats
	ID       string      `json:"id"`
	Protocol protocol.ID `json:"protocol"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL