loginctl

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleRequest

func HandleRequest(conn net.Conn, req Request, manager *Manager)

Types

type EventType

type EventType string
const (
	EventStateChanged      EventType = "state_changed"
	EventLock              EventType = "lock"
	EventUnlock            EventType = "unlock"
	EventPrepareForSleep   EventType = "prepare_for_sleep"
	EventIdleHintChanged   EventType = "idle_hint_changed"
	EventLockedHintChanged EventType = "locked_hint_changed"
)

type Manager

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

func NewManager

func NewManager() (*Manager, error)

func (*Manager) Activate

func (m *Manager) Activate() error

func (*Manager) Close

func (m *Manager) Close()

func (*Manager) GetState

func (m *Manager) GetState() SessionState

func (*Manager) Lock

func (m *Manager) Lock() error

func (*Manager) SetIdleHint

func (m *Manager) SetIdleHint(idle bool) error

func (*Manager) SetLockBeforeSuspend added in v0.1.11

func (m *Manager) SetLockBeforeSuspend(enabled bool)

func (*Manager) SetSleepInhibitorEnabled added in v0.1.15

func (m *Manager) SetSleepInhibitorEnabled(enabled bool)

func (*Manager) Subscribe

func (m *Manager) Subscribe(id string) chan SessionState

func (*Manager) Terminate

func (m *Manager) Terminate() error

func (*Manager) Unlock

func (m *Manager) Unlock() error

func (*Manager) Unsubscribe

func (m *Manager) Unsubscribe(id string)

type Request

type Request struct {
	ID     int                    `json:"id,omitempty"`
	Method string                 `json:"method"`
	Params map[string]interface{} `json:"params,omitempty"`
}

type SessionEvent

type SessionEvent struct {
	Type EventType    `json:"type"`
	Data SessionState `json:"data"`
}

type SessionState

type SessionState struct {
	SessionID         string `json:"sessionId"`
	SessionPath       string `json:"sessionPath"`
	Locked            bool   `json:"locked"`
	Active            bool   `json:"active"`
	IdleHint          bool   `json:"idleHint"`
	IdleSinceHint     uint64 `json:"idleSinceHint"`
	LockedHint        bool   `json:"lockedHint"`
	SessionType       string `json:"sessionType"`
	SessionClass      string `json:"sessionClass"`
	User              uint32 `json:"user"`
	UserName          string `json:"userName"`
	RemoteHost        string `json:"remoteHost"`
	Service           string `json:"service"`
	TTY               string `json:"tty"`
	Display           string `json:"display"`
	Remote            bool   `json:"remote"`
	Seat              string `json:"seat"`
	VTNr              uint32 `json:"vtnr"`
	PreparingForSleep bool   `json:"preparingForSleep"`
}

type SuccessResult

type SuccessResult struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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