dmsocket

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dmsocket is the wire of lys-login's display manager sockets: one JSON request per connection and one Reply, the file the request went to or a Refusal and its reason. A client sends with an Endpoint; Apply is the change of the login screen any program may ask for.

Index

Constants

View Source
const DefaultRuntimeDir = "/run/lys-login"

Variables

View Source
var Apply = Endpoint[greeterconfig.Change]{
	Name:       "apply.sock",
	MaxRequest: (greeterconfig.MaxStaged+greeterconfig.MaxImage)/3*4 + 4096,
	Exchange:   5 * time.Minute,
}
View Source
var ErrNoDaemon = errors.New("lys-login's display manager is not running")

Functions

func Refuse

func Refuse(r Refusal, reason string) error

Types

type Endpoint

type Endpoint[T any] struct {
	Name       string
	MaxRequest int64
	Exchange   time.Duration
}

func (Endpoint[T]) Path

func (e Endpoint[T]) Path(runtimeDir string) string

func (Endpoint[T]) Send

func (e Endpoint[T]) Send(runtimeDir string, req T) (string, error)

type Refusal

type Refusal uint8
const (
	Failed Refusal = iota
	Invalid
	Unauthorized
	Dismissed
)

func (Refusal) MarshalText

func (r Refusal) MarshalText() ([]byte, error)

func (Refusal) String

func (r Refusal) String() string

func (*Refusal) UnmarshalText

func (r *Refusal) UnmarshalText(text []byte) error

type RefusedError

type RefusedError struct {
	Refusal Refusal
	Reason  string
}

func (*RefusedError) Error

func (e *RefusedError) Error() string

type Reply

type Reply struct {
	Path    string  `json:"path,omitempty"`
	Error   string  `json:"error,omitempty"`
	Refusal Refusal `json:"refusal,omitzero"`
}

func Answer

func Answer(path string, err error) Reply

Jump to

Keyboard shortcuts

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