busdiscover

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package busdiscover enumerates live bus daemons via per-AppID PID files protected by a process-lifetime advisory lock.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handle

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

Handle keeps the lifetime lock fd alive; OS releases on process exit.

func WritePIDFile

func WritePIDFile(eventsDir string, pid int) (*Handle, error)

WritePIDFile takes the alive lock and atomically writes pid + RFC3339 start time. Returns lockfile.ErrHeld if another bus holds the lock.

func (*Handle) Release

func (h *Handle) Release() error

Release is for tests only; production lets process exit release the lock.

type Process

type Process struct {
	PID       int
	AppID     string
	StartTime time.Time
}

type Scanner

type Scanner interface {
	ScanBusProcesses() ([]Process, error)
}

func Default

func Default() Scanner

Jump to

Keyboard shortcuts

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