unit

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Unit

type Unit struct {
	UnitPath   dbus.ObjectPath
	DbusObject dbus.BusObject

	ID                     string
	LoadState              string
	ActiveState            string
	SubState               string
	UnitFileState          string
	ActiveEnterTimestamp   time.Time
	ActiveExitTimestamp    time.Time
	InactiveEnterTimestamp time.Time
	InactiveExitTimestamp  time.Time
}

Unit struct providing some properties from dbus interface org.freedesktop.systemd1.Unit

func New

func New(conn *dbus.Conn, unitName *string) (*Unit, error)

New gets the dbus properties for unitName and returns a struct

func (*Unit) GetProperty

func (u *Unit) GetProperty(path string) (dbus.Variant, error)

func (*Unit) GetPropertyBool

func (u *Unit) GetPropertyBool(path string) (bool, error)

func (*Unit) GetPropertyInt32ToInt

func (u *Unit) GetPropertyInt32ToInt(path string) (int, error)

func (*Unit) GetPropertyString

func (u *Unit) GetPropertyString(path string) (string, error)

func (*Unit) GetPropertyUInt64ToInt

func (u *Unit) GetPropertyUInt64ToInt(path string) (int, error)

func (*Unit) GetPropertyUInt64ToUnix

func (u *Unit) GetPropertyUInt64ToUnix(path string) (time.Time, error)

Jump to

Keyboard shortcuts

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