Skip to content

Commit

Permalink
Comments and unused consts
Browse files Browse the repository at this point in the history
This tidies up comments as per issues #254 and #274 and removes unused constants.
  • Loading branch information
MattBrittan authored Nov 13, 2024
2 parents 7474a8a + 65a78fd commit dfcd15e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion autopaho/auto.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ type ClientConfig struct {
// To fix, use packets.NewThreadSafeConn wrapper or extend the custom net.Conn struct with sync.Locker.
AttemptConnection func(context.Context, ClientConfig, *url.URL) (net.Conn, error)

OnConnectionUp func(*ConnectionManager, *paho.Connack) // Called (within a goroutine) when a connection is made (including reconnection). Connection Manager passed to simplify subscriptions.
OnConnectionUp func(*ConnectionManager, *paho.Connack) // Called when a connection is made (including reconnection). Connection Manager passed to simplify subscriptions. Supplied function must not block.
OnConnectError func(error) // Called (within a goroutine) whenever a connection attempt fails. Will wrap autopaho.ConnackError on server deny.

Debug log.Logger // By default set to NOOPLogger{},set to a logger for debugging info
Expand Down
10 changes: 2 additions & 8 deletions paho/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ import (
"github.com/eclipse/paho.golang/paho/session/state"
)

type MQTTVersion byte

const (
MQTTv311 MQTTVersion = 4
MQTTv5 MQTTVersion = 5
)

const defaultSendAckInterval = 50 * time.Millisecond

var (
Expand Down Expand Up @@ -91,7 +84,8 @@ type (
PacketTimeout time.Duration
// OnServerDisconnect is called only when a packets.DISCONNECT is received from server
OnServerDisconnect func(*Disconnect)
// OnClientError is for example called on net.Error
// OnClientError is for example called on net.Error. Note that this may be called multiple times and may be
// called following a successful `Disconnect`. See autopaho.errorHandler for an example.
OnClientError func(error)
// PublishHook allows a user provided function to be called before
// a Publish packet is sent allowing it to inspect or modify the
Expand Down

0 comments on commit dfcd15e

Please sign in to comment.