<!-- Code generated by gomarkdoc. DO NOT EDIT -->

```go
import "github.com/Azure/iot-operations-sdks/go/internal/mqtt"
```

## Index

- [type Ack](<#Ack>)
- [type ConnectEvent](<#ConnectEvent>)
- [type ConnectEventHandler](<#ConnectEventHandler>)
- [type DisconnectEvent](<#DisconnectEvent>)
- [type DisconnectEventHandler](<#DisconnectEventHandler>)
- [type Message](<#Message>)
- [type MessageHandler](<#MessageHandler>)
- [type PublishOption](<#PublishOption>)
- [type PublishOptions](<#PublishOptions>)
  - [func \(o \*PublishOptions\) Apply\(opts \[\]PublishOption, rest ...PublishOption\)](<#PublishOptions.Apply>)
- [type SubscribeOption](<#SubscribeOption>)
- [type SubscribeOptions](<#SubscribeOptions>)
  - [func \(o \*SubscribeOptions\) Apply\(opts \[\]SubscribeOption, rest ...SubscribeOption\)](<#SubscribeOptions.Apply>)
- [type UnsubscribeOption](<#UnsubscribeOption>)
- [type UnsubscribeOptions](<#UnsubscribeOptions>)
  - [func \(o \*UnsubscribeOptions\) Apply\(opts \[\]UnsubscribeOption, rest ...UnsubscribeOption\)](<#UnsubscribeOptions.Apply>)
- [type WithContentType](<#WithContentType>)
- [type WithCorrelationData](<#WithCorrelationData>)
- [type WithMessageExpiry](<#WithMessageExpiry>)
- [type WithNoLocal](<#WithNoLocal>)
- [type WithPayloadFormat](<#WithPayloadFormat>)
- [type WithQoS](<#WithQoS>)
- [type WithResponseTopic](<#WithResponseTopic>)
- [type WithRetain](<#WithRetain>)
- [type WithRetainHandling](<#WithRetainHandling>)
- [type WithUserProperties](<#WithUserProperties>)


<a name="Ack"></a>
## type [Ack](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/types.go#L46-L50>)

Ack contains values from PUBACK/SUBACK/UNSUBACK packets received from the MQTT server.

```go
type Ack struct {
    ReasonCode     byte
    ReasonString   string
    UserProperties map[string]string
}
```

<a name="ConnectEvent"></a>
## type [ConnectEvent](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/types.go#L25-L27>)

ConnectEvent contains the relevent metadata provided to the handler when the MQTT client connects to the broker.

```go
type ConnectEvent struct {
    ReasonCode byte
}
```

<a name="ConnectEventHandler"></a>
## type [ConnectEventHandler](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/types.go#L31>)

ConnectEventHandler is a user\-defined callback function used to respond to connection notifications from the MQTT client.

```go
type ConnectEventHandler = func(*ConnectEvent)
```

<a name="DisconnectEvent"></a>
## type [DisconnectEvent](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/types.go#L35-L38>)

DisconnectEvent contains the relevent metadata provided to the handler when the MQTT client disconnects from the broker.

```go
type DisconnectEvent struct {
    ReasonCode *byte
    Error      error
}
```

<a name="DisconnectEventHandler"></a>
## type [DisconnectEventHandler](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/types.go#L42>)

DisconnectEventHandler is a user\-defined callback function used to respond to disconnection notifications from the MQTT client.

```go
type DisconnectEventHandler = func(*DisconnectEvent)
```

<a name="Message"></a>
## type [Message](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/types.go#L9-L17>)

Message represents a received message.

```go
type Message struct {
    Topic   string
    Payload []byte
    PublishOptions

    // Ack will manually ack the message. All handled messages must be acked
    // (except for QoS 0 messages, in which case this is a no-op).
    Ack func()
}
```

<a name="MessageHandler"></a>
## type [MessageHandler](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/types.go#L21>)

MessageHandler is a user\-defined callback function used to handle messages received on the subscribed topic.

```go
type MessageHandler = func(context.Context, *Message)
```

<a name="PublishOption"></a>
## type [PublishOption](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L45>)

PublishOption represents a single publish option.

```go
type PublishOption interface {
    // contains filtered or unexported methods
}
```

<a name="PublishOptions"></a>
## type [PublishOptions](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L33-L42>)

PublishOptions are the resolved publish options.

```go
type PublishOptions struct {
    ContentType     string
    CorrelationData []byte
    MessageExpiry   uint32
    PayloadFormat   byte
    QoS             byte
    ResponseTopic   string
    Retain          bool
    UserProperties  map[string]string
}
```

<a name="PublishOptions.Apply"></a>
### func \(\*PublishOptions\) [Apply](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L179-L182>)

```go
func (o *PublishOptions) Apply(opts []PublishOption, rest ...PublishOption)
```

Apply resolves the provided list of options.

<a name="SubscribeOption"></a>
## type [SubscribeOption](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L22>)

SubscribeOption represents a single subscribe option.

```go
type SubscribeOption interface {
    // contains filtered or unexported methods
}
```

<a name="SubscribeOptions"></a>
## type [SubscribeOptions](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L13-L19>)

SubscribeOptions are the resolved subscribe options.

```go
type SubscribeOptions struct {
    NoLocal        bool
    QoS            byte
    Retain         bool
    RetainHandling byte
    UserProperties map[string]string
}
```

<a name="SubscribeOptions.Apply"></a>
### func \(\*SubscribeOptions\) [Apply](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L145-L148>)

```go
func (o *SubscribeOptions) Apply(opts []SubscribeOption, rest ...SubscribeOption)
```

Apply resolves the provided list of options.

<a name="UnsubscribeOption"></a>
## type [UnsubscribeOption](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L30>)

UnsubscribeOption represents a single unsubscribe option.

```go
type UnsubscribeOption interface {
    // contains filtered or unexported methods
}
```

<a name="UnsubscribeOptions"></a>
## type [UnsubscribeOptions](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L25-L27>)

UnsubscribeOptions are the resolve unsubscribe options.

```go
type UnsubscribeOptions struct {
    UserProperties map[string]string
}
```

<a name="UnsubscribeOptions.Apply"></a>
### func \(\*UnsubscribeOptions\) [Apply](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L162-L165>)

```go
func (o *UnsubscribeOptions) Apply(opts []UnsubscribeOption, rest ...UnsubscribeOption)
```

Apply resolves the provided list of options.

<a name="WithContentType"></a>
## type [WithContentType](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L48>)

WithContentType sets the content type for the publish.

```go
type WithContentType string
```

<a name="WithCorrelationData"></a>
## type [WithCorrelationData](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L51>)

WithCorrelationData sets the correlation data for the publish.

```go
type WithCorrelationData []byte
```

<a name="WithMessageExpiry"></a>
## type [WithMessageExpiry](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L54>)

WithMessageExpiry sets the message expiry interval for the publish.

```go
type WithMessageExpiry uint32
```

<a name="WithNoLocal"></a>
## type [WithNoLocal](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L57>)

WithNoLocal sets the no local flag for the subscription.

```go
type WithNoLocal bool
```

<a name="WithPayloadFormat"></a>
## type [WithPayloadFormat](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L60>)

WithPayloadFormat sets the payload format indicator for the publish.

```go
type WithPayloadFormat byte
```

<a name="WithQoS"></a>
## type [WithQoS](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L63>)

WithQoS sets the QoS level for the publish or subscribe.

```go
type WithQoS byte
```

<a name="WithResponseTopic"></a>
## type [WithResponseTopic](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L66>)

WithResponseTopic sets the response topic for the publish.

```go
type WithResponseTopic string
```

<a name="WithRetain"></a>
## type [WithRetain](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L70>)

WithRetain sets the retain flag for the publish or the retain\-as\-publish flag for the subscribe.

```go
type WithRetain bool
```

<a name="WithRetainHandling"></a>
## type [WithRetainHandling](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L74>)

WithRetainHandling specifies the handling of retained messages on the subscribe.

```go
type WithRetainHandling byte
```

<a name="WithUserProperties"></a>
## type [WithUserProperties](<https://github.com/Azure/iot-operations-sdks/blob/main/go/internal/mqtt/options.go#L77>)

WithUserProperties sets the user properties for the publish or subscribe.

```go
type WithUserProperties map[string]string
```

Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)
