login

package
v0.0.0-...-ba0b20d Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceName = "dev.avyos.login"

	RequestLogout       uint16 = 0x0201
	RequestLock         uint16 = 0x0202
	RequestGetSession   uint16 = 0x0203
	RequestListSessions uint16 = 0x0204
	RequestSwitchUser   uint16 = 0x0205

	EventSessionStarted     uint16 = 0x0301
	EventSessionEnded       uint16 = 0x0302
	EventSessionListChanged uint16 = 0x0303
)

Variables

This section is empty.

Functions

func EncodeSessionList

func EncodeSessionList(sessions []SessionInfo) []byte

Types

type Client

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

Client provides a typed API to the login/session manager service.

func Connect

func Connect() (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) GetSession

func (c *Client) GetSession() (SessionInfo, error)

func (*Client) ListSessions

func (c *Client) ListSessions() ([]SessionInfo, error)

func (*Client) Lock

func (c *Client) Lock() error

func (*Client) Logout

func (c *Client) Logout() error

func (*Client) OnSessionEnded

func (c *Client) OnSessionEnded(fn func())

func (*Client) OnSessionListChanged

func (c *Client) OnSessionListChanged(fn func([]SessionInfo))

func (*Client) OnSessionStarted

func (c *Client) OnSessionStarted(fn func(SessionInfo))

func (*Client) Raw

func (c *Client) Raw() *sutra.Client

func (*Client) SwitchUser

func (c *Client) SwitchUser() error

type SessionInfo

type SessionInfo struct {
	Username string
	UID      uint32
	PID      int
	Active   bool
}

func DecodeSessionInfo

func DecodeSessionInfo(data []byte) SessionInfo

func DecodeSessionList

func DecodeSessionList(data []byte) []SessionInfo

func (*SessionInfo) Encode

func (s *SessionInfo) Encode() []byte

Jump to

Keyboard shortcuts

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