mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
all: standardize on PeerAPI
Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
parent
1b56acf513
commit
22238d897b
@ -24,7 +24,7 @@ type WhoIsResponse struct {
|
||||
type FileTarget struct {
|
||||
Node *tailcfg.Node
|
||||
|
||||
// PeerAPI is the http://ip:port URL base of the node's peer API,
|
||||
// PeerAPI is the http://ip:port URL base of the node's PeerAPI,
|
||||
// without any path (not even a single slash).
|
||||
PeerAPIURL string
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ func NewLocalBackend(logf logger.Logf, logid string, store ipn.StateStore, state
|
||||
}
|
||||
}
|
||||
if !wiredPeerAPIPort {
|
||||
b.logf("[unexpected] failed to wire up peer API port for engine %T", e)
|
||||
b.logf("[unexpected] failed to wire up PeerAPI port for engine %T", e)
|
||||
}
|
||||
|
||||
for _, component := range debuggableComponents {
|
||||
@ -2003,7 +2003,7 @@ func (b *LocalBackend) pingPeerAPI(ctx context.Context, ip netip.Addr) (peer *ta
|
||||
}
|
||||
base := peerAPIBase(nm, peer)
|
||||
if base == "" {
|
||||
return nil, "", fmt.Errorf("no peer API base found for peer %v (%v)", peer.ID, ip)
|
||||
return nil, "", fmt.Errorf("no PeerAPI base found for peer %v (%v)", peer.ID, ip)
|
||||
}
|
||||
outReq, err := http.NewRequestWithContext(ctx, "HEAD", base, nil)
|
||||
if err != nil {
|
||||
@ -2718,8 +2718,8 @@ func (b *LocalBackend) fileRootLocked(uid tailcfg.UserID) string {
|
||||
return dir
|
||||
}
|
||||
|
||||
// closePeerAPIListenersLocked closes any existing peer API listeners
|
||||
// and clears out the peer API server state.
|
||||
// closePeerAPIListenersLocked closes any existing PeerAPI listeners
|
||||
// and clears out the PeerAPI server state.
|
||||
//
|
||||
// It does not kick off any Hostinfo update with new services.
|
||||
//
|
||||
|
@ -461,7 +461,7 @@ type peerAPIListener struct {
|
||||
// and urlStr are still populated.
|
||||
ln net.Listener
|
||||
|
||||
// urlStr is the base URL to access the peer API (http://ip:port/).
|
||||
// urlStr is the base URL to access the PeerAPI (http://ip:port/).
|
||||
urlStr string
|
||||
// port is just the port of urlStr.
|
||||
port int
|
||||
@ -529,7 +529,7 @@ func (pln *peerAPIListener) ServeConn(src netip.AddrPort, c net.Conn) {
|
||||
go httpServer.Serve(netutil.NewOneConnListener(c, pln.ln.Addr()))
|
||||
}
|
||||
|
||||
// peerAPIHandler serves the Peer API for a source specific client.
|
||||
// peerAPIHandler serves the PeerAPI for a source specific client.
|
||||
type peerAPIHandler struct {
|
||||
ps *peerAPIServer
|
||||
remoteAddr netip.AddrPort
|
||||
|
@ -341,7 +341,7 @@ func (d *Dialer) dialPeerAPI(ctx context.Context, network, addr string) (net.Con
|
||||
}
|
||||
|
||||
// getPeerDialer returns the *net.Dialer to use to dial peers to use
|
||||
// peer API.
|
||||
// PeerAPI.
|
||||
//
|
||||
// This is not used in netstack mode.
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user