mapper

package
v0.23.0-alpha4-docker-... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2024 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

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(
	node *types.Node,
	peers types.Nodes,
	derpMap *tailcfg.DERPMap,
	baseDomain string,
	dnsCfg *tailcfg.DNSConfig,
	logtail bool,
	randomClientPort bool,
) *Mapper

func (*Mapper) DERPMapResponse

func (m *Mapper) DERPMapResponse(
	mapRequest tailcfg.MapRequest,
	node *types.Node,
	derpMap *tailcfg.DERPMap,
) ([]byte, error)

func (*Mapper) FullMapResponse

func (m *Mapper) FullMapResponse(
	mapRequest tailcfg.MapRequest,
	node *types.Node,
	pol *policy.ACLPolicy,
) ([]byte, error)

FullMapResponse returns a MapResponse for the given node.

func (*Mapper) KeepAliveResponse

func (m *Mapper) KeepAliveResponse(
	mapRequest tailcfg.MapRequest,
	node *types.Node,
) ([]byte, error)

func (*Mapper) LiteMapResponse

func (m *Mapper) LiteMapResponse(
	mapRequest tailcfg.MapRequest,
	node *types.Node,
	pol *policy.ACLPolicy,
	messages ...string,
) ([]byte, error)

LiteMapResponse 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.

func (*Mapper) PeerChangedPatchResponse

func (m *Mapper) PeerChangedPatchResponse(
	mapRequest tailcfg.MapRequest,
	node *types.Node,
	changed []*tailcfg.PeerChange,
	pol *policy.ACLPolicy,
) ([]byte, error)

PeerChangedPatchResponse creates a patch MapResponse with incoming update from a state change.

func (*Mapper) PeerChangedResponse

func (m *Mapper) PeerChangedResponse(
	mapRequest tailcfg.MapRequest,
	node *types.Node,
	changed types.Nodes,
	pol *policy.ACLPolicy,
	messages ...string,
) ([]byte, error)

func (*Mapper) PeerRemovedResponse

func (m *Mapper) PeerRemovedResponse(
	mapRequest tailcfg.MapRequest,
	node *types.Node,
	removed []tailcfg.NodeID,
) ([]byte, error)

TODO(kradalby): We need some integration tests for this.

func (*Mapper) String

func (m *Mapper) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL