Source File
remoteinfo.go
Belonging Package
github.com/tmc/go-iroh/iroh
package irohimport ()// TransportAddrUsage reports whether a remote transport address is active.type TransportAddrUsage intconst (// TransportAddrInactive means the address is known but not currently used.TransportAddrInactive TransportAddrUsage = iota// TransportAddrActive means the address is currently used.TransportAddrActive)// TransportAddrInfo is a remote transport address plus usage metadata.type TransportAddrInfo struct {Addr netaddr.TransportAddrUsage TransportAddrUsageProvenance string}// RemoteInfo is a snapshot of known addressing information for a remote// endpoint.type RemoteInfo struct {ID key.EndpointIDAddrs []TransportAddrInfo}func remoteInfoFromSocket( socket.RemoteInfo) RemoteInfo {:= make([]TransportAddrInfo, 0, len(.Addrs))for , := range .Addrs {= append(, TransportAddrInfo{Addr: .Addr,Usage: transportAddrUsageFromSocket(.Usage),Provenance: .Provenance,})}return RemoteInfo{ID: .ID, Addrs: }}func transportAddrUsageFromSocket( socket.TransportAddrUsage) TransportAddrUsage {if == socket.TransportAddrActive {return TransportAddrActive}return TransportAddrInactive}
![]() |
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |