Documentation
¶
Index ¶
- type Mapper
- func (m *Mapper) DERPMapResponse(mapRequest tailcfg.MapRequest, node *types.Node, derpMap *tailcfg.DERPMap) ([]byte, error)
- func (m *Mapper) FullMapResponse(mapRequest tailcfg.MapRequest, node *types.Node, messages ...string) ([]byte, error)
- func (m *Mapper) KeepAliveResponse(mapRequest tailcfg.MapRequest, node *types.Node) ([]byte, error)
- func (m *Mapper) ListNodes(nodeIDs ...types.NodeID) (types.Nodes, error)
- func (m *Mapper) ListPeers(nodeID types.NodeID, peerIDs ...types.NodeID) (types.Nodes, error)
- func (m *Mapper) PeerChangedPatchResponse(mapRequest tailcfg.MapRequest, node *types.Node, changed []*tailcfg.PeerChange) ([]byte, error)
- func (m *Mapper) PeerChangedResponse(mapRequest tailcfg.MapRequest, node *types.Node, changed map[types.NodeID]bool, ...) ([]byte, error)
- func (m *Mapper) ReadOnlyMapResponse(mapRequest tailcfg.MapRequest, node *types.Node, messages ...string) ([]byte, error)
- func (m *Mapper) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mapper ¶
type Mapper struct {
// contains filtered or unexported fields
}
func NewMapper ¶
func NewMapper( db *db.HSDatabase, cfg *types.Config, derpMap *tailcfg.DERPMap, notif *notifier.Notifier, polMan policy.PolicyManager, primary *routes.PrimaryRoutes, ) *Mapper
func (*Mapper) DERPMapResponse ¶
func (*Mapper) FullMapResponse ¶
func (m *Mapper) FullMapResponse( mapRequest tailcfg.MapRequest, node *types.Node, messages ...string, ) ([]byte, error)
FullMapResponse returns a MapResponse for the given node.
func (*Mapper) KeepAliveResponse ¶
func (*Mapper) ListNodes ¶ added in v0.26.0
ListNodes queries the database for either all nodes if no parameters are given or for the given nodes if at least one node ID is given as parameter
func (*Mapper) ListPeers ¶
ListPeers returns peers of node, regardless of any Policy or if the node is expired. If no peer IDs are given, all peers are returned. If at least one peer ID is given, only these peer nodes will be returned.
func (*Mapper) PeerChangedPatchResponse ¶
func (m *Mapper) PeerChangedPatchResponse( mapRequest tailcfg.MapRequest, node *types.Node, changed []*tailcfg.PeerChange, ) ([]byte, error)
PeerChangedPatchResponse creates a patch MapResponse with incoming update from a state change.
func (*Mapper) PeerChangedResponse ¶
func (*Mapper) ReadOnlyMapResponse ¶
func (m *Mapper) ReadOnlyMapResponse( mapRequest tailcfg.MapRequest, node *types.Node, messages ...string, ) ([]byte, error)
ReadOnlyMapResponse returns a MapResponse for the given node. Lite means that the peers has been omitted, this is intended to be used to answer MapRequests with OmitPeers set to true.