sys

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRoute

func AddRoute(destination, gateway string) error

AddRoute adds a new static route with the given parameters.

func Command

func Command(cmd string, agrs ...any) (string, error)

Command execute command and return output and error.

func CreateTun

func CreateTun(name, ip string, mtu uint32) error

CreateTun creates a new TUN device with the given parameters.

func DeleteTun

func DeleteTun(name string) error

DeleteTun deletes the given TUN device.

func GetOriginalDNS

func GetOriginalDNS() []string

func RestoreDNS

func RestoreDNS(currentAddr string) error

func SetDNS

func SetDNS(dns []string) error

Types

type DNSConfig added in v1.0.1

type DNSConfig struct {
	Servers []string
}

type NetworkService added in v1.0.1

type NetworkService struct {
	Name      string
	Device    string
	DNSConfig *DNSConfig
	GatewayIP string
}

Jump to

Keyboard shortcuts

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