dbus

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const PermissionKey contextKey = "systemdPermission"

Variables

This section is empty.

Functions

func IsDBusNameTaken

func IsDBusNameTaken(dbusName string) (bool, error)

IsDBusNameTaken checks if the dbus name is already taken.

Types

type DbusAuth added in v0.2.0

type DbusAuth struct {
	*dbus.Conn

	Timeout  uint32
	DbusName string
	DbusPath string
	// contains filtered or unexported fields
}

func SetupDBus

func SetupDBus(dbusName, dbusPath string) (*DbusAuth, error)

setup the dbus authorization call back. Creates AuthWrite and AuthRead dbus methods so that authorization can be done by another process calliing this methods.

func (*DbusAuth) AuthRead added in v0.2.0

func (a *DbusAuth) AuthRead(sender dbus.Sender) *dbus.Error

read authorization method exposed to dbus

func (*DbusAuth) AuthRegister added in v0.2.0

func (a *DbusAuth) AuthRegister(sender dbus.Sender) *dbus.Error

Just register the sender for further call backs

func (*DbusAuth) AuthWrite added in v0.2.0

func (a *DbusAuth) AuthWrite(sender dbus.Sender) *dbus.Error

write authorization method exposed to dbus

func (*DbusAuth) Deauthorize added in v0.2.0

func (a *DbusAuth) Deauthorize() *dbus.Error

Deauthorize revokes the authorization

func (*DbusAuth) IsLocal added in v0.2.0

func (a *DbusAuth) IsLocal() bool

IsLocal checks if the current session is local.

func (*DbusAuth) IsReadAuthorized added in v0.2.0

func (a *DbusAuth) IsReadAuthorized(ctx context.Context) (bool, error)

Check if read was authorized. Triggers also a call back via dbus if read was authorized at another time

func (*DbusAuth) IsWriteAuthorized added in v0.2.0

func (a *DbusAuth) IsWriteAuthorized(ctx context.Context) (bool, error)

Jump to

Keyboard shortcuts

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