port

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 8 Imported by: 0 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 port defines the interfaces implemented by detection adapters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

type Bus interface {
	// HasOwner reports whether a well-known name currently has an owner.
	HasOwner(ctx context.Context, k BusKind, name string) (bool, error)
	// Introspect returns the raw introspection XML for an object path.
	Introspect(ctx context.Context, k BusKind, object *Object) (string, error)
	// Property reads a single property off an interface.
	Property(ctx context.Context, k BusKind, query *PropertyQuery) (PropertyValue, error)
	// Properties reads every property on an interface in one round trip.
	Properties(ctx context.Context, k BusKind, query *PropertyQuery) (map[string]any, error)
	// Close releases any connections that were opened.
	Close() error
}

Bus is the D-Bus port. It is deliberately narrow: the library only ever needs to ask whether a name is claimed, list the interfaces on an object, and read a property.

type BusKind

type BusKind uint8

BusKind selects one of the two D-Bus instances a desktop session has.

const (
	// SystemBus selects the system D-Bus instance; SessionBus selects the user session instance.
	SystemBus BusKind = iota
	// SessionBus selects the user session D-Bus instance.
	SessionBus
)

type DesktopProbe

type DesktopProbe interface {
	Desktop(ctx context.Context, environment *domain.Env) (domain.DesktopInfo, error)
}

DesktopProbe identifies the desktop environment and, where it is cheap to obtain, its version.

type EnvProbe

type EnvProbe = env.Source

EnvProbe snapshots the process environment. It is the one probe that never fails and never blocks, so it runs synchronously before everything else.

type GPUProbe

type GPUProbe = drm.Source

GPUProbe enumerates the machine's GPUs and names the primary one. It is separate from StackProbe because the two answer genuinely different questions from unrelated sources: what hardware is present, and what the client-side driver stack can do with it.

type OSProbe

type OSProbe = osinfo.Source

OSProbe reads the distribution and kernel identity.

type Object

type Object struct {
	// Destination is the bus name that owns the object.
	Destination string
	// Path is the D-Bus object path.
	Path string
}

Object identifies a destination and object path on a selected bus.

func (*Object) Address

func (object *Object) Address() (destination, path string)

Address returns the destination and path identifying the bus object.

type PortalProbe

type PortalProbe interface {
	Portal(ctx context.Context, environment *domain.Env) (domain.PortalInfo, error)
}

PortalProbe inspects xdg-desktop-portal.

type ProcessProbe

type ProcessProbe = procscan.Source

ProcessProbe lists the command names of the calling user's processes. It is the last-resort signal for compositor detection and is only invoked when explicitly enabled.

type PropertyAddress

type PropertyAddress = struct {
	// Destination is the bus name that owns the object.
	Destination string
	// Path is the D-Bus object path.
	Path string
	// Interface identifies the interface containing the property.
	Interface string
	// Name identifies the property; empty when reading the entire interface.
	Name string
}

PropertyAddress is the structural address of a property request.

type PropertyQuery

type PropertyQuery struct {
	// Object identifies the destination and object path.
	Object Object
	// Interface is the D-Bus interface containing the property.
	Interface string
	// Name is the property name; empty when reading all properties.
	Name string
}

PropertyQuery identifies an interface and optional property on a bus object.

func (*PropertyQuery) PropertyAddress

func (query *PropertyQuery) PropertyAddress() PropertyAddress

PropertyAddress returns the complete address used to read one or all properties.

type PropertyValue

type PropertyValue = struct {
	// Value is the decoded property payload.
	Value any
}

PropertyValue carries the heterogeneous payload of a D-Bus property.

type SessionProbe

type SessionProbe interface {
	Session(ctx context.Context, environment *domain.Env) (domain.SessionInfo, error)
}

SessionProbe reads the logind seat session.

type StackProbe

type StackProbe interface {
	Stack(ctx context.Context) (domain.OpenGLInfo, domain.VulkanInfo, error)
}

StackProbe reports the OpenGL and Vulkan implementations.

type WaylandProbe

type WaylandProbe = wayland.Source

WaylandProbe connects to the compositor and enumerates its global registry. A nil result with a nil error means there was no compositor to talk to.

type X11Probe

type X11Probe = x11.Source

X11Probe connects to the X server and reports what it found. A nil result with a nil error means there was no X server to talk to.

Jump to

Keyboard shortcuts

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