Documentation ¶
Index ¶
- Variables
- type Device
- type DeviceCustomEvent
- type DeviceEvent
- type DeviceJoinEvent
- type DeviceLeaveEvent
- type Empty
- type Hook
- type HookAPI
- type HookAPIGetter
- type HookError
- type HookErrorList
- type HookExistsErr
- type HookLoadEvent
- type HookManager
- func (m *HookManager) ForEach(cb func(*Hook) error) (errs HookErrorList)
- func (m *HookManager) Get(id string) *Hook
- func (m *HookManager) List() (hooks []*Hook)
- func (m *HookManager) Load(ctx context.Context, path string) (h *Hook, err error)
- func (m *HookManager) LoadFromDir(ctx context.Context, path string) (errs []error)
- func (m *HookManager) OnDeviceEvent(event *DeviceEvent) (err error)
- func (m *HookManager) OnDeviceJoin(event *DeviceJoinEvent) (err error)
- func (m *HookManager) OnDeviceLeave(event *DeviceLeaveEvent) (err error)
- func (m *HookManager) ReloadFromDir(ctx context.Context, path string) (errs []error)
- func (m *HookManager) Unload(ctx context.Context, id string) (err error)
- type HookMetadata
- type HookNotExistsErr
- type HookUnloadEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAPINotBind = errors.New("API can only be called after init")
Functions ¶
This section is empty.
Types ¶
type DeviceCustomEvent ¶
type DeviceEvent ¶
type DeviceJoinEvent ¶
type DeviceJoinEvent = protos.DeviceJoinEvent
type DeviceLeaveEvent ¶
type DeviceLeaveEvent = protos.DeviceLeaveEvent
type Hook ¶
type Hook struct {
// contains filtered or unexported fields
}
func (*Hook) OnDeviceCustomEvent ¶
func (h *Hook) OnDeviceCustomEvent(ctx context.Context, v *DeviceCustomEvent) (err error)
type HookAPIGetter ¶
type HookErrorList ¶
type HookErrorList []*HookError
func (HookErrorList) Error ¶
func (e HookErrorList) Error() string
func (HookErrorList) Unwrap ¶
func (e HookErrorList) Unwrap() (errs []error)
type HookExistsErr ¶
type HookExistsErr struct {
Instance *Hook
}
func (*HookExistsErr) Error ¶
func (e *HookExistsErr) Error() string
type HookLoadEvent ¶
type HookLoadEvent = protos.HookLoadEvent
type HookManager ¶
type HookManager struct {
// contains filtered or unexported fields
}
func NewHookManager ¶
func NewHookManager(ctx context.Context, apiGetter HookAPIGetter) (m *HookManager, err error)
func (*HookManager) ForEach ¶
func (m *HookManager) ForEach(cb func(*Hook) error) (errs HookErrorList)
func (*HookManager) Get ¶
func (m *HookManager) Get(id string) *Hook
func (*HookManager) List ¶
func (m *HookManager) List() (hooks []*Hook)
func (*HookManager) LoadFromDir ¶
func (m *HookManager) LoadFromDir(ctx context.Context, path string) (errs []error)
func (*HookManager) OnDeviceEvent ¶
func (m *HookManager) OnDeviceEvent(event *DeviceEvent) (err error)
func (*HookManager) OnDeviceJoin ¶
func (m *HookManager) OnDeviceJoin(event *DeviceJoinEvent) (err error)
func (*HookManager) OnDeviceLeave ¶
func (m *HookManager) OnDeviceLeave(event *DeviceLeaveEvent) (err error)
func (*HookManager) ReloadFromDir ¶
func (m *HookManager) ReloadFromDir(ctx context.Context, path string) (errs []error)
type HookMetadata ¶
type HookMetadata = protos.HookMetadata
type HookNotExistsErr ¶
type HookNotExistsErr struct {
Id string
}
func (*HookNotExistsErr) Error ¶
func (e *HookNotExistsErr) Error() string
type HookUnloadEvent ¶
type HookUnloadEvent = protos.HookUnloadEvent
Click to show internal directories.
Click to hide internal directories.