tailscale

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSelfInfo

func GetSelfInfo(client Client) (hostname string, ips []string, err error)

GetSelfInfo returns information about the current Tailscale node

func ListenOnTailscale

func ListenOnTailscale(hostClient Client, port int) (net.Listener, error)

ListenOnTailscale listens on the Tailscale network if available

Types

type Client

type Client interface {
	Status(ctx context.Context) (*ipnstate.Status, error)
}

Client provides a unified interface for both tsnet and host tailscaled

func GetHostClient

func GetHostClient() (Client, error)

GetHostClient attempts to connect to the host's tailscaled

func GetTsnetClient

func GetTsnetClient(server *tsnet.Server) (Client, error)

GetTsnetClient creates a client from a tsnet server

type Mode

type Mode string

Mode represents how we're connecting to Tailscale

const (
	ModeHost  Mode = "host"  // Using host's tailscaled
	ModeTsnet Mode = "tsnet" // Using embedded tsnet
)

Jump to

Keyboard shortcuts

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