login1

package
v0.0.0-...-d3cd4ed Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: Apache-2.0 Imports: 4 Imported by: 16

Documentation

Overview

Package login1 provides integration with the systemd logind API. See http://www.freedesktop.org/wiki/Software/systemd/logind/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

Conn is a connection to systemds dbus endpoint.

func New

func New() (*Conn, error)

New establishes a connection to the system bus and authenticates.

func (*Conn) Close

func (c *Conn) Close()

Close closes the dbus connection

func (*Conn) GetSession

func (c *Conn) GetSession(id string) (dbus.ObjectPath, error)

GetSession may be used to get the session object path for the session with the specified ID.

func (*Conn) Inhibit

func (c *Conn) Inhibit(what, who, why, mode string) (*os.File, error)

Inhibit takes inhibition lock in logind.

func (*Conn) ListSessions

func (c *Conn) ListSessions() ([]Session, error)

ListSessions returns an array with all current sessions.

func (*Conn) ListUsers

func (c *Conn) ListUsers() ([]User, error)

ListUsers returns an array with all currently logged in users.

func (*Conn) LockSession

func (c *Conn) LockSession(id string)

LockSession asks the session with the specified ID to activate the screen lock.

func (*Conn) LockSessions

func (c *Conn) LockSessions()

LockSessions asks all sessions to activate the screen locks. This may be used to lock any access to the machine in one action.

func (*Conn) PowerOff

func (c *Conn) PowerOff(askForAuth bool)

PowerOff asks logind for a power off optionally asking for auth.

func (*Conn) Reboot

func (c *Conn) Reboot(askForAuth bool)

Reboot asks logind for a reboot optionally asking for auth.

func (*Conn) Subscribe

func (c *Conn) Subscribe(members ...string) chan *dbus.Signal

Subscribe to signals on the logind dbus

func (*Conn) TerminateSession

func (c *Conn) TerminateSession(id string)

TerminateSession forcibly terminate one specific session.

func (*Conn) TerminateUser

func (c *Conn) TerminateUser(uid uint32)

TerminateUser forcibly terminates all processes of a user.

type Session

type Session struct {
	ID   string
	UID  uint32
	User string
	Seat string
	Path dbus.ObjectPath
}

Session object definition.

type User

type User struct {
	UID  uint32
	Name string
	Path dbus.ObjectPath
}

User object definition.

Jump to

Keyboard shortcuts

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