container

package
v4.0.0-dev.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllowedRequestFailuresTrackerName = di.TypeInstanceToName(AllowedFailuresTracker{})

AllowedRequestFailuresTrackerName contains the name of allowed request failures tracker in the DIC.

AutoEventManagerName contains the name of autoevent manager implementation in the DIC

ConfigurationName contains the name of device service's ConfigurationStruct implementation in the DIC.

DeviceServiceName contains the name of device service struct in the DIC.

View Source
var DiscoveryRequestIdName = di.TypeInstanceToName(new(string))

DiscoveryRequestIdName contains the name of discovery request id implementation in the DIC.

View Source
var ExtendedProtocolDriverName = di.TypeInstanceToName((*interfaces.ExtendedProtocolDriver)(nil))

ExtendedProtocolDriverName contains the name of extended protocol driver implementation in the DIC.

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

func DiscoveryRequestIdFrom(get di.Get) string

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.

type AtomicInt

type AtomicInt struct {
	// contains filtered or unexported fields
}

func (*AtomicInt) Decrease

func (i *AtomicInt) Decrease() int

func (*AtomicInt) Set

func (i *AtomicInt) Set(v int)

func (*AtomicInt) Value

func (i *AtomicInt) Value() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL