package login1
import "github.com/coreos/go-systemd/v22/login1"
Package login1 provides integration with the systemd logind API. See http://www.freedesktop.org/wiki/Software/systemd/logind/
Index ¶
- type Conn
- func New() (*Conn, error)
- func (c *Conn) Close()
- func (c *Conn) Connected() bool
- func (c *Conn) GetActiveSession() (dbus.ObjectPath, error)
- func (c *Conn) GetSession(id string) (dbus.ObjectPath, error)
- func (c *Conn) GetSessionDisplay(sessionPath dbus.ObjectPath) (string, error)
- func (c *Conn) GetSessionPropertiesContext(ctx context.Context, sessionPath dbus.ObjectPath) (map[string]dbus.Variant, error)
- func (c *Conn) GetSessionPropertyContext(ctx context.Context, sessionPath dbus.ObjectPath, property string) (*dbus.Variant, error)
- func (c *Conn) GetSessionUser(sessionPath dbus.ObjectPath) (*User, error)
- func (c *Conn) GetUserPropertiesContext(ctx context.Context, userPath dbus.ObjectPath) (map[string]dbus.Variant, error)
- func (c *Conn) GetUserPropertyContext(ctx context.Context, userPath dbus.ObjectPath, property string) (*dbus.Variant, error)
- func (c *Conn) Inhibit(what, who, why, mode string) (*os.File, error)
- func (c *Conn) ListSessions() ([]Session, error)
- func (c *Conn) ListSessionsContext(ctx context.Context) ([]Session, error)
- func (c *Conn) ListUsers() ([]User, error)
- func (c *Conn) ListUsersContext(ctx context.Context) ([]User, error)
- func (c *Conn) LockSession(id string)
- func (c *Conn) LockSessions()
- func (c *Conn) PowerOff(askForAuth bool)
- func (c *Conn) Reboot(askForAuth bool)
- func (c *Conn) Subscribe(members ...string) chan *dbus.Signal
- func (c *Conn) TerminateSession(id string)
- func (c *Conn) TerminateUser(uid uint32)
- type Session
- type User
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a connection to systemds dbus endpoint.
func New ¶
New establishes a connection to the system bus and authenticates.
func (*Conn) Close ¶
func (c *Conn) Close()
Close closes the dbus connection
func (*Conn) Connected ¶
Connected returns whether conn is connected
func (*Conn) GetActiveSession ¶
GetActiveSession may be used to get the session object path for the current active session
func (*Conn) GetSession ¶
GetSession may be used to get the session object path for the session with the specified ID.
func (*Conn) GetSessionDisplay ¶
GetSessionDisplay may be used to get the display for specific session
func (*Conn) GetSessionPropertiesContext ¶
func (c *Conn) GetSessionPropertiesContext(ctx context.Context, sessionPath dbus.ObjectPath) (map[string]dbus.Variant, error)
GetSessionPropertiesContext takes a session path and returns all of its dbus object properties.
func (*Conn) GetSessionPropertyContext ¶
func (c *Conn) GetSessionPropertyContext(ctx context.Context, sessionPath dbus.ObjectPath, property string) (*dbus.Variant, error)
GetSessionPropertyContext takes a session path and a property name and returns the property value.
func (*Conn) GetSessionUser ¶
GetSessionUser may be used to get the user of specific session
func (*Conn) GetUserPropertiesContext ¶
func (c *Conn) GetUserPropertiesContext(ctx context.Context, userPath dbus.ObjectPath) (map[string]dbus.Variant, error)
GetUserPropertiesContext takes a user path and returns all of its dbus object properties.
func (*Conn) GetUserPropertyContext ¶
func (c *Conn) GetUserPropertyContext(ctx context.Context, userPath dbus.ObjectPath, property string) (*dbus.Variant, error)
GetUserPropertyContext takes a user path and a property name and returns the property value.
func (*Conn) Inhibit ¶
Inhibit takes inhibition lock in logind.
func (*Conn) ListSessions ¶
Deprecated: use ListSessionsContext instead.
func (*Conn) ListSessionsContext ¶
ListSessionsContext returns an array with all current sessions.
func (*Conn) ListUsers ¶
Deprecated: use ListUsersContext instead.
func (*Conn) ListUsersContext ¶
ListUsersContext returns an array with all currently logged-in users.
func (*Conn) LockSession ¶
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 ¶
PowerOff asks logind for a power off optionally asking for auth.
func (*Conn) Reboot ¶
Reboot asks logind for a reboot optionally asking for auth.
func (*Conn) Subscribe ¶
Subscribe to signals on the logind dbus
func (*Conn) TerminateSession ¶
TerminateSession forcibly terminate one specific session.
func (*Conn) TerminateUser ¶
TerminateUser forcibly terminates all processes of a user.
type Session ¶
Session object definition.
type User ¶
User object definition.
Source Files ¶
- Version
- v22.5.0 (latest)
- Published
- Nov 7, 2022
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 1 year ago –
Tools for package owners.