netutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMMetered
	NetworkManagerMeteredUnknown  = 0
	NetworkManagerMeteredYes      = 1
	NetworkManagerMeteredNo       = 2
	NetworkManagerMeteredGuessYes = 3
	NetworkManagerMeteredGuessNo  = 4
)

Variables

This section is empty.

Functions

func ActivationListeners

func ActivationListeners() (lns map[string]net.Listener, err error)

ActivationListeners builds a map of addresses to listeners that were passed during systemd activation

func GetListener

func GetListener(socketPath string, listenerMap map[string]net.Listener) (net.Listener, error)

GetListener tries to get a listener for the given socket path from the listener map, and if it fails it tries to set it up directly.

func IsOnMeteredConnection

func IsOnMeteredConnection() (bool, error)

IsOnMeteredConnection checks whether the current default network connection is metered. If the state can not be determined, returns false and an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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