Documentation ¶
Index ¶
- Variables
- func AutoEventManagerFrom(get di.Get) interfaces.AutoEventManager
- func ConfigurationFrom(get di.Get) *config.ConfigurationStruct
- func DeviceServiceFrom(get di.Get) *models.DeviceService
- func DiscoveryRequestIdFrom(get di.Get) string
- func ExtendedProtocolDriverFrom(get di.Get) interfaces.ExtendedProtocolDriver
- func ProtocolDriverFrom(get di.Get) interfaces.ProtocolDriver
- type AllowedFailuresTracker
- func (aft *AllowedFailuresTracker) Decrease(deviceName string) int
- func (aft *AllowedFailuresTracker) Get(deviceName string) *AtomicInt
- func (aft *AllowedFailuresTracker) Remove(deviceName string)
- func (aft *AllowedFailuresTracker) Set(deviceName string, value int)
- func (aft *AllowedFailuresTracker) Value(deviceName string) int
- type AtomicInt
Constants ¶
This section is empty.
Variables ¶
var AllowedRequestFailuresTrackerName = di.TypeInstanceToName(AllowedFailuresTracker{})
AllowedRequestFailuresTrackerName contains the name of allowed request failures tracker in the DIC.
var AutoEventManagerName = di.TypeInstanceToName((*interfaces.AutoEventManager)(nil))
AutoEventManagerName contains the name of autoevent manager implementation in the DIC
var ConfigurationName = di.TypeInstanceToName(config.ConfigurationStruct{})
ConfigurationName contains the name of device service's ConfigurationStruct implementation in the DIC.
var DeviceServiceName = di.TypeInstanceToName(models.DeviceService{})
DeviceServiceName contains the name of device service struct in the DIC.
var DiscoveryRequestIdName = di.TypeInstanceToName(new(string))
DiscoveryRequestIdName contains the name of discovery request id implementation in the DIC.
var ExtendedProtocolDriverName = di.TypeInstanceToName((*interfaces.ExtendedProtocolDriver)(nil))
ExtendedProtocolDriverName contains the name of extended protocol driver implementation in the DIC.
var ProtocolDriverName = di.TypeInstanceToName((*interfaces.ProtocolDriver)(nil))
ProtocolDriverName contains the name of protocol driver implementation in the DIC.
Functions ¶
func AutoEventManagerFrom ¶
func AutoEventManagerFrom(get di.Get) interfaces.AutoEventManager
AutoEventManagerFrom helper function queries the DIC and returns autoevent manager implementation
func ConfigurationFrom ¶
func ConfigurationFrom(get di.Get) *config.ConfigurationStruct
ConfigurationFrom helper function queries the DIC and returns device service's ConfigurationStruct implementation.
func DeviceServiceFrom ¶
func DeviceServiceFrom(get di.Get) *models.DeviceService
DeviceServiceFrom helper function queries the DIC and returns device service struct.
func DiscoveryRequestIdFrom ¶
DiscoveryRequestIdFrom helper function queries the DIC and returns discovery request id.
func ExtendedProtocolDriverFrom ¶
func ExtendedProtocolDriverFrom(get di.Get) interfaces.ExtendedProtocolDriver
ExtendedProtocolDriverFrom helper function queries the DIC and returns extended protocol driver implementation.
func ProtocolDriverFrom ¶
func ProtocolDriverFrom(get di.Get) interfaces.ProtocolDriver
ProtocolDriverFrom helper function queries the DIC and returns protocol driver implementation.
Types ¶
type AllowedFailuresTracker ¶
type AllowedFailuresTracker struct {
// contains filtered or unexported fields
}
AllowedFailuresTracker wraps a map of device names to atomic integers that track the number of allowed request failures for each device.
func AllowedRequestFailuresTrackerFrom ¶
func AllowedRequestFailuresTrackerFrom(get di.Get) AllowedFailuresTracker
AllowedRequestFailuresTrackerFrom helper function queries the DIC and returns a device request failures tracker.
func NewAllowedFailuresTracker ¶
func NewAllowedFailuresTracker() AllowedFailuresTracker
NewAllowedFailuresTracker creates and initializes a new tracker.
func (*AllowedFailuresTracker) Decrease ¶
func (aft *AllowedFailuresTracker) Decrease(deviceName string) int
Decrease decreases the AtomicInt value for a given device by 1. Returns the updated value or -1 if the device does not exist.
func (*AllowedFailuresTracker) Get ¶
func (aft *AllowedFailuresTracker) Get(deviceName string) *AtomicInt
Get retrieves the AtomicInt for a given device name. Returns nil if the device does not exist.
func (*AllowedFailuresTracker) Remove ¶
func (aft *AllowedFailuresTracker) Remove(deviceName string)
Remove deletes the entry for a given device name from the tracker.
func (*AllowedFailuresTracker) Set ¶
func (aft *AllowedFailuresTracker) Set(deviceName string, value int)
Set initializes or updates the AtomicInt for a given device.
func (*AllowedFailuresTracker) Value ¶
func (aft *AllowedFailuresTracker) Value(deviceName string) int
Value retrieves the current value of the AtomicInt for a device. Returns -1 if the device does not exist.