upower

package module
v0.0.0-...-f524f21 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2015 License: BSD-2-Clause Imports: 1 Imported by: 0

README

go-upower

GoDoc

Package upower provides an implementation of the Feedesktop DBus UPower Specification.

Documentation

Overview

Package upower provides an implementation of the Freedesktop UPower Specification using the DBus API.

Index

Constants

View Source
const (
	DaemonVersion = "upower.DaemonVersion"
	CanSuspend    = "upower.CanSuspend"
	CanHibernate  = "upower.CanHibernate"
	OnBattery     = "upower.OnBattery"
	OnLowBattery  = "upower.OnLowBattery"
	LidIsClosed   = "upower.LidIsClosed"
	LidIsPresent  = "upower.LidIsPresent"
)

Properties

Variables

This section is empty.

Functions

func AboutToSleep

func AboutToSleep() (err error)

This method tells UPower that the Suspend() or Hibernate() method is about to be called.

func EnumerateDevices

func EnumerateDevices() (devices []dbus.ObjectPath, err error)

Enumerate all power objects on the system.

func GetProperty

func GetProperty(p string) (v dbus.Variant, err error)

Get UPower property

func Hibernate

func Hibernate() (err error)

Hibernates the computer into a low power state.

func HibernateAllowed

func HibernateAllowed() (ok bool, err error)

Check if the caller has (or can get) the PolicyKit privilege to call Hibernate.

func SignalChanged

func SignalChanged() (ch chan *dbus.Signal, err error)

Emitted when one or more properties on the object changes.

func SignalDeviceAdded

func SignalDeviceAdded() (ch chan *dbus.Signal, call *dbus.Call, err error)

Emitted when a device is added.

func SignalDeviceChanged

func SignalDeviceChanged() (ch chan *dbus.Signal, call *dbus.Call, err error)

Emitted when a device changed.

func SignalDeviceRemoved

func SignalDeviceRemoved() (ch chan *dbus.Signal, call *dbus.Call, err error)

Emitted when a device is removed.

func SignalResuming

func SignalResuming() (ch chan *dbus.Signal, err error)

This signal is sent when the session has just returned from Suspend() or Hibernate().

func SignalSleeping

func SignalSleeping() (ch chan *dbus.Signal, err error)

This signal is sent when the session is about to be suspended or hibernated.

func Suspend

func Suspend() (err error)

Suspends the computer into a low power state.

func SuspendAllowed

func SuspendAllowed() (ok bool, err error)

Check if the caller has (or can get) the PolicyKit privilege to call Suspend.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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