Versions in this module Expand all Collapse all v1 v1.9.1 Mar 9, 2022 Changes in this version type Attribute + Permission uint + type ChildDevice interface + Online func() bool type Instance + func GetDeviceInstances(device Device) (instances []Instance) type Manager + func (p *Manager) IsOTASupport(identity string) (bool, error) + func (p *Manager) OTA(identity, firmwareURL string) (ch chan OTAResp, err error) + func (p *Manager) SetAttributeNotify(identity string) error + type OTADevice interface + OTA func(firmwareURL string) (chan OTAResp, error) + type OTAProgressState int + const OTABurnFail + const OTADownloadFail + const OTAFinish + const OTAUpgradeFail + const OTAValidateFail + func OTAProgress(i int) OTAProgressState + type OTAResp struct + Step OTAProgressState + type ParentDevice interface + GetChildDeviceById func(instanceId int) ChildDevice type Server + func (p Server) OTA(req *proto.OTAReq, server proto.Plugin_OTAServer) error v1.5.0 Nov 23, 2021 Changes in this version + type AuthDevice interface + Auth func(params map[string]string) error + IsAuth func() bool + RemoveAuthorization func(params map[string]string) error type DeviceInfo + AuthRequired bool type Manager + func (p *Manager) Auth(identity string, params map[string]string) (err error) + func (p *Manager) Disconnect(identity string, params map[string]string) (err error) type OptionFunc + func WithDomain(domain string) OptionFunc type Server + func (p Server) Connect(ctx context.Context, req *proto.AuthReq) (resp *proto.GetAttributesResp, err error) + func (p Server) Disconnect(ctx context.Context, req *proto.AuthReq) (resp *proto.Empty, err error) v1.4.0 Oct 19, 2021 Changes in this version + func Exist(name string) bool + type Attribute struct + Attribute string + ID int + Max *int + Min *int + Val interface{} + ValType string + type Device interface + Close func() error + GetChannel func() WatchChan + Identity func() string + Info func() DeviceInfo + Online func() bool + Setup func() error + Update func() error + type DeviceInfo struct + Identity string + Manufacturer string + Model string + type Instance struct + Attributes []Attribute + InstanceId int + Type string + type Manager struct + func NewManager() *Manager + func (p *Manager) AddDevice(device Device) error + func (p *Manager) Devices() (ds []Device, err error) + func (p *Manager) GetAttributes(identity string) (s []Instance, err error) + func (p *Manager) HealthCheck(identity string) bool + func (p *Manager) Init() + func (p *Manager) Notify(identity string, instanceID int, attr *utils.Attribute) attribute.NotifyFunc + func (p *Manager) RemoveDevice(identity string) error + func (p *Manager) SetAttribute(identity string, instanceID int, attr string, val interface{}) (err error) + func (p *Manager) Subscribe(notify chan Notify) + func (p *Manager) Unsubscribe(notify chan Notify) + func (p *Manager) WatchNotify(device Device) + type Notification struct + Attr string + Identity string + InstanceID int + Val interface{} + type Notify struct + Attribute Attribute + Identity string + InstanceID int + type OptionFunc func(s *Server) + func WithConfigFile(configFile string) OptionFunc + func WithStatic(staticDir string) OptionFunc + type Server struct + ApiRouter *gin.RouterGroup + Domain string + Manager *Manager + Router *gin.Engine + func NewPluginServer(domain string, opts ...OptionFunc) *Server + func (p *Server) Init() + func (p Server) Discover(request *proto.Empty, server proto.Plugin_DiscoverServer) error + func (p Server) GetAttributes(context context.Context, request *proto.GetAttributesReq) (resp *proto.GetAttributesResp, err error) + func (p Server) HealthCheck(context context.Context, req *proto.HealthCheckReq) (resp *proto.HealthCheckResp, err error) + func (p Server) SetAttributes(context context.Context, request *proto.SetAttributesReq) (resp *proto.SetAttributesResp, err error) + func (p Server) StateChange(request *proto.Empty, server proto.Plugin_StateChangeServer) error + type SetAttribute struct + Attribute string + InstanceID int + Val interface{} + type SetRequest struct + Attributes []SetAttribute + type WatchChan chan Notification