Documentation ¶
Overview ¶
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func IsEOF(err error) bool
- func MQTTClientOptsFromURL(us, clientID, user, pass string) (*mqtt.ClientOptions, string, error)
- func MkDigestResp(method, uri, username, realm, passwd, algorithm, nonce, nc, qop string) (int, string, error)
- type AzureDMCodecOptions
- type Codec
- func InboundHTTP(rw http.ResponseWriter, req *http.Request, cloudHost string) Codec
- func MQTT(dst string, tlsConfig *tls.Config, co *MQTTCodecOptions) (Codec, error)
- func NewAzureDMCodec(connectURL string, opts *AzureDMCodecOptions) (Codec, error)
- func NewGCPCodec(connectURL string, opts *GCPCodecOptions) (Codec, error)
- func NewReconnectWrapperCodec(addr string, connect ConnectFunc) Codec
- func NewWatsonCodec(dst string, tlsConfig *tls.Config, co *WatsonCodecOptions) (Codec, error)
- func OutboundHTTP(url string, tlsConfig *tls.Config, opts OutboundHTTPCodecOptions) Codec
- func Serial(ctx context.Context, portName string, opts *SerialCodecOptions) (Codec, error)
- func TCP(conn net.Conn) Codec
- func UDP(addr string) Codec
- func WebSocket(conn *websocket.Conn) Codec
- type ConnectFunc
- type ConnectionInfo
- type GCPCodecOptions
- type MQTTCodecOptions
- type Options
- type OutboundHTTPCodecOptions
- type SerialCodecOptions
- type UDPCodecOptions
- type WatsonCodecOptions
Constants ¶
const (
AzureDMURLScheme = "azdm"
)
const (
// gcp://project/region/registry/device?topic=...&sub=...&reqsf=....&respsf=...
GCPURLScheme = "gcp"
)
const (
UDPURLScheme = "udp"
)
const (
WSProtocol = "clubby.cesanta.com"
)
const (
WatsonURLScheme = "watson"
)
Variables ¶
This section is empty.
Functions ¶
func MQTTClientOptsFromURL ¶
func MQTTClientOptsFromURL(us, clientID, user, pass string) (*mqtt.ClientOptions, string, error)
Types ¶
type AzureDMCodecOptions ¶
type AzureDMCodecOptions struct {
ConnectionString string
}
type Codec ¶
type Codec interface { // Recv returns the next incoming frame. Recv(context.Context) (*frame.Frame, error) // Send sends the frame to the remote peer. Send(context.Context, *frame.Frame) error // Close closes the channel. Close() // CloseNotify() returns a channel that will be closed once the underlying channel has been closed. CloseNotify() <-chan struct{} // Can accept this many outgoing frames. 0 means no frames can be sent, values < 0 mean no limit. MaxNumFrames() int // Info() returns information about underlying connection. Info() ConnectionInfo // SetOptions() adjusts codec options. SetOptions(opts *Options) error }
Codec represents a transport for clubby frames.
func InboundHTTP ¶
func NewAzureDMCodec ¶
func NewAzureDMCodec(connectURL string, opts *AzureDMCodecOptions) (Codec, error)
func NewGCPCodec ¶
func NewGCPCodec(connectURL string, opts *GCPCodecOptions) (Codec, error)
func NewReconnectWrapperCodec ¶
func NewReconnectWrapperCodec(addr string, connect ConnectFunc) Codec
func NewWatsonCodec ¶
func OutboundHTTP ¶
func OutboundHTTP(url string, tlsConfig *tls.Config, opts OutboundHTTPCodecOptions) Codec
OutboundHTTP sends outbound frames in HTTP POST requests and returns replies with Recv.
type ConnectFunc ¶
type ConnectionInfo ¶
type ConnectionInfo struct { IsConnected bool // TLS indicates if the connection uses TLS or not. TLS bool // RemoteAddr is the address of the remote peer. RemoteAddr string // PeerCertificates is the certificate chain presented by the peer. PeerCertificates []*x509.Certificate }
ConnectionInfo provides information about the connection.
type GCPCodecOptions ¶
type GCPCodecOptions struct {
CreateTopic bool
}
type MQTTCodecOptions ¶
type Options ¶
type Options struct { AzureDM AzureDMCodecOptions GCP GCPCodecOptions HTTPOut OutboundHTTPCodecOptions MQTT MQTTCodecOptions Serial SerialCodecOptions UDP UDPCodecOptions Watson WatsonCodecOptions }
type SerialCodecOptions ¶
type UDPCodecOptions ¶
type UDPCodecOptions struct { }