tailnet

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventHeartbeats = "tailnet_coordinator_heartbeat"

	HeartbeatPeriod  = time.Second * 2
	MissedHeartbeats = 3
)

Variables

This section is empty.

Functions

func CoordinatorHTTPDebug added in v2.5.0

func CoordinatorHTTPDebug(data HTMLDebugHA) func(w http.ResponseWriter, _ *http.Request)

func NewCoordinator

func NewCoordinator(logger slog.Logger, ps pubsub.Pubsub) (agpl.Coordinator, error)

NewCoordinator creates a new high availability coordinator that uses PostgreSQL pubsub to exchange handshakes.

func NewPGCoord

func NewPGCoord(ctx context.Context, logger slog.Logger, ps pubsub.Pubsub, store database.Store) (agpl.Coordinator, error)

NewPGCoord creates a high-availability coordinator that stores state in the PostgreSQL database and receives notifications of updates via the pubsub.

func NewPGCoordV2 added in v2.5.0

func NewPGCoordV2(ctx context.Context, logger slog.Logger, ps pubsub.Pubsub, store database.Store) (agpl.CoordinatorV2, error)

NewPGCoordV2 creates a high-availability coordinator that stores state in the PostgreSQL database and receives notifications of updates via the pubsub.

func ServeWorkspaceProxy

func ServeWorkspaceProxy(ctx context.Context, conn net.Conn, ma agpl.MultiAgentConn) error

Types

type HTMLAgent added in v2.5.0

type HTMLAgent struct {
	Name         string
	ID           uuid.UUID
	CreatedAge   time.Duration
	LastWriteAge time.Duration
	Overwrites   int
	Connections  []*HTMLClient
}

type HTMLClient added in v2.5.0

type HTMLClient struct {
	Name         string
	ID           uuid.UUID
	CreatedAge   time.Duration
	LastWriteAge time.Duration
}

type HTMLCoordinator added in v2.5.0

type HTMLCoordinator struct {
	ID           uuid.UUID
	HeartbeatAge time.Duration
}

type HTMLDebug added in v2.5.0

type HTMLDebug struct {
	Coordinators []*HTMLCoordinator
	Peers        []*HTMLPeer
	Tunnels      []*HTMLTunnel
}

type HTMLDebugHA added in v2.5.0

type HTMLDebugHA struct {
	HA            bool
	Agents        []*HTMLAgent
	MissingAgents []*HTMLAgent
	Nodes         []*HTMLNode
}

func HTTPDebugFromLocal added in v2.5.0

func HTTPDebugFromLocal(
	ha bool,
	agentSocketsMap map[uuid.UUID]agpl.Queue,
	agentToConnectionSocketsMap map[uuid.UUID]map[uuid.UUID]agpl.Queue,
	nodesMap map[uuid.UUID]*agpl.Node,
	agentNameCache *lru.Cache[uuid.UUID, string],
) HTMLDebugHA

type HTMLNode added in v2.5.0

type HTMLNode struct {
	ID   uuid.UUID
	Name string
	Node any
}

type HTMLPeer added in v2.5.0

type HTMLPeer struct {
	ID            uuid.UUID
	CoordinatorID uuid.UUID
	LastWriteAge  time.Duration
	Node          string
	Status        database.TailnetStatus
}

type HTMLTunnel added in v2.5.0

type HTMLTunnel struct {
	CoordinatorID uuid.UUID
	SrcID         uuid.UUID
	DstID         uuid.UUID
	LastWriteAge  time.Duration
}

Jump to

Keyboard shortcuts

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