system

package
v0.30.3 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AliasIP added in v0.12.0

func AliasIP(ctx context.Context, alias string) error

func FreePort

func FreePort(preference int) (int, error)

func IsElevated

func IsElevated() (bool, error)

func UnaliasIP added in v0.12.0

func UnaliasIP(ctx context.Context, alias string) error

Types

type HostsSection added in v0.15.0

type HostsSection struct {
	// contains filtered or unexported fields
}

func NewHostsSection added in v0.15.0

func NewHostsSection(name string) (*HostsSection, error)

func (*HostsSection) Add added in v0.15.0

func (s *HostsSection) Add(address string, hosts ...string)

Add replaces the entries for address. The hosts are cloned: callers pass a slice they keep using (a tunnel's own host list), and Flush must not be able to reorder it underneath them.

func (*HostsSection) Clear added in v0.15.0

func (s *HostsSection) Clear()

func (*HostsSection) Flush added in v0.15.0

func (s *HostsSection) Flush() error

Flush rewrites this section in the hosts file, leaving the rest of it alone.

The read and the write happen under one lock. The catapult and the gateway each own a section of the same file and flush concurrently on their own refresh timers, so reading and writing under separate locks lets the later writer rebuild the file from a snapshot taken before the earlier one landed — reverting the other section, and on shutdown leaving entries behind that point at loopback aliases that no longer exist.

func (*HostsSection) Remove added in v0.15.0

func (s *HostsSection) Remove(address string)

Jump to

Keyboard shortcuts

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