You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SessionClientConfigFromEnv parses a session client configuration from well\-known environment variables. Note that this will only return an error if the environment variables parse incorrectly; it will not return an error if required parameters \(e.g. for the connection provider\) are missing, to allow optional parameters to be specified from environment independently.
114
+
RandomClientID generates a random valid MQTT client ID. This should never be used in production \(as it fully invalidates all session guarantees\) but can be useful in testing to prevent parallel tests from conflicting.
114
115
115
116
<a name="Ack"></a>
116
117
## type [Ack](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/alias.go#L30>)
@@ -299,6 +300,28 @@ DisconnectEventHandler is a user\-defined callback function used to respond to d
299
300
type DisconnectEventHandler = mqtt.DisconnectEventHandler
300
301
```
301
302
303
+
<a name="Env"></a>
304
+
## type [Env](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/env.go#L18-L22>)
305
+
306
+
Env provides all session client parameters parsed from well\-known environment variables.
SessionClientConfigFromEnv parses a session client configuration from well\-known environment variables. Note that this will only return an error if the environment variables parse incorrectly; it will not return an error if required parameters \(e.g. for the connection provider\) are missing, to allow optional parameters to be specified from environment independently.
324
+
302
325
<a name="FatalConnackError"></a>
303
326
## type [FatalConnackError](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/errors.go#L116-L118>)
ConstantUsername is a UsernameProvider implementation that returns an unchanging username. This can be used if the username does not need to be updated between MQTT connections.
750
772
751
773
<a name="WithCleanStart"></a>
752
-
## type [WithCleanStart](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L50>)
774
+
## type [WithCleanStart](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L45>)
753
775
754
776
WithCleanStart sets whether the initial connection will be made without retaining any existing session state. This is by definition set to false for any reconnections.
755
777
756
778
```go
757
779
type WithCleanStart bool
758
780
```
759
781
760
-
<a name="WithClientID"></a>
761
-
## type [WithClientID](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L45>)
762
-
763
-
WithClientID sets the client identifier. If not provided, it will default to a random valid client ID to support session reconnection.
764
-
765
-
```go
766
-
type WithClientID string
767
-
```
768
-
769
782
<a name="WithConnectUserProperties"></a>
770
-
## type [WithConnectUserProperties](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L63>)
783
+
## type [WithConnectUserProperties](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L58>)
771
784
772
785
WithConnectUserProperties sets the user properties for the CONNECT packet.
773
786
@@ -776,7 +789,7 @@ type WithConnectUserProperties map[string]string
776
789
```
777
790
778
791
<a name="WithConnectionTimeout"></a>
779
-
## type [WithConnectionTimeout](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L41>)
792
+
## type [WithConnectionTimeout](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L40>)
780
793
781
794
WithConnectionTimeout sets the connection timeout for a single connection attempt. If a timeout is desired for the entire connection process, it should be specified via the connection retry policy.
782
795
@@ -803,7 +816,7 @@ type WithCorrelationData = mqtt.WithCorrelationData
803
816
```
804
817
805
818
<a name="WithKeepAlive"></a>
806
-
## type [WithKeepAlive](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L53>)
819
+
## type [WithKeepAlive](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L48>)
807
820
808
821
WithKeepAlive sets the keep\-alive interval \(in seconds\).
809
822
@@ -830,7 +843,7 @@ type WithNoLocal = mqtt.WithNoLocal
830
843
```
831
844
832
845
<a name="WithPassword"></a>
833
-
## type [WithPassword](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L71>)
846
+
## type [WithPassword](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L66>)
834
847
835
848
WithPassword sets the PasswordProvider that the session client uses to get the password for each connection.
836
849
@@ -857,7 +870,7 @@ type WithQoS = mqtt.WithQoS
857
870
```
858
871
859
872
<a name="WithReceiveMaximum"></a>
860
-
## type [WithReceiveMaximum](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L59>)
873
+
## type [WithReceiveMaximum](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L54>)
861
874
862
875
WithReceiveMaximum sets the client\-side receive maximum.
863
876
@@ -893,7 +906,7 @@ type WithRetainHandling = mqtt.WithRetainHandling
893
906
```
894
907
895
908
<a name="WithSessionExpiry"></a>
896
-
## type [WithSessionExpiry](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L56>)
909
+
## type [WithSessionExpiry](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L51>)
897
910
898
911
WithSessionExpiry sets the session expiry interval \(in seconds\).
899
912
@@ -911,7 +924,7 @@ type WithUserProperties = mqtt.WithUserProperties
911
924
```
912
925
913
926
<a name="WithUsername"></a>
914
-
## type [WithUsername](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L67>)
927
+
## type [WithUsername](<https://github.com/Azure/iot-operations-sdks/blob/main/go/mqtt/session_client_options.go#L62>)
915
928
916
929
WithUsername sets the UsernameProvider that the session client uses to get the username for each connection.
0 commit comments