Documentation
¶
Index ¶
- Variables
- func CheckPeerEndpoints(ctx context.Context, waitg *sync.WaitGroup)
- func ClearPeerInfoCache()
- func FindBestEndpoint(peerIp, peerPubKey string, peerListenPort, metricsPort int)
- func GetPeerInfo() (models.HostPeerInfo, error)
- func InitialiseIfaceMetricsServer(ctx context.Context, wg *sync.WaitGroup)
- func IpBelongsToInterface(ip net.IP) bool
- func IsPeerConnected(peer wgtypes.Peer) (connected bool, err error)
- func RefreshPeerInfoCache()
- func SetPeerEndpoint(peerPubKey string, value cache.EndpointCacheValue) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // PeerConnectionCheckInterval - time interval to check peer connection status PeerConnectionCheckInterval = time.Second * 15 // LastHandShakeThreshold - threshold for considering inactive connection LastHandShakeThreshold = time.Minute * 3 // PeerLocalEndpointConnTicker *time.Ticker )
Functions ¶
func CheckPeerEndpoints ¶ added in v1.2.0
func ClearPeerInfoCache ¶ added in v1.5.1
func ClearPeerInfoCache()
ClearPeerInfoCache resets the peer info cache so the next refresh fetches fresh data.
func FindBestEndpoint ¶
FindBestEndpoint - requests against a given addr and port
func GetPeerInfo ¶ added in v1.2.0
func GetPeerInfo() (models.HostPeerInfo, error)
GetPeerInfo returns cached HostPeerInfo. If cache is empty, fetches from server and populates it.
func InitialiseIfaceMetricsServer ¶ added in v0.90.0
func IpBelongsToInterface ¶ added in v0.90.0
IpBelongsToInterface - function to check if an IP belongs to any network interface
func IsPeerConnected ¶ added in v1.2.0
isPeerConnected - get peer connection status by checking last handshake time
func RefreshPeerInfoCache ¶ added in v1.5.1
func RefreshPeerInfoCache()
RefreshPeerInfoCache fetches fresh peer info from the server and updates the cache. Uses a dedicated mutex to serialize callers and enforce a minimum interval between attempts.
func SetPeerEndpoint ¶ added in v1.0.0
func SetPeerEndpoint(peerPubKey string, value cache.EndpointCacheValue) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.