package
0.9.0-alpha
Repository: https://github.com/denopink/webpa-common.git
Documentation: pkg.go.dev

# Functions

ConnectListeners aggregates multiple listeners into one.
DisconnectListeners aggregates multiple listeners into one.
EncodeConvey transforms a Convey map into its on-the-wire representation, using the supplied encoding.
IDHashParser creates a parsing function that examines an HTTP request to produce a []byte key for consistent hashing.
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.
MessageListeners aggregates multiple listeners into one.
No description provided by the author
No description provided by the author
NewConnectHandler produces an http.Handler that allows devices to connect to a specific Manager.
NewConnectionFactory produces a ConnectionFactory instance from a set of Options.
NewDeviceListHandler returns an http.Handler that renders a JSON listing of the devices within a manager.
NewDialer constructs a WebPA Dialer using a set of Options and a gorilla Dialer.
No description provided by the author
NewManager constructs a Manager from a set of options.
No description provided by the author
No description provided by the author
NewOptions unmarshals a device.Options from a Viper environment.
ParseConvey decodes a value using the supplied encoding and then unmarshals the result as a Convey map.
ParseID parses a raw device name into a canonicalized identifier.
PongListeners aggregates multiple listeners into one.
UUIDKeyFunc produces a KeyFunc which creates type 4 UUIDs for device Keys.

# 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
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": { } } }.

# Structs

Options represent the available configuration options for device Managers and ConnectionFactories.

# Interfaces

Connection represents a websocket connection to a WebPA-compatible device.
ConnectionFactory provides the instantiation logic for Connections.
DeviceError is the common interface implemented by all error objects which carry device-related metadata.
Dialer is a WebPA dialer for websocket Connections.
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.

# Type aliases

ConnectListener is a function which receives notifications when devices successfully connect to the system.
Convey represents an arbitrary block of JSON that should be transmitted in HTTP requests related to devices.
DisconnectListener is a function which receives notifications when devices disconnect (or, are disconnected) from the system.
ID represents a normalized identifer for a device.
Key is a routing identifier for a device.
KeyFunc returns the unique Key for a device at the point of connection.
MessageListener represents a sink for device messages.
PongListener is a function which receives notifications when devices disconnect (or, are disconnected) from the system.