networkd

package module
v0.0.0-...-08d42b5 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 7 Imported by: 0

README

networkd Linux Test Go Reference Go Report Card

Package networkd enables control of systemd-networkd using D-Bus. MIT Licensed.

Documentation

Overview

Package networkd enables control of systemd-networkd using D-Bus.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Manager *ManagerService
	// contains filtered or unexported fields
}

A Client can issue D-Bus requests to systemd-networkd.

func Dial

func Dial(ctx context.Context) (*Client, error)

Dial dials a D-Bus connection to systemd-networkd and returns a Client. If the service does not exist on the system bus, an error compatible with `errors.Is(err, os.ErrNotExist)` is returned.

func (*Client) Close

func (c *Client) Close() error

Close closes the underlying D-Bus connection.

type Link struct {
	Index      int
	Name       string
	ObjectPath dbus.ObjectPath
}

A Link is a network link known to systemd-networkd.

type ManagerProperties

type ManagerProperties struct {
	OperationalState string
	CarrierState     string
	AddressState     string
	IPv4AddressState string
	IPv6AddressState string
	OnlineState      string
}

ManagerProperties contains all of the D-Bus properties for the networkd Manager object.

type ManagerService

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

The ManagerService exposes methods and properties of the networkd Manager object.

func (ms *ManagerService) ListLinks(ctx context.Context) ([]Link, error)

ListLinks lists all of the network links known to systemd-networkd.

func (*ManagerService) Properties

func (ms *ManagerService) Properties(ctx context.Context) (ManagerProperties, error)

Properties fetches all D-Bus properties for the networkd Manager object.

Jump to

Keyboard shortcuts

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