Documentation ¶
Overview ¶
Package mux provides a service to split incoming directip messages to backend HTTP services. The mux stores a list of targets and each target has a pattern for an IMEI. If the IMEI of the incoming message matches with the given regurlar expression, the mux will send an HTTP request with a JSON message to the configured backend.
Every target service will receive a sbd.InformationElements as a JSON representation in its POST body. Please take into account that this service and package does not parse the payload which is of type []byte. Many devices use the payload to transfer specific types of data. Your backend service has to know how to handle these types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Distributer ¶
type Distributer interface { WithTargets(targets Targets) error Targets() Targets Handle(data *sbd.InformationBucket) error Close() }
A Distributer can handle the SBD data and dispatches them to the targets. When the targets are reconfigured, the can be set vith WithTargets.
type Target ¶
type Target struct { ID string `yaml:"id,omitempty"` IMEIPattern string `yaml:"imeipattern"` Backend string `yaml:"backend"` SkipTLS bool `yaml:"skiptls,omitempty"` Header map[string]string `yaml:"header"` // contains filtered or unexported fields }
A Target stores the configuration of a backend service where the SBD data should be pushed.