Documentation ¶
Overview ¶
Package dbus wraps xdg-dbus-proxy and implements configuration and sandboxing of the underlying helper process.
Index ¶
- Constants
- Variables
- func Address() (session, system string)
- type Config
- type Proxy
- func (p *Proxy) Bwrap() []string
- func (p *Proxy) Close() error
- func (p *Proxy) Seal(session, system *Config) error
- func (p *Proxy) Sealed() bool
- func (p *Proxy) Session() [2]string
- func (p *Proxy) Start(ready chan error, output io.Writer, sandbox bool) error
- func (p *Proxy) String() string
- func (p *Proxy) System() [2]string
- func (p *Proxy) Wait() error
Constants ¶
const ( SessionBusAddress = "DBUS_SESSION_BUS_ADDRESS" SystemBusAddress = "DBUS_SYSTEM_BUS_ADDRESS" )
Variables ¶
var (
ErrConfig = errors.New("no configuration to seal")
)
var ProxyName = "xdg-dbus-proxy"
ProxyName is the file name or path to the proxy program. Overriding ProxyName will only affect Proxy instance created after the change.
Functions ¶
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 ¶
NewConfig returns a reference to a Config struct with optional defaults. If id is an empty string own defaults are omitted.
func NewConfigFromFile ¶
NewConfigFromFile opens the target config file at path and parses its contents into *Config.
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 (*Proxy) Close ¶
Close closes the status file descriptor passed to xdg-dbus-proxy, causing it to stop.