dbus

package
v0.0.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// See set 'see' policy for NAME (--see=NAME)
	See []string `json:"see"`
	// Talk set 'talk' policy for NAME (--talk=NAME)
	Talk []string `json:"talk"`
	// Own set 'own' policy for NAME (--own=NAME)
	Own []string `json:"own"`

	// Call set RULE for calls on NAME (--call=NAME=RULE)
	Call map[string]string `json:"call"`
	// Broadcast set RULE for broadcasts from NAME (--broadcast=NAME=RULE)
	Broadcast map[string]string `json:"broadcast"`

	Log    bool `json:"log,omitempty"`
	Filter bool `json:"filter"`
}

func NewConfig

func NewConfig(id string, defaults, mpris bool) (c *Config)

NewConfig returns a reference to a Config struct with optional defaults. If id is an empty string own defaults are omitted.

func (*Config) Args

func (c *Config) Args(bus [2]string) (args []string)

type Proxy

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

Proxy holds references to a xdg-dbus-proxy process, and should never be copied. Once sealed, configuration changes will no longer be possible and attempting to do so will result in a panic.

func New

func New(binPath string, session, system [2]string) *Proxy

New returns a reference to a new unsealed Proxy.

func (*Proxy) Close

func (p *Proxy) Close() error

Close closes the status file descriptor passed to xdg-dbus-proxy, causing it to stop.

func (*Proxy) Seal

func (p *Proxy) Seal(session, system *Config) error

Seal seals the Proxy instance.

func (*Proxy) Start

func (p *Proxy) Start(ready *chan bool) error

Start launches the D-Bus proxy and sets up the Wait method. ready should be buffered and should only be received from once.

func (*Proxy) String

func (p *Proxy) String() string

func (*Proxy) Wait

func (p *Proxy) Wait() error

Wait waits for xdg-dbus-proxy to exit or fault.

Jump to

Keyboard shortcuts

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