Documentation
¶
Index ¶
- Constants
- func GroupRequestByCategory(reqs []sdkmodels.CommandRequest) ([]contracts.ReadRequest, []contracts.CallRequest, error)
- func Reporter() interfaces.Reporter
- func Startup(name string, version string, proto interface{}, opts ...Option)
- func StatusManager() interfaces.StatusManager
- type Agent
- func (a *Agent) AddDevice(deviceName string, protocols map[string]models.ProtocolProperties, ...) error
- func (a *Agent) HandleAsyncResults(ctx context.Context, wg *sync.WaitGroup)
- func (a *Agent) HandleReadCommands(deviceName string, protocols map[string]models.ProtocolProperties, ...) ([]*sdkmodels.CommandValue, error)
- func (a *Agent) HandleWriteCommands(deviceName string, protocols map[string]models.ProtocolProperties, ...) (err error)
- func (a *Agent) Initialize(_ lc.LoggingClient, asyncCh chan<- *sdkmodels.AsyncValues, ...) error
- func (a *Agent) PostProcessDevice(device *contracts.Device, err error)
- func (a *Agent) PostProcessRequests(deviceName string, reqs interface{}, write bool, ...) error
- func (a *Agent) RegisterRoutes() error
- func (a *Agent) RemoveDevice(deviceName string, protocols map[string]models.ProtocolProperties) error
- func (a *Agent) ReportEvent(event *contracts.AsyncValues) error
- func (a *Agent) Stop(force bool) error
- func (a *Agent) UpdateDevice(deviceName string, protocols map[string]models.ProtocolProperties, ...) error
- type Option
- type Route
Constants ¶
View Source
const ( ApiDebugRoute = common.ApiBase + "/debug" ApiDebugLogging = common.ApiBase + "/logging" ApiDiscoveryRoute = common.ApiBase + "/device/discovery" ApiHookOnStreamNotFoundRoute = common.ApiBase + "/hook/on_stream_not_found" ApiHookOnStreamNoneReaderRoute = common.ApiBase + "/hook/on_stream_none_reader" )
View Source
const (
CustomizedServerPort = ":9999"
)
Variables ¶
This section is empty.
Functions ¶
func GroupRequestByCategory ¶ added in v1.1.0
func GroupRequestByCategory(reqs []sdkmodels.CommandRequest) ([]contracts.ReadRequest, []contracts.CallRequest, error)
func Reporter ¶ added in v1.1.0
func Reporter() interfaces.Reporter
func StatusManager ¶
func StatusManager() interfaces.StatusManager
Types ¶
type Agent ¶
type Agent struct { // if the driver is in strict mode, any error in request will be returned, ignored otherwise. StrictMode bool // now only the decision of 'ConsecutiveErrorNum' can be used OfflineDecision status.OfflineDecision // if no StatusManager is specified, a default one will be initialized StatusManager interfaces.StatusManager // contains filtered or unexported fields }
func (*Agent) AddDevice ¶
func (a *Agent) AddDevice(deviceName string, protocols map[string]models.ProtocolProperties, _ models.AdminState) error
func (*Agent) HandleAsyncResults ¶
func (*Agent) HandleReadCommands ¶
func (a *Agent) HandleReadCommands(deviceName string, protocols map[string]models.ProtocolProperties, reqs []sdkmodels.CommandRequest) ([]*sdkmodels.CommandValue, error)
func (*Agent) HandleWriteCommands ¶
func (a *Agent) HandleWriteCommands(deviceName string, protocols map[string]models.ProtocolProperties, reqs []sdkmodels.CommandRequest, params []*sdkmodels.CommandValue) (err error)
func (*Agent) Initialize ¶
func (a *Agent) Initialize(_ lc.LoggingClient, asyncCh chan<- *sdkmodels.AsyncValues, deviceCh chan<- []sdkmodels.DiscoveredDevice) error
func (*Agent) PostProcessDevice ¶ added in v1.1.0
func (*Agent) PostProcessRequests ¶ added in v1.1.1
func (*Agent) RegisterRoutes ¶ added in v1.1.4
func (*Agent) RemoveDevice ¶
func (*Agent) ReportEvent ¶
func (a *Agent) ReportEvent(event *contracts.AsyncValues) error
func (*Agent) UpdateDevice ¶
func (a *Agent) UpdateDevice(deviceName string, protocols map[string]models.ProtocolProperties, _ models.AdminState) error
Click to show internal directories.
Click to hide internal directories.