network

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package network provides LAN interface discovery and Tailscale detection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasTailscale

func HasTailscale() bool

HasTailscale returns true if a tailscale0 interface exists and is up.

func PrintQR

func PrintQR(url string)

PrintQR renders a QR code for url to stdout.

func RenderPNG

func RenderPNG(text string) ([]byte, error)

RenderPNG encodes text as a QR code PNG. rsc.io/qr is already an indirect dependency (qrterminal above imports it for terminal rendering) and its Code.PNG() writes a bare-bones PNG directly — no new external dependency, no image.Image round-trip.

Types

type LAN

type LAN struct {
	IP          string
	Name        string
	IsTailscale bool
}

LAN represents a discovered LAN network interface.

func LocalAddresses

func LocalAddresses() []LAN

LocalAddresses returns non-loopback IPv4 addresses, RFC1918 sorted first. Each entry carries the interface name and a Tailscale flag.

Jump to

Keyboard shortcuts

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