package
1.11.9
Repository: https://github.com/xmidt-org/webpa-common.git
Documentation: pkg.go.dev

# Packages

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

# Functions

DecodeRequest decodes a WRP source into a device Request.
DefaultDialer returns a useful default device Dialer.
EncodeResponse writes out a device transaction Response to an http Response.
GetDeviceMetadata returns the device metadata from the context if any.
GetID returns the device ID from the context if any.
IDHashParser is a parsing function that examines an HTTP request to produce a []byte key for consistent hashing.
No description provided by the author
No description provided by the author
IntToMAC accepts a 64-bit integer and formats that as a device MAC address identifier The returned ID will be of the form mac:XXXXXXXXXXXX, where X is a hexadecimal digit using lowercased letters.
Metrics is the device module function that adds default device metrics.
MustDialDevice panics if the dial operation fails.
NewDeadline creates a deadline closure given a timeout and a now function.
NewDialer produces a device dialer using the supplied set of options.
NewManager constructs a Manager from a set of options.
NewMeasures constructs a Measures given a go-kit metrics Provider.
NewOptions unmarshals a device.Options from a Viper environment.
NewPinger creates a ping closure for the given connection.
NewStatistics creates a Statistics instance with the given connection time If now is nil, this method uses time.Now.
No description provided by the author
ParseID parses a raw device name into a canonicalized identifier.
SetPongHandler establishes an instrumented pong handler for the given connection that enforces the given read timeout.
Timeout returns an Alice-style constructor which enforces a timeout for all device request contexts.
WithDeviceMetadata returns a new context with the given metadata as a value.
WithID returns a new context with the given device ID as a value.
WithIDRequest returns a new HTTP request with the given device ID in the associated Context.

# Constants

Check types for the WRP Source check.
Check types for the WRP Source check.
Connect indicates a successful device connection.
No description provided by the author
ConveyHeader is the name of the optional HTTP header which contains the encoded convey JSON.
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
No description provided by the author
DefaultWRPContentType is the content type used on inbound WRP messages which don't provide one.
No description provided by the author
No description provided by the author
DeviceManagerKey is the Viper subkey under which device.Options are typically stored In a JSON configuration file, this will be expressed as: { /* other stuff can be here */ "device": { "manager": { } } }.
DeviceNameHeader is the name of the HTTP header which contains the device service name.
Disconnect indicates a device disconnection.
No description provided by the author
No description provided by the author
No description provided by the author
Reserved metadata keys.
No description provided by the author
MessageFailed indicates that a message could not be sent to a device, either because of a communications error or due to the device disconnecting.
MessageReceived indicates that a message has been successfully received and dispatched to any goroutine waiting on it, as would be the case for a response.
MessageSent indicates that a message was successfully dispatched to a device.
No description provided by the author
Top level JWTClaim keys.
No description provided by the author
No description provided by the author
No description provided by the author
Reserved metadata keys.
TransactionBroken indicates receipt of a message that had a transaction key for which there was no waiting transaction.
TransactionComplete indicates that a response to a transaction has been received, and the transaction completed successfully (at least as far as the routing infrastructure can tell).
Top level JWTClaim keys.
Default values.
No description provided by the author

# Variables

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
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
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UseID is a collection of Alice-style constructors that all insert the device ID into the delegate's request Context using various strategies.

# Structs

CloseReason exposes metadata around why a particular device was closed.
ConnectHandler is used to initiate a concurrent connection between a Talaria and a device by upgrading a http connection to a websocket.
DialerOptions represents the set of options available when creating a custom device Dialer.
Event represents a single occurrence of interest for device-related applications.
ListHandler is an HTTP handler which can take updated JSON device lists.
No description provided by the author
Measures is a convenient struct that holds all the device-related metric objects for runtime consumption.
MessageHandler is a configurable http.Handler which handles inbound WRP traffic to be sent to devices.
Metadata contains information such as security credentials related to a device.
No description provided by the author
No description provided by the author
No description provided by the author
Options represent the available configuration options for components within this package.
Request represents a single device Request, carrying routing information and message contents.
Response represents the response to a device request.
StatHandler is an http.Handler that returns device statistics.
Transactions represents a set of pending transactions.

# Interfaces

Connection describes the set of behaviors for device connections used by this package.
Connector is a strategy interface for managing device connections to a server.
Dialer is a device-specific dialer for device websocket connections.
No description provided by the author
Interface is the core type for this package.
Manager supplies a hub for connecting and disconnecting devices as well as an access point for obtaining device metadata.
ReadCloser adds io.Closer behavior to Reader.
Reader represents the read behavior of a device connection.
Registry is the strategy interface for querying the set of connected devices.
Router handles dispatching messages to devices.
Statistics represents a set of device statistics.
WriteCloser adds io.Closer behavior to Writer.
Writer represents the write behavior of a device connection.

# Type aliases

EventType is the type of device-related event.
No description provided by the author
ID represents a normalized identifer for a device.
IDFromRequest is a strategy type for extracting the device identifier from an HTTP request.
Listener is an event sink.
ManagerOption is a configuration option for a manager.
WRPSourceCheckType is used to define the different modes in which the source check can run.