Help us shape the future of Go! Take the 2026 Go Developer Survey

netmap

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: BSD-3-Clause Imports: 9 Imported by: 54

Documentation

Overview

Package netmap contains the netmap.NetworkMap type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkMap

type NetworkMap struct {
	SelfNode   *tailcfg.Node
	NodeKey    tailcfg.NodeKey
	PrivateKey wgkey.Private
	Expiry     time.Time
	// Name is the DNS name assigned to this node.
	Name          string
	Addresses     []netaddr.IPPrefix
	LocalPort     uint16 // used for debugging
	MachineStatus tailcfg.MachineStatus
	MachineKey    tailcfg.MachineKey
	Peers         []*tailcfg.Node // sorted by Node.ID
	DNS           tailcfg.DNSConfig
	Hostinfo      tailcfg.Hostinfo
	PacketFilter  []filter.Match

	// CollectServices reports whether this node's Tailnet has
	// requested that info about services be included in HostInfo.
	// If set, Hostinfo.ShieldsUp blocks services collection; that
	// takes precedence over this field.
	CollectServices bool

	// DERPMap is the last DERP server map received. It's reused
	// between updates and should not be modified.
	DERPMap *tailcfg.DERPMap

	// Debug knobs from control server for debug or feature gating.
	Debug *tailcfg.Debug

	User   tailcfg.UserID
	Domain string
	// TODO(crawshaw): reduce UserProfiles to []tailcfg.UserProfile?
	// There are lots of ways to slice this data, leave it up to users.
	UserProfiles map[tailcfg.UserID]tailcfg.UserProfile
}

func (*NetworkMap) Concise

func (nm *NetworkMap) Concise() string

func (*NetworkMap) ConciseDiffFrom

func (b *NetworkMap) ConciseDiffFrom(a *NetworkMap) string

func (*NetworkMap) JSON

func (nm *NetworkMap) JSON() string

func (*NetworkMap) MagicDNSSuffix

func (nm *NetworkMap) MagicDNSSuffix() string

MagicDNSSuffix returns the domain's MagicDNS suffix (even if MagicDNS isn't necessarily in use).

It will neither start nor end with a period.

func (*NetworkMap) String

func (nm *NetworkMap) String() string

type WGConfigFlags

type WGConfigFlags int

WGConfigFlags is a bitmask of flags to control the behavior of the wireguard configuration generation done by NetMap.WGCfg.

const (
	AllowSingleHosts WGConfigFlags = 1 << iota
	AllowSubnetRoutes
)

Jump to

Keyboard shortcuts

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