Documentation ¶
Overview ¶
Package server provides the implementation of the HTTP server components used by the gateway.
Index ¶
- func AssertSpan(t *testing.T, span *tracetest.SpanStub, name string, attributes map[string]any)
- func GetTracer() (trace.Tracer, *tracetest.InMemoryExporter)
- func NewBroker(t *testing.T) (*mqtt.Server, *url.URL)
- func NewStatusHandler() http.Handler
- func NewWebsocketHandler(opts ...WebsocketOpt) http.Handler
- func TLSOffload(registry registry.DeviceRegistry) func(http.Handler) http.Handler
- func TraceRequest(tracer trace.Tracer) func(http.Handler) http.Handler
- type Server
- type WebsocketHandler
- type WebsocketOpt
- func WithDeviceRegistry(deviceRegistry registry.DeviceRegistry) WebsocketOpt
- func WithMqttBrokerUrl(brokerUrl *url.URL) WebsocketOpt
- func WithMqttBrokerUrlString(brokerUrl string) WebsocketOpt
- func WithMqttBrokerUrls(brokerUrls []*url.URL) WebsocketOpt
- func WithMqttConnectSettings(mqttConnectTimeout, mqttConnectRetryDelay, mqttKeepAliveInterval time.Duration) WebsocketOpt
- func WithMqttTopicPrefix(topicPrefix string) WebsocketOpt
- func WithOrgName(orgName string) WebsocketOpt
- func WithOrgNames(orgNames []string) WebsocketOpt
- func WithOtelTracer(tracer trace.Tracer) WebsocketOpt
- func WithPipeOption(pipeOption pipe.Opt) WebsocketOpt
- func WithPipeOptions(pipeOption []pipe.Opt) WebsocketOpt
- func WithTrustProxyHeaders(trustProxyHeaders bool) WebsocketOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertSpan ¶
func NewStatusHandler ¶
func NewWebsocketHandler ¶
func NewWebsocketHandler(opts ...WebsocketOpt) http.Handler
func TLSOffload ¶
Types ¶
type WebsocketHandler ¶
type WebsocketHandler struct {
// contains filtered or unexported fields
}
func (*WebsocketHandler) ServeHTTP ¶
func (s *WebsocketHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type WebsocketOpt ¶
type WebsocketOpt func(handler *WebsocketHandler)
func WithDeviceRegistry ¶
func WithDeviceRegistry(deviceRegistry registry.DeviceRegistry) WebsocketOpt
func WithMqttBrokerUrl ¶
func WithMqttBrokerUrl(brokerUrl *url.URL) WebsocketOpt
func WithMqttBrokerUrlString ¶
func WithMqttBrokerUrlString(brokerUrl string) WebsocketOpt
func WithMqttBrokerUrls ¶
func WithMqttBrokerUrls(brokerUrls []*url.URL) WebsocketOpt
func WithMqttConnectSettings ¶
func WithMqttConnectSettings(mqttConnectTimeout, mqttConnectRetryDelay, mqttKeepAliveInterval time.Duration) WebsocketOpt
func WithMqttTopicPrefix ¶
func WithMqttTopicPrefix(topicPrefix string) WebsocketOpt
func WithOrgName ¶
func WithOrgName(orgName string) WebsocketOpt
func WithOrgNames ¶
func WithOrgNames(orgNames []string) WebsocketOpt
func WithOtelTracer ¶
func WithOtelTracer(tracer trace.Tracer) WebsocketOpt
func WithPipeOption ¶
func WithPipeOption(pipeOption pipe.Opt) WebsocketOpt
func WithPipeOptions ¶
func WithPipeOptions(pipeOption []pipe.Opt) WebsocketOpt
func WithTrustProxyHeaders ¶
func WithTrustProxyHeaders(trustProxyHeaders bool) WebsocketOpt
Source Files ¶
Click to show internal directories.
Click to hide internal directories.