package
1.65.4
Repository: https://github.com/untangle/golang-shared.git
Documentation: pkg.go.dev

# Functions

CallCollectors is a stub for the RPC call.
FillDeviceListWithZMQDeviceMessages will run an infinite loop receiving messages from channel and putting them into the device list.
Get the device discovery entries lastUpdate time is older than the duration(24 hours).
MergeZmqMessageIntoDeviceList merges a zmq message into the device list, by unmarshalling it, putting it into a DeviceEntry, and merging it.
NewDataTracker creates a new data tracker that keeps bisn with binInterval duration and a max track time of maxInterval.
NewDevicesList returns a new DevicesList which is ready for use.
Normalizes the data in each collector entry Returns an error if the data couldn't be normalized or if the provided argument isn't a pointer to a collector struct.
PredsToTransformers transforms a list of predicates to transformers which return the device pointer if the pred is true else nil.
TrimToDataUseSince trims the tracked data use to be within the specified period.
WithUpdatesWithinDuration returns a predicate ensuring that the LastUpdate member was within the period.
Wraps an LLDP, NMAP, or NEIGH collector struct in a device entry If the collector struct is missing a field needed to initialize the collector struct, and error is returned.
WrapPredicateAsTransformer returns a ListElementTransformer that returns nil if the predicate fails, else the entry.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

CallCollectorsRequest - request for the CallCollectors RPC stub, a stronger-typed wrapper for the RPC func's request.
CallCollectorsResponse - CallCollectors RPC stub response, wrapper for the RPC func's response.
DataTracker is for tracking data use over time, keeping the data use in 'bins' which are for some specified time interval.
DataUse is an interval of data use by the device.
DataUseAmount is a utility struct for dealing with rx/tx pairs.
DeviceEntry represents a device found via discovery and methods on it.
DevicesList is an in-memory 'list' of all known devices (stored as a map from mac address string to device).
SessionDetail is a summary of active session details for a device.
ZmqMessage is a message sent over a zmq bus for us to consume.

# Type aliases

No description provided by the author
ListElementTransformer is a function that transforms its input in some way.
ListPredicate is a function that when applied to an entry returns true if it 'accepts' the entry.