Documentation ¶
Index ¶
- func MakeError(v Implementer, name string, args ...interface{}) *dbus.Error
- func MakeErrorJSON(v Implementer, name string, detail interface{}) *dbus.Error
- func MakeErrorf(v Implementer, name, format string, args ...interface{}) *dbus.Error
- func ToError(err error) *dbus.Error
- type DBusError
- type ExportedMethod
- type ExportedMethods
- type Implementer
- type ImplementerExt
- type ImplementerV20
- type MatchRule
- type MatchRuleBuilder
- func (b *MatchRuleBuilder) Arg(idx int, value string) *MatchRuleBuilder
- func (b *MatchRuleBuilder) ArgNamespace(idx int, namespace string) *MatchRuleBuilder
- func (b *MatchRuleBuilder) ArgPath(idx int, path string) *MatchRuleBuilder
- func (b *MatchRuleBuilder) Build() MatchRule
- func (b *MatchRuleBuilder) BuildStr() string
- func (b *MatchRuleBuilder) Destination(destination string) *MatchRuleBuilder
- func (b *MatchRuleBuilder) Eavesdrop(eavesdrop bool) *MatchRuleBuilder
- func (b *MatchRuleBuilder) ExtPropertiesChanged(path, interfaceName string) *MatchRuleBuilder
- func (b *MatchRuleBuilder) ExtSignal(path, interfaceName, name string) *MatchRuleBuilder
- func (b *MatchRuleBuilder) Interface(interface0 string) *MatchRuleBuilder
- func (b *MatchRuleBuilder) Member(member string) *MatchRuleBuilder
- func (b *MatchRuleBuilder) Path(path string) *MatchRuleBuilder
- func (b *MatchRuleBuilder) PathNamespace(pathNamespace string) *MatchRuleBuilder
- func (b *MatchRuleBuilder) Sender(sender string) *MatchRuleBuilder
- func (b *MatchRuleBuilder) Type(type0 string) *MatchRuleBuilder
- type Property
- type PropertyAccess
- type PropertyChanged
- type PropertyChangedCallback
- type PropertyInfo
- type PropertyRead
- type PropertyReadCallback
- type PropertyWrite
- type PropertyWriteCallback
- type ServerObject
- func (so *ServerObject) ConnectChanged(v Implementer, propertyName string, cb PropertyChangedCallback) error
- func (so *ServerObject) Export() error
- func (so *ServerObject) Path() dbus.ObjectPath
- func (so *ServerObject) SetReadCallback(v Implementer, propertyName string, cb PropertyReadCallback) error
- func (so *ServerObject) SetWriteCallback(v Implementer, propertyName string, cb PropertyWriteCallback) error
- func (so *ServerObject) StopExport() error
- type Service
- func (s *Service) Conn() *dbus.Conn
- func (s *Service) ConnectChanged(v Implementer, propertyName string, cb PropertyChangedCallback) error
- func (s *Service) DelayAutoQuit()
- func (s *Service) DelayEmitPropertyChanged(v Implementer) func() error
- func (s *Service) DumpProperties(v Implementer) (string, error)
- func (s *Service) Emit(v Implementer, signalName string, values ...interface{}) error
- func (s *Service) EmitByPath(v Implementer, path dbus.ObjectPath, signalName string, values ...interface{}) error
- func (s *Service) EmitPropertiesChanged(v Implementer, propValMap map[string]interface{}, invalidatedProps ...string) error
- func (s *Service) EmitPropertyChanged(v Implementer, propertyName string, value interface{}) error
- func (s *Service) Export(path dbus.ObjectPath, implements ...Implementer) error
- func (s *Service) ExportExt(path dbus.ObjectPath, interfaceName string, impl Implementer) error
- func (s *Service) GetConnPID(name string) (pid uint32, err error)
- func (s *Service) GetConnUID(name string) (uid uint32, err error)
- func (s *Service) GetNameOwner(name string) (owner string, err error)
- func (s *Service) GetServerObject(impl Implementer) *ServerObject
- func (s *Service) GetServerObjectByPath(path dbus.ObjectPath) *ServerObject
- func (s *Service) IsExported(impl Implementer) bool
- func (s *Service) NameHasOwner(name string) (hasOwner bool, err error)
- func (s *Service) NewServerObject(path dbus.ObjectPath, implementers ...Implementer) (*ServerObject, error)
- func (s *Service) Quit()
- func (s *Service) ReleaseName(name string) error
- func (s *Service) RequestName(name string) error
- func (s *Service) SetAutoQuitHandler(interval time.Duration, canQuit func() bool)
- func (s *Service) SetReadCallback(v Implementer, propertyName string, cb PropertyReadCallback) error
- func (s *Service) SetWriteCallback(v Implementer, propertyName string, cb PropertyWriteCallback) error
- func (s *Service) StopExport(impl Implementer) error
- func (s *Service) StopExportByPath(path dbus.ObjectPath) error
- func (s *Service) Wait()
- type SignalHandler
- type SignalHandlerFunc
- type SignalHandlerId
- type SignalLoop
- type SignalRule
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
Types ¶
type ExportedMethod ¶
type ExportedMethods ¶
type ExportedMethods []ExportedMethod
func (ExportedMethods) Len ¶
func (methods ExportedMethods) Len() int
func (ExportedMethods) Less ¶
func (methods ExportedMethods) Less(i, j int) bool
func (ExportedMethods) Swap ¶
func (methods ExportedMethods) Swap(i, j int)
type ImplementerExt ¶
type ImplementerExt interface { Implementer GetExportedMethods() ExportedMethods }
ImplementerExt 对象实例拓展
type ImplementerV20 ¶
type ImplementerV20 interface {
GetInterfaceName() string
}
ImplementerV20 兼容v20之前的方式
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 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 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
}
ServerObject 一个path对应一个obj
func (*ServerObject) ConnectChanged ¶
func (so *ServerObject) ConnectChanged(v Implementer, propertyName string, cb PropertyChangedCallback) error
ConnectChanged V23兼容该接口。V23正常流程外部不再需要该接口
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
SetReadCallback V23兼容该接口。V23正常流程外部不再需要该接口
func (*ServerObject) SetWriteCallback ¶
func (so *ServerObject) SetWriteCallback(v Implementer, propertyName string, cb PropertyWriteCallback) error
SetWriteCallback V23兼容该接口。V23正常流程外部不再需要该接口
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 NewSystemService ¶
func (*Service) ConnectChanged ¶
func (s *Service) ConnectChanged(v Implementer, propertyName string, cb PropertyChangedCallback) error
ConnectChanged 不再由ServerObject提供
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) EmitByPath ¶
func (s *Service) EmitByPath(v Implementer, path dbus.ObjectPath, 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
Export V20导出接口,不支持指定InterfaceName
func (*Service) ExportExt ¶
func (s *Service) ExportExt(path dbus.ObjectPath, interfaceName string, impl Implementer) error
ExportExt V23导出接口,支持指定InterfaceName, interfaceName不和Implementer绑定
func (*Service) GetNameOwner ¶
func (*Service) GetServerObject ¶
func (s *Service) GetServerObject(impl Implementer) *ServerObject
GetServerObject v20接口,暴露给外部应用,实际不合理,V23兼容该接口。V23正常流程外部不再需要该接口
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 (*Service) NewServerObject ¶
func (s *Service) NewServerObject(path dbus.ObjectPath, implementers ...Implementer) (*ServerObject, error)
NewServerObject v20接口,暴露给外部应用,实际不合理,V23兼容该接口。V23正常流程外部不再需要该接口
func (*Service) ReleaseName ¶
func (*Service) RequestName ¶
func (*Service) SetAutoQuitHandler ¶
func (*Service) SetReadCallback ¶
func (s *Service) SetReadCallback(v Implementer, propertyName string, cb PropertyReadCallback) error
SetReadCallback 不再由ServerObject提供
func (*Service) SetWriteCallback ¶
func (s *Service) SetWriteCallback(v Implementer, propertyName string, cb PropertyWriteCallback) error
SetReadCallback 不再由ServerObject提供
func (*Service) StopExport ¶
func (s *Service) StopExport(impl Implementer) error
func (*Service) StopExportByPath ¶
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 ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.