netif

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInterfaceDown = errors.New("interface has no address; is the VPN connection up?")

Functions

This section is empty.

Types

type Interface

type Interface struct {
	Type        string `json:"type" yaml:"type"`
	State       string `json:"state" yaml:"status"`
	Description string `json:"description" yaml:"description"`
	SystemName  string `json:"system_name" yaml:"system_name"`
	DefaultGW   bool   `json:"defaultgw" yaml:"defaultgw"`
	Global      bool   `json:"global" yaml:"global"`
	Address     string `json:"address" yaml:"address"`
}

type Manager

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

func NewInterfaceManager

func NewInterfaceManager(outputFile string) *Manager

func (*Manager) AddInterface

func (m *Manager) AddInterface(id string) error

func (*Manager) DeleteInterface

func (m *Manager) DeleteInterface(id string) error

func (*Manager) FetchInterfaces

func (m *Manager) FetchInterfaces() (map[string]Interface, error)

func (*Manager) LoadInterfacesFromFile

func (m *Manager) LoadInterfacesFromFile() (*VPNInterfaces, error)

func (*Manager) LookupTracked

func (m *Manager) LookupTracked(name string) (Interface, bool)

func (*Manager) LookupTrackedType

func (m *Manager) LookupTrackedType(name string) (string, bool)

func (*Manager) SystemNameResolver

func (m *Manager) SystemNameResolver() func(id string) (string, error)

type VPNInterfaces

type VPNInterfaces struct {
	Interfaces map[string]Interface `yaml:"interfaces"`
}

Jump to

Keyboard shortcuts

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