mirror of
https://github.com/tailscale/tailscale.git
synced 2026-10-23 03:37:19 +09:00
ipn/ipnext: add NodeBackend.NodeBy{Addr,ID}
The immediate use case is feature/conn25 identifying the connector peer node that responds to a DoH request. Updates tailscale/corp#46169 Signed-off-by: Michael Ben-Ami <mzb@tailscale.com>
This commit is contained in:
1 parent
e915ebc42a
commit
e310c02787
1 file changed
+8
@@ -557,6 +557,14 @@ type NodeBackend interface {
|
|||||||
// Self returns the current node.
|
// Self returns the current node.
|
||||||
Self() tailcfg.NodeView
|
Self() tailcfg.NodeView
|
||||||
|
|
||||||
|
// NodeByAddr returns the ID of the node that owns
|
||||||
|
// the given IP address, or ok=false if there is none.
|
||||||
|
NodeByAddr(netip.Addr) (_ tailcfg.NodeID, ok bool)
|
||||||
|
|
||||||
|
// NodeByID returns the node with the given ID,
|
||||||
|
// or ok=false if there is none.
|
||||||
|
NodeByID(tailcfg.NodeID) (_ tailcfg.NodeView, ok bool)
|
||||||
|
|
||||||
// AppendMatchingPeers appends all peers that match the predicate
|
// AppendMatchingPeers appends all peers that match the predicate
|
||||||
// to the base slice and returns it.
|
// to the base slice and returns it.
|
||||||
AppendMatchingPeers(base []tailcfg.NodeView, pred func(tailcfg.NodeView) bool) []tailcfg.NodeView
|
AppendMatchingPeers(base []tailcfg.NodeView, pred func(tailcfg.NodeView) bool) []tailcfg.NodeView
|
||||||
|
|||||||
Reference in new issue
Block a user