dbusutil

package
v0.0.0-...-17244d7 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeError

func MakeError(v Implementer, name string, args ...interface{}) *dbus.Error

func MakeErrorJSON

func MakeErrorJSON(v Implementer, name string, detail interface{}) *dbus.Error

func MakeErrorf

func MakeErrorf(v Implementer, name, format string, args ...interface{}) *dbus.Error

func ToError

func ToError(err error) *dbus.Error

Types

type DBusError

type DBusError interface {
	Error() string
	Name() string
}

type Implementer

type Implementer interface {
	GetInterfaceName() string
}

type MatchRule

type MatchRule struct {
	Str string
}

func (MatchRule) AddTo

func (mr MatchRule) AddTo(conn *dbus.Conn) error

func (MatchRule) RemoveFrom

func (mr MatchRule) RemoveFrom(conn *dbus.Conn) error

type MatchRuleBuilder

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

func NewMatchRuleBuilder

func NewMatchRuleBuilder() *MatchRuleBuilder

func (*MatchRuleBuilder) Arg

func (b *MatchRuleBuilder) Arg(idx int, value string) *MatchRuleBuilder

func (*MatchRuleBuilder) ArgNamespace

func (b *MatchRuleBuilder) ArgNamespace(idx int, namespace string) *MatchRuleBuilder

func (*MatchRuleBuilder) ArgPath

func (b *MatchRuleBuilder) ArgPath(idx int, path string) *MatchRuleBuilder

func (*MatchRuleBuilder) Build

func (b *MatchRuleBuilder) Build() MatchRule

func (*MatchRuleBuilder) BuildStr

func (b *MatchRuleBuilder) BuildStr() string

func (*MatchRuleBuilder) Destination

func (b *MatchRuleBuilder) Destination(destination string) *MatchRuleBuilder

func (*MatchRuleBuilder) Eavesdrop

func (b *MatchRuleBuilder) Eavesdrop(eavesdrop bool) *MatchRuleBuilder

func (*MatchRuleBuilder) ExtPropertiesChanged

func (b *MatchRuleBuilder) ExtPropertiesChanged(path, interfaceName string) *MatchRuleBuilder

func (*MatchRuleBuilder) ExtSignal

func (b *MatchRuleBuilder) ExtSignal(path, interfaceName, name string) *MatchRuleBuilder

func (*MatchRuleBuilder) Interface

func (b *MatchRuleBuilder) Interface(interface0 string) *MatchRuleBuilder

func (*MatchRuleBuilder) Member

func (b *MatchRuleBuilder) Member(member string) *MatchRuleBuilder

func (*MatchRuleBuilder) Path

func (b *MatchRuleBuilder) Path(path string) *MatchRuleBuilder

func (*MatchRuleBuilder) PathNamespace

func (b *MatchRuleBuilder) PathNamespace(pathNamespace string) *MatchRuleBuilder

func (*MatchRuleBuilder) Sender

func (b *MatchRuleBuilder) Sender(sender string) *MatchRuleBuilder

func (*MatchRuleBuilder) Type

func (b *MatchRuleBuilder) Type(type0 string) *MatchRuleBuilder

type Property

type Property interface {
	SetValue(val interface{}) (changed bool, err *dbus.Error)
	GetValue() (val interface{}, err *dbus.Error)
	SetNotifyChangedFunc(func(val interface{}))
	GetType() reflect.Type
}

type PropertyAccess

type PropertyAccess struct {
	PropertyInfo
	Sender dbus.Sender
	// contains filtered or unexported fields
}

func (*PropertyAccess) GetPID

func (pa *PropertyAccess) GetPID() (uint32, error)

func (*PropertyAccess) GetUID

func (pa *PropertyAccess) GetUID() (uint32, error)

type PropertyChanged

type PropertyChanged struct {
	PropertyInfo
	Value interface{} // new value
}

type PropertyChangedCallback

type PropertyChangedCallback func(change *PropertyChanged)

type PropertyInfo

type PropertyInfo struct {
	Path      dbus.ObjectPath
	Interface string
	Name      string
}

type PropertyRead

type PropertyRead struct {
	PropertyAccess
}

type PropertyReadCallback

type PropertyReadCallback func(read *PropertyRead) *dbus.Error

type PropertyWrite

type PropertyWrite struct {
	PropertyAccess
	Value interface{} // new value
}

type PropertyWriteCallback

type PropertyWriteCallback func(write *PropertyWrite) *dbus.Error

type ServerObject

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

func (*ServerObject) ConnectChanged

func (so *ServerObject) ConnectChanged(v Implementer, propertyName string,
	cb PropertyChangedCallback) error

func (*ServerObject) Export

func (so *ServerObject) Export() error

func (*ServerObject) Path

func (so *ServerObject) Path() dbus.ObjectPath

func (*ServerObject) SetReadCallback

func (so *ServerObject) SetReadCallback(v Implementer, propertyName string,
	cb PropertyReadCallback) error

func (*ServerObject) SetWriteCallback

func (so *ServerObject) SetWriteCallback(v Implementer, propertyName string,
	cb PropertyWriteCallback) error

func (*ServerObject) StopExport

func (so *ServerObject) StopExport() error

type Service

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

func NewService

func NewService(conn *dbus.Conn) *Service

func NewSessionService

func NewSessionService() (*Service, error)

func NewSystemService

func NewSystemService() (*Service, error)

func (*Service) Conn

func (s *Service) Conn() *dbus.Conn

func (*Service) DelayAutoQuit

func (s *Service) DelayAutoQuit()

func (*Service) DelayEmitPropertyChanged

func (s *Service) DelayEmitPropertyChanged(v Implementer) func() error

func (*Service) DumpProperties

func (s *Service) DumpProperties(v Implementer) (string, error)

func (*Service) Emit

func (s *Service) Emit(v Implementer, signalName string, values ...interface{}) error

func (*Service) EmitPropertiesChanged

func (s *Service) EmitPropertiesChanged(v Implementer, propValMap map[string]interface{},
	invalidatedProps ...string) error

func (*Service) EmitPropertyChanged

func (s *Service) EmitPropertyChanged(v Implementer, propertyName string, value interface{}) error

func (*Service) Export

func (s *Service) Export(path dbus.ObjectPath, implements ...Implementer) error

func (*Service) GetConnPID

func (s *Service) GetConnPID(name string) (pid uint32, err error)

func (*Service) GetConnUID

func (s *Service) GetConnUID(name string) (uid uint32, err error)

func (*Service) GetNameOwner

func (s *Service) GetNameOwner(name string) (owner string, err error)

func (*Service) GetServerObject

func (s *Service) GetServerObject(impl Implementer) *ServerObject

func (*Service) GetServerObjectByPath

func (s *Service) GetServerObjectByPath(path dbus.ObjectPath) *ServerObject

func (*Service) IsExported

func (s *Service) IsExported(impl Implementer) bool

func (*Service) NameHasOwner

func (s *Service) NameHasOwner(name string) (hasOwner bool, err error)

func (*Service) NewServerObject

func (s *Service) NewServerObject(path dbus.ObjectPath,
	implementers ...Implementer) (*ServerObject, error)

func (*Service) Quit

func (s *Service) Quit()

func (*Service) ReleaseName

func (s *Service) ReleaseName(name string) error

func (*Service) RequestName

func (s *Service) RequestName(name string) error

func (*Service) SetAutoQuitHandler

func (s *Service) SetAutoQuitHandler(interval time.Duration, canQuit func() bool)

func (*Service) StopExport

func (s *Service) StopExport(impl Implementer) error

func (*Service) StopExportByPath

func (s *Service) StopExportByPath(path dbus.ObjectPath) error

func (*Service) Wait

func (s *Service) Wait()

type SignalHandler

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

type SignalHandlerFunc

type SignalHandlerFunc func(sig *dbus.Signal)

type SignalHandlerId

type SignalHandlerId int

type SignalLoop

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

func NewSignalLoop

func NewSignalLoop(conn *dbus.Conn, bufSize int) *SignalLoop

func (*SignalLoop) AddHandler

func (sl *SignalLoop) AddHandler(rule *SignalRule, cb SignalHandlerFunc) SignalHandlerId

func (*SignalLoop) Conn

func (sl *SignalLoop) Conn() *dbus.Conn

func (*SignalLoop) RemoveHandler

func (sl *SignalLoop) RemoveHandler(id SignalHandlerId)

func (*SignalLoop) Start

func (sl *SignalLoop) Start()

func (*SignalLoop) Stop

func (sl *SignalLoop) Stop()

type SignalRule

type SignalRule struct {
	Sender string
	Path   dbus.ObjectPath
	Name   string
}

Directories

Path Synopsis
_tool

Jump to

Keyboard shortcuts

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